@Override public boolean hasVersionIdPart() { return isNotBlank(getVersionIdPart()); }
@Override public Long getVersionIdPartAsLong() { if (!hasVersionIdPart()) { return null; } return Long.parseLong(getVersionIdPart()); }
@Override public boolean isVersionIdPartValidLong() { return isValidLong(getVersionIdPart()); }
/** * Returns true if this IdDt matches the given IdDt in terms of resource type and ID, but ignores the URL base */ @SuppressWarnings("deprecation") public boolean equalsIgnoreBase(IdDt theId) { if (theId == null) { return false; } if (theId.isEmpty()) { return isEmpty(); } return ObjectUtils.equals(getResourceType(), theId.getResourceType()) && ObjectUtils.equals(getIdPart(), theId.getIdPart()) && ObjectUtils.equals(getVersionIdPart(), theId.getVersionIdPart()); }
retVal.setResourceType(id.getResourceType()); retVal.setResourceId(id.getIdPart()); retVal.setVersionId(id.getVersionIdPart()); return retVal;
@Override public IdDt withResourceType(String theResourceName) { if (isLocal() || isUrn()) { return new IdDt(getValueAsString()); } return new IdDt(theResourceName, getIdPart(), getVersionIdPart()); }
/** * Returns a view of this ID as a fully qualified URL, given a server base and resource name (which will only be used if the ID does not already contain those respective parts). Essentially, * because IdDt can contain either a complete URL or a partial one (or even jut a simple ID), this method may be used to translate into a complete URL. * * @param theServerBase The server base (e.g. "http://example.com/fhir") * @param theResourceType The resource name (e.g. "Patient") * @return A fully qualified URL for this ID (e.g. "http://example.com/fhir/Patient/1") */ @Override public IdDt withServerBase(String theServerBase, String theResourceType) { if (isLocal() || isUrn()) { return new IdDt(getValueAsString()); } return new IdDt(theServerBase, theResourceType, getIdPart(), getVersionIdPart()); }
/** * Returns a new IdDt containing this IdDt's values but with no server base URL if one is present in this IdDt. For example, if this IdDt contains the ID "http://foo/Patient/1", this method will * return a new IdDt containing ID "Patient/1". */ @Override public IdDt toUnqualified() { if (isLocal() || isUrn()) { return new IdDt(getValueAsString()); } return new IdDt(getResourceType(), getIdPart(), getVersionIdPart()); }
nextEntry.getKey().getResponse().setEtag(nextEntry.getValue().getIdDt().getVersionIdPart());
String responseEtag = nextEntry.getValue().getIdDt().getVersionIdPart(); myVersionAdapter.setResponseLocation(nextEntry.getKey(), responseLocation); myVersionAdapter.setResponseETag(nextEntry.getKey(), responseEtag);
String versionIdPart = resourceId.getVersionIdPart(); if (isBlank(versionIdPart)) { versionIdPart = ResourceMetadataKeyEnum.VERSION.get(resource);
@Override public Long getVersionIdPartAsLong() { if (!hasVersionIdPart()) { return null; } return Long.parseLong(getVersionIdPart()); }
InstantDt updated = (InstantDt) resource.getResourceMetadata().get(ResourceMetadataKeyEnum.UPDATED); IdDt resourceId = resource.getId(); String versionIdPart = resourceId.getVersionIdPart(); if (isBlank(versionIdPart)) { versionIdPart = ResourceMetadataKeyEnum.VERSION.get(resource);
} else { String resourceType = myContext.getResourceDefinition(next).getName(); nextEntry.getRequest().setUrl(new IdDt(theServerBase, resourceType, next.getId().getIdPart(), next.getId().getVersionIdPart()).getValue());
@Override public Map<String, String> getDetail() { Map<String, String> details = new HashMap<String, String>(); details.put("subject", myResource.getSubject().getReference().getValue()); details.put("version", myResource.getId().getVersionIdPart()); return details; }
@Override public Map<String, String> getDetail() { Map<String, String> details = new HashMap<String, String>(); details.put("dateIssued", myDiagnosticReport.getIssued().getValueAsString()); details.put("version", myDiagnosticReport.getId().getVersionIdPart()); details.put("subject", myDiagnosticReport.getSubject().getReference().getValue()); return details; }
@Override public Map<String, String> getDetail() { if(myResource == null) return null; Map<String, String> details = new HashMap<String, String>(); details.put("dateIssued", myResource.getIssued().getValueAsString()); details.put("version", myResource.getId().getVersionIdPart()); details.put("subject", myResource.getSubject().getReference().getValue()); return details; }
@Override public IdDt withResourceType(String theResourceName) { if (isLocal() || isUrn()) { return new IdDt(getValueAsString()); } return new IdDt(theResourceName, getIdPart(), getVersionIdPart()); }
/** * Returns a new IdDt containing this IdDt's values but with no server base URL if one is present in this IdDt. For example, if this IdDt contains the ID "http://foo/Patient/1", this method will * return a new IdDt containing ID "Patient/1". */ @Override public IdDt toUnqualified() { if (isLocal() || isUrn()) { return new IdDt(getValueAsString()); } return new IdDt(getResourceType(), getIdPart(), getVersionIdPart()); }
System.out.println("Version ID: " + patient.getId().getVersionIdPart());