@Override public boolean equals(Object theArg0) { if (!(theArg0 instanceof IdDt)) { return false; } IdDt id = (IdDt) theArg0; return StringUtils.equals(getValueAsString(), id.getValueAsString()); }
@Override public int hashCode() { HashCodeBuilder b = new HashCodeBuilder(); b.append(getValueAsString()); return b.toHashCode(); }
@Override public String toString() { org.apache.commons.lang3.builder.ToStringBuilder b = new org.apache.commons.lang3.builder.ToStringBuilder(this, org.apache.commons.lang3.builder.ToStringStyle.SHORT_PREFIX_STYLE); b.append("reference", getReference().getValueAsString()); b.append("loaded", getResource() != null); return b.toString(); }
/** * Creates a new instance of this ID which is identical, but refers to the specific version of this resource ID noted by theVersion. * * @param theVersion The actual version string, e.g. "1". If theVersion is blank or null, returns the same as {@link #toVersionless()}} * @return A new instance of IdDt which is identical, but refers to the specific version of this resource ID noted by theVersion. */ @Override public IdDt withVersion(String theVersion) { if (isBlank(theVersion)) { return toVersionless(); } if (isLocal() || isUrn()) { return new IdDt(getValueAsString()); } String existingValue = getValue(); int i = existingValue.indexOf(Constants.PARAM_HISTORY); String value; if (i > 1) { value = existingValue.substring(0, i - 1); } else { value = existingValue; } return new IdDt(value + '/' + Constants.PARAM_HISTORY + '/' + theVersion); }
@Override public IdDt withResourceType(String theResourceName) { if (isLocal() || isUrn()) { return new IdDt(getValueAsString()); } return new IdDt(theResourceName, getIdPart(), getVersionIdPart()); }
@Override public IdDt toUnqualifiedVersionless() { if (isLocal() || isUrn()) { return new IdDt(getValueAsString()); } return new IdDt(getResourceType(), getIdPart()); }
/** * 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()); }
@Override public IdDt toVersionless() { if (isLocal() || isUrn()) { return new IdDt(getValueAsString()); } return new IdDt(getBaseUrl(), getResourceType(), getIdPart(), null); }
/** * 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()); }
@Override public boolean equals(Object theArg0) { if (!(theArg0 instanceof IdDt)) { return false; } IdDt id = (IdDt) theArg0; return StringUtils.equals(getValueAsString(), id.getValueAsString()); }
List<ResourceTable> allDeleted = deleteOutcome.getDeletedEntities(); for (ResourceTable deleted : allDeleted) { deletedResources.add(deleted.getIdDt().toUnqualifiedVersionless().getValueAsString());
@Override public int hashCode() { HashCodeBuilder b = new HashCodeBuilder(); b.append(getValueAsString()); return b.toHashCode(); }
@Override public String toString() { org.apache.commons.lang3.builder.ToStringBuilder b = new org.apache.commons.lang3.builder.ToStringBuilder(this, org.apache.commons.lang3.builder.ToStringStyle.SHORT_PREFIX_STYLE); b.append("reference", getReference().getValueAsString()); b.append("loaded", getResource() != null); return b.toString(); }
@Override public String getName() { if(myMedicationStatement != null){ Medication m = (Medication) myMedicationStatement.getMedication().getResource(); if(m != null){ return "Medication Statement: " + m.getName().getValue(); } return "Medication Statement: " + myMedicationStatement.getId().getValueAsString(); //if we don't have a medication name, use the id as the name } return null; }
@Override public IdDt withResourceType(String theResourceName) { if (isLocal() || isUrn()) { return new IdDt(getValueAsString()); } return new IdDt(theResourceName, getIdPart(), getVersionIdPart()); }
@Override public IdDt toUnqualifiedVersionless() { if (isLocal() || isUrn()) { return new IdDt(getValueAsString()); } return new IdDt(getResourceType(), getIdPart()); }
@Override public String getName() { if(myMedicationPrescription != null){ if(myMedicationPrescription.getMedication() != null){ Medication m = (Medication) myMedicationPrescription.getMedication().getResource(); if(m != null){ return "Medication Prescription: " + m.getName().getValue(); } } return "Medication Prescription: " + myMedicationPrescription.getId().getValueAsString(); //if we don't have a medication name, use the id as the name } return ""; //no medication prescription, nothing to do here }
/** * 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()); }
@Override public IdDt toVersionless() { if (isLocal() || isUrn()) { return new IdDt(getValueAsString()); } return new IdDt(getBaseUrl(), getResourceType(), getIdPart(), null); }