public static boolean matches(Identifier i1, Identifier i2, MatchProfile profile) { if (profile != null) throw new NotImplementedException("Not Implemented Yet"); // in the absence of a profile, we ignore version return matches(i1.getSystem(), i2.getSystem(), null) && matches(i1.getValue(), i2.getValue(), null); }
/** * @return {@link #identifier} (Unique identifier for the substance.) */ // syntactic sugar public Identifier addIdentifier() { //3 Identifier t = new Identifier(); if (this.identifier == null) this.identifier = new ArrayList<Identifier>(); this.identifier.add(t); return t; }
public static void merge(Identifier dst, Identifier src) { if (dst.getUseElement() == null && src.getUseElement() != null) dst.setUseElement(src.getUseElement()); if (dst.getType() == null && src.getType() != null) dst.setType(src.getType()); if (dst.getPeriod() == null && src.getPeriod() != null) dst.setPeriod(src.getPeriod()); if (dst.getAssigner() == null && src.getAssigner() != null) dst.setAssigner(src.getAssigner()); }
public org.hl7.fhir.dstu3.model.Identifier convertIdentifier(org.hl7.fhir.instance.model.Identifier src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.Identifier tgt = new org.hl7.fhir.dstu3.model.Identifier(); copyElement(src, tgt); tgt.setUse(convertIdentifierUse(src.getUse())); tgt.setType(convertCodeableConcept(src.getType())); tgt.setSystem(src.getSystem()); tgt.setValue(src.getValue()); tgt.setPeriod(convertPeriod(src.getPeriod())); tgt.setAssigner(convertReference(src.getAssigner())); return tgt; }
public org.hl7.fhir.instance.model.Identifier convertIdentifier(org.hl7.fhir.dstu3.model.Identifier src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.Identifier tgt = new org.hl7.fhir.instance.model.Identifier(); copyElement(src, tgt); if (src.hasUse()) tgt.setUse(convertIdentifierUse(src.getUse())); if (src.hasType()) tgt.setType(convertCodeableConcept(src.getType())); if (src.hasSystem()) tgt.setSystem(src.getSystem()); if (src.hasValue()) tgt.setValue(src.getValue()); if (src.hasPeriod()) tgt.setPeriod(convertPeriod(src.getPeriod())); if (src.hasAssigner()) tgt.setAssigner(convertReference(src.getAssigner())); return tgt; }
private void checkIdentifier(List<ValidationMessage> errors, String path, WrapperElement focus, Identifier fixed) { checkFixedValue(errors, path + ".use", focus.getNamedChild("use"), fixed.getUseElement(), "use"); checkFixedValue(errors, path + ".type", focus.getNamedChild("type"), fixed.getType(), "type"); checkFixedValue(errors, path + ".system", focus.getNamedChild("system"), fixed.getSystemElement(), "system"); checkFixedValue(errors, path + ".value", focus.getNamedChild("value"), fixed.getValueElement(), "value"); checkFixedValue(errors, path + ".period", focus.getNamedChild("period"), fixed.getPeriod(), "period"); checkFixedValue(errors, path + ".assigner", focus.getNamedChild("assigner"), fixed.getAssigner(), "assigner"); } //
public void enrichDatasetFromDocumentManifest(DocumentManifest documentManifest) { getPatientIds().add(documentManifest.getSubject().getReference()); // If available, use the documentManifest identifier as documentManifestUuid if (!documentManifest.getIdentifier().isEmpty()) { this.documentManifestUuid = documentManifest.getIdentifier().get(0).getValue(); } } }
/** * Handles the PIXm Query * * @param sourceIdentifierParam Identifier to search for. Should be an {@link Identifier}, but obviously * non-primitive types are forbidden in GET operations * @param targetSystemParam target system URI * @return {@link Parameters} containing found identifiers */ @SuppressWarnings("unused") @Operation(name = Iti83Constants.PIXM_OPERATION_NAME, type = Patient.class, idempotent = true, returnParameters = {@OperationParam(name = "return", type = Identifier.class, max = 100)}) public Parameters pixmQuery( @OperationParam(name = SOURCE_IDENTIFIER_NAME) TokenParam sourceIdentifierParam, @OperationParam(name = TARGET_SYSTEM_NAME) UriParam targetSystemParam, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) { Identifier sourceIdentifier = new Identifier() .setSystem(sourceIdentifierParam.getSystem()) .setValue(sourceIdentifierParam.getValue()); UriType targetUri = targetSystemParam == null ? null : new UriType(targetSystemParam.getValue()); Parameters inParams = new Parameters(); inParams.addParameter().setName(SOURCE_IDENTIFIER_NAME).setValue(sourceIdentifier); inParams.addParameter().setName(TARGET_SYSTEM_NAME).setValue(targetUri); // Run down the route return requestResource(inParams, Parameters.class, httpServletRequest, httpServletResponse); }
/** * Handles the PIXm Retrieve. Note that this is not part of the specification, but a useful variant that allows to use resource IDs * in requests such as .../Patient/4711/$ihe-pix would be equivalent with .../Patient/$ihe-pix?sourceIdentifier=URI|4711 where URI * identifies the NamingSystem used for resource IDs * * @param resourceId resource ID * @param targetSystemParam target system URI * @param httpServletRequest servlet request * @param httpServletResponse servlet response * @return {@link Parameters} containing found identifiers */ @Operation(name = Iti83Constants.PIXM_OPERATION_NAME, type = Patient.class, idempotent = true, returnParameters = {@OperationParam(name = "return", type = Identifier.class, max = 100)}) public Parameters pixmRetrieve( @IdParam IdType resourceId, @OperationParam(name = TARGET_SYSTEM_NAME) UriParam targetSystemParam, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) { UriType targetUri = targetSystemParam == null ? null : new UriType(targetSystemParam.getValue()); Parameters inParams = new Parameters(); inParams.addParameter().setName(SOURCE_IDENTIFIER_NAME).setValue(new Identifier().setValue(resourceId.getIdPart())); inParams.addParameter().setName(TARGET_SYSTEM_NAME).setValue(targetUri); // Run down the route return requestResource(inParams, Parameters.class, httpServletRequest, httpServletResponse); } }
public Identifier copy() { Identifier dst = new Identifier(); copyValues(dst); dst.use = use == null ? null : use.copy(); dst.type = type == null ? null : type.copy(); dst.system = system == null ? null : system.copy(); dst.value = value == null ? null : value.copy(); dst.period = period == null ? null : period.copy(); dst.assigner = assigner == null ? null : assigner.copy(); return dst; }
public org.hl7.fhir.r4.model.Identifier convertIdentifier(org.hl7.fhir.instance.model.Identifier src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.r4.model.Identifier tgt = new org.hl7.fhir.r4.model.Identifier(); copyElement(src, tgt); tgt.setUse(convertIdentifierUse(src.getUse())); tgt.setType(convertCodeableConcept(src.getType())); tgt.setSystem(src.getSystem()); tgt.setValue(src.getValue()); tgt.setPeriod(convertPeriod(src.getPeriod())); tgt.setAssigner(convertReference(src.getAssigner())); return tgt; }
public org.hl7.fhir.instance.model.Identifier convertIdentifier(org.hl7.fhir.r4.model.Identifier src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.Identifier tgt = new org.hl7.fhir.instance.model.Identifier(); copyElement(src, tgt); if (src.hasUse()) tgt.setUse(convertIdentifierUse(src.getUse())); if (src.hasType()) tgt.setType(convertCodeableConcept(src.getType())); if (src.hasSystem()) tgt.setSystem(src.getSystem()); if (src.hasValue()) tgt.setValue(src.getValue()); if (src.hasPeriod()) tgt.setPeriod(convertPeriod(src.getPeriod())); if (src.hasAssigner()) tgt.setAssigner(convertReference(src.getAssigner())); return tgt; }
private void checkIdentifier(List<ValidationMessage> errors, String path, WrapperElement focus, Identifier fixed) { checkFixedValue(errors, path + ".use", focus.getNamedChild("use"), fixed.getUseElement(), "use"); checkFixedValue(errors, path + ".type", focus.getNamedChild("type"), fixed.getType(), "type"); checkFixedValue(errors, path + ".system", focus.getNamedChild("system"), fixed.getSystemElement(), "system"); checkFixedValue(errors, path + ".value", focus.getNamedChild("value"), fixed.getValueElement(), "value"); checkFixedValue(errors, path + ".period", focus.getNamedChild("period"), fixed.getPeriod(), "period"); checkFixedValue(errors, path + ".assigner", focus.getNamedChild("assigner"), fixed.getAssigner(), "assigner"); } //
public void enrichDatasetFromDocumentManifest(DocumentManifest documentManifest) { Reference reference = documentManifest.getSubject(); getPatientIds().add(reference.getResource() != null ? reference.getResource().getIdElement().getValue() : reference.getReference()); // If available, use the documentManifest identifier as documentManifestUuid if (!documentManifest.getIdentifier().isEmpty()) { this.documentManifestUuid = documentManifest.getIdentifier().get(0).getValue(); } } }
new Identifier() .setSystem("urn:ietf:rfc:3986") .setValue("urn:oid:129.6.58.92.88336")) .setCreated(timestamp)
public org.hl7.fhir.dstu3.model.Identifier convertIdentifier(org.hl7.fhir.instance.model.Identifier src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.Identifier tgt = new org.hl7.fhir.dstu3.model.Identifier(); copyElement(src, tgt); tgt.setUse(convertIdentifierUse(src.getUse())); tgt.setType(convertCodeableConcept(src.getType())); tgt.setSystem(src.getSystem()); tgt.setValue(src.getValue()); tgt.setPeriod(convertPeriod(src.getPeriod())); tgt.setAssigner(convertReference(src.getAssigner())); return tgt; }
/** * @return {@link #identifier} (This records identifiers associated with this care plan that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) */ // syntactic sugar public Identifier addIdentifier() { //3 Identifier t = new Identifier(); if (this.identifier == null) this.identifier = new ArrayList<Identifier>(); this.identifier.add(t); return t; }
public org.hl7.fhir.instance.model.Identifier convertIdentifier(org.hl7.fhir.dstu3.model.Identifier src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.Identifier tgt = new org.hl7.fhir.instance.model.Identifier(); copyElement(src, tgt); if (src.hasUse()) tgt.setUse(convertIdentifierUse(src.getUse())); if (src.hasType()) tgt.setType(convertCodeableConcept(src.getType())); if (src.hasSystem()) tgt.setSystem(src.getSystem()); if (src.hasValue()) tgt.setValue(src.getValue()); if (src.hasPeriod()) tgt.setPeriod(convertPeriod(src.getPeriod())); if (src.hasAssigner()) tgt.setAssigner(convertReference(src.getAssigner())); return tgt; }
public static void merge(Identifier dst, Identifier src) { if (dst.getUseElement() == null && src.getUseElement() != null) dst.setUseElement(src.getUseElement()); if (dst.getType() == null && src.getType() != null) dst.setType(src.getType()); if (dst.getPeriod() == null && src.getPeriod() != null) dst.setPeriod(src.getPeriod()); if (dst.getAssigner() == null && src.getAssigner() != null) dst.setAssigner(src.getAssigner()); }
private String getSubjectReference(Resource resource, Function<Resource, Reference> f) { Reference reference = f.apply(resource); if (reference == null) { throw FhirUtils.unprocessableEntity( OperationOutcome.IssueSeverity.ERROR, OperationOutcome.IssueType.INVALID, ErrorCode.UNKNOWN_PATIENT_ID.getOpcode(), null, "Empty Patient reference in resource %s", resource ); } // Could be contained resources if (reference.getResource() != null) { Patient patient = (Patient) reference.getResource(); return patient.getIdentifier().get(0).getValue(); } return reference.getReference(); }