Search in sources :

Example 61 with CodeableReference

use of org.hl7.fhir.r5.model.CodeableReference in project org.hl7.fhir.core by hapifhir.

the class GuidanceResponse40_50 method convertGuidanceResponse.

public static org.hl7.fhir.r4.model.GuidanceResponse convertGuidanceResponse(org.hl7.fhir.r5.model.GuidanceResponse src) throws FHIRException {
    if (src == null)
        return null;
    org.hl7.fhir.r4.model.GuidanceResponse tgt = new org.hl7.fhir.r4.model.GuidanceResponse();
    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyDomainResource(src, tgt);
    if (src.hasRequestIdentifier())
        tgt.setRequestIdentifier(Identifier40_50.convertIdentifier(src.getRequestIdentifier()));
    for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(Identifier40_50.convertIdentifier(t));
    if (src.hasModule())
        tgt.setModule(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getModule()));
    if (src.hasStatus())
        tgt.setStatusElement(convertGuidanceResponseStatus(src.getStatusElement()));
    if (src.hasSubject())
        tgt.setSubject(Reference40_50.convertReference(src.getSubject()));
    if (src.hasEncounter())
        tgt.setEncounter(Reference40_50.convertReference(src.getEncounter()));
    if (src.hasOccurrenceDateTime())
        tgt.setOccurrenceDateTimeElement(DateTime40_50.convertDateTime(src.getOccurrenceDateTimeElement()));
    if (src.hasPerformer())
        tgt.setPerformer(Reference40_50.convertReference(src.getPerformer()));
    for (CodeableReference t : src.getReason()) if (t.hasConcept())
        tgt.addReasonCode(CodeableConcept40_50.convertCodeableConcept(t.getConcept()));
    for (CodeableReference t : src.getReason()) if (t.hasReference())
        tgt.addReasonReference(Reference40_50.convertReference(t.getReference()));
    for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation40_50.convertAnnotation(t));
    for (org.hl7.fhir.r5.model.Reference t : src.getEvaluationMessage()) tgt.addEvaluationMessage(Reference40_50.convertReference(t));
    if (src.hasOutputParameters())
        tgt.setOutputParameters(Reference40_50.convertReference(src.getOutputParameters()));
    if (src.hasResult())
        tgt.setResult(Reference40_50.convertReference(src.getResult()));
    for (org.hl7.fhir.r5.model.DataRequirement t : src.getDataRequirement()) tgt.addDataRequirement(DataRequirement40_50.convertDataRequirement(t));
    return tgt;
}
Also used : CodeableReference(org.hl7.fhir.r5.model.CodeableReference)

Example 62 with CodeableReference

use of org.hl7.fhir.r5.model.CodeableReference in project org.hl7.fhir.core by hapifhir.

the class ImagingStudy40_50 method convertImagingStudy.

public static org.hl7.fhir.r4.model.ImagingStudy convertImagingStudy(org.hl7.fhir.r5.model.ImagingStudy src) throws FHIRException {
    if (src == null)
        return null;
    org.hl7.fhir.r4.model.ImagingStudy tgt = new org.hl7.fhir.r4.model.ImagingStudy();
    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyDomainResource(src, tgt);
    for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(Identifier40_50.convertIdentifier(t));
    if (src.hasStatus())
        tgt.setStatusElement(convertImagingStudyStatus(src.getStatusElement()));
    for (org.hl7.fhir.r5.model.Coding t : src.getModality()) tgt.addModality(Coding40_50.convertCoding(t));
    if (src.hasSubject())
        tgt.setSubject(Reference40_50.convertReference(src.getSubject()));
    if (src.hasEncounter())
        tgt.setEncounter(Reference40_50.convertReference(src.getEncounter()));
    if (src.hasStarted())
        tgt.setStartedElement(DateTime40_50.convertDateTime(src.getStartedElement()));
    for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference40_50.convertReference(t));
    if (src.hasReferrer())
        tgt.setReferrer(Reference40_50.convertReference(src.getReferrer()));
    for (org.hl7.fhir.r5.model.Reference t : src.getInterpreter()) tgt.addInterpreter(Reference40_50.convertReference(t));
    for (org.hl7.fhir.r5.model.Reference t : src.getEndpoint()) tgt.addEndpoint(Reference40_50.convertReference(t));
    if (src.hasNumberOfSeries())
        tgt.setNumberOfSeriesElement(UnsignedInt40_50.convertUnsignedInt(src.getNumberOfSeriesElement()));
    if (src.hasNumberOfInstances())
        tgt.setNumberOfInstancesElement(UnsignedInt40_50.convertUnsignedInt(src.getNumberOfInstancesElement()));
    for (CodeableReference t : src.getProcedure()) {
        if (t.hasConcept())
            tgt.addProcedureCode(CodeableConcept40_50.convertCodeableConcept(t.getConcept()));
        if (t.hasReference()) {
            tgt.setProcedureReference(Reference40_50.convertReference(t.getReference()));
        }
    }
    if (src.hasLocation())
        tgt.setLocation(Reference40_50.convertReference(src.getLocation()));
    for (CodeableReference t : src.getReason()) if (t.hasConcept())
        tgt.addReasonCode(CodeableConcept40_50.convertCodeableConcept(t.getConcept()));
    for (CodeableReference t : src.getReason()) if (t.hasReference())
        tgt.addReasonReference(Reference40_50.convertReference(t.getReference()));
    for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation40_50.convertAnnotation(t));
    if (src.hasDescription())
        tgt.setDescriptionElement(String40_50.convertString(src.getDescriptionElement()));
    for (org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesComponent t : src.getSeries()) tgt.addSeries(convertImagingStudySeriesComponent(t));
    return tgt;
}
Also used : CodeableReference(org.hl7.fhir.r5.model.CodeableReference)

Example 63 with CodeableReference

use of org.hl7.fhir.r5.model.CodeableReference in project org.hl7.fhir.core by hapifhir.

the class Goal40_50 method convertGoal.

public static org.hl7.fhir.r4.model.Goal convertGoal(org.hl7.fhir.r5.model.Goal src) throws FHIRException {
    if (src == null)
        return null;
    org.hl7.fhir.r4.model.Goal tgt = new org.hl7.fhir.r4.model.Goal();
    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyDomainResource(src, tgt);
    for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(Identifier40_50.convertIdentifier(t));
    if (src.hasLifecycleStatus())
        tgt.setLifecycleStatusElement(convertGoalLifecycleStatus(src.getLifecycleStatusElement()));
    if (src.hasAchievementStatus())
        tgt.setAchievementStatus(CodeableConcept40_50.convertCodeableConcept(src.getAchievementStatus()));
    for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) tgt.addCategory(CodeableConcept40_50.convertCodeableConcept(t));
    if (src.hasPriority())
        tgt.setPriority(CodeableConcept40_50.convertCodeableConcept(src.getPriority()));
    if (src.hasDescription())
        tgt.setDescription(CodeableConcept40_50.convertCodeableConcept(src.getDescription()));
    if (src.hasSubject())
        tgt.setSubject(Reference40_50.convertReference(src.getSubject()));
    if (src.hasStart())
        tgt.setStart(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getStart()));
    for (org.hl7.fhir.r5.model.Goal.GoalTargetComponent t : src.getTarget()) tgt.addTarget(convertGoalTargetComponent(t));
    if (src.hasStatusDate())
        tgt.setStatusDateElement(Date40_50.convertDate(src.getStatusDateElement()));
    if (src.hasStatusReason())
        tgt.setStatusReasonElement(String40_50.convertString(src.getStatusReasonElement()));
    for (org.hl7.fhir.r5.model.Reference t : src.getAddresses()) tgt.addAddresses(Reference40_50.convertReference(t));
    for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation40_50.convertAnnotation(t));
    for (CodeableReference t : src.getOutcome()) if (t.hasConcept())
        tgt.addOutcomeCode(CodeableConcept40_50.convertCodeableConcept(t.getConcept()));
    for (CodeableReference t : src.getOutcome()) if (t.hasReference())
        tgt.addOutcomeReference(Reference40_50.convertReference(t.getReference()));
    return tgt;
}
Also used : CodeableReference(org.hl7.fhir.r5.model.CodeableReference)

Example 64 with CodeableReference

use of org.hl7.fhir.r5.model.CodeableReference in project org.hl7.fhir.core by hapifhir.

the class Provenance40_50 method convertProvenance.

public static org.hl7.fhir.r4.model.Provenance convertProvenance(org.hl7.fhir.r5.model.Provenance src) throws FHIRException {
    if (src == null)
        return null;
    org.hl7.fhir.r4.model.Provenance tgt = new org.hl7.fhir.r4.model.Provenance();
    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyDomainResource(src, tgt);
    for (org.hl7.fhir.r5.model.Reference t : src.getTarget()) tgt.addTarget(Reference40_50.convertReference(t));
    if (src.hasOccurred())
        tgt.setOccurred(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getOccurred()));
    if (src.hasRecorded())
        tgt.setRecordedElement(Instant40_50.convertInstant(src.getRecordedElement()));
    for (org.hl7.fhir.r5.model.UriType t : src.getPolicy()) tgt.getPolicy().add(Uri40_50.convertUri(t));
    if (src.hasLocation())
        tgt.setLocation(Reference40_50.convertReference(src.getLocation()));
    for (CodeableReference t : src.getAuthorization()) if (t.hasConcept())
        tgt.addReason(CodeableConcept40_50.convertCodeableConcept(t.getConcept()));
    if (src.hasActivity())
        tgt.setActivity(CodeableConcept40_50.convertCodeableConcept(src.getActivity()));
    for (org.hl7.fhir.r5.model.Provenance.ProvenanceAgentComponent t : src.getAgent()) tgt.addAgent(convertProvenanceAgentComponent(t));
    for (org.hl7.fhir.r5.model.Provenance.ProvenanceEntityComponent t : src.getEntity()) tgt.addEntity(convertProvenanceEntityComponent(t));
    for (org.hl7.fhir.r5.model.Signature t : src.getSignature()) tgt.addSignature(Signature40_50.convertSignature(t));
    return tgt;
}
Also used : CodeableReference(org.hl7.fhir.r5.model.CodeableReference)

Example 65 with CodeableReference

use of org.hl7.fhir.r5.model.CodeableReference in project org.hl7.fhir.core by hapifhir.

the class MedicationAdministration40_50 method convertMedicationAdministration.

public static org.hl7.fhir.r4.model.MedicationAdministration convertMedicationAdministration(org.hl7.fhir.r5.model.MedicationAdministration src) throws FHIRException {
    if (src == null)
        return null;
    org.hl7.fhir.r4.model.MedicationAdministration tgt = new org.hl7.fhir.r4.model.MedicationAdministration();
    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyDomainResource(src, tgt);
    for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(Identifier40_50.convertIdentifier(t));
    for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri()) tgt.getInstantiates().add(Uri40_50.convertUri(t));
    for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference40_50.convertReference(t));
    if (src.hasStatus())
        tgt.setStatusElement(convertMedicationAdministrationStatus(src.getStatusElement()));
    for (org.hl7.fhir.r5.model.CodeableConcept t : src.getStatusReason()) tgt.addStatusReason(CodeableConcept40_50.convertCodeableConcept(t));
    if (src.hasCategory())
        tgt.setCategory(CodeableConcept40_50.convertCodeableConcept(src.getCategoryFirstRep()));
    if (src.getMedication().hasConcept())
        tgt.setMedication(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getMedication().getConcept()));
    if (src.getMedication().hasReference())
        tgt.setMedication(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getMedication().getReference()));
    if (src.hasSubject())
        tgt.setSubject(Reference40_50.convertReference(src.getSubject()));
    if (src.hasEncounter())
        tgt.setContext(Reference40_50.convertReference(src.getEncounter()));
    for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInformation()) tgt.addSupportingInformation(Reference40_50.convertReference(t));
    if (src.hasOccurence())
        tgt.setEffective(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getOccurence()));
    for (org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationPerformerComponent t : src.getPerformer()) tgt.addPerformer(convertMedicationAdministrationPerformerComponent(t));
    for (CodeableReference t : src.getReason()) if (t.hasConcept())
        tgt.addReasonCode(CodeableConcept40_50.convertCodeableConcept(t.getConcept()));
    for (CodeableReference t : src.getReason()) if (t.hasReference())
        tgt.addReasonReference(Reference40_50.convertReference(t.getReference()));
    if (src.hasRequest())
        tgt.setRequest(Reference40_50.convertReference(src.getRequest()));
    for (org.hl7.fhir.r5.model.Reference t : src.getDevice()) tgt.addDevice(Reference40_50.convertReference(t));
    for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation40_50.convertAnnotation(t));
    if (src.hasDosage())
        tgt.setDosage(convertMedicationAdministrationDosageComponent(src.getDosage()));
    for (org.hl7.fhir.r5.model.Reference t : src.getEventHistory()) tgt.addEventHistory(Reference40_50.convertReference(t));
    return tgt;
}
Also used : CodeableReference(org.hl7.fhir.r5.model.CodeableReference)

Aggregations

CodeableReference (org.hl7.fhir.r5.model.CodeableReference)58 CodeableConcept (org.hl7.fhir.r5.model.CodeableConcept)5 NotImplementedException (org.apache.commons.lang3.NotImplementedException)4 FHIRFormatError (org.hl7.fhir.exceptions.FHIRFormatError)3 Annotation (org.hl7.fhir.r5.model.Annotation)3 ElementDefinition (org.hl7.fhir.r5.model.ElementDefinition)3 ArrayList (java.util.ArrayList)2 List (java.util.List)2 Base64 (org.apache.commons.codec.binary.Base64)2 ElementDefn (org.hl7.fhir.definitions.model.ElementDefn)2 Address (org.hl7.fhir.r4b.model.Address)2 Annotation (org.hl7.fhir.r4b.model.Annotation)2 Attachment (org.hl7.fhir.r4b.model.Attachment)2 Base (org.hl7.fhir.r4b.model.Base)2 Base64BinaryType (org.hl7.fhir.r4b.model.Base64BinaryType)2 BooleanType (org.hl7.fhir.r4b.model.BooleanType)2 CodeType (org.hl7.fhir.r4b.model.CodeType)2 CodeableConcept (org.hl7.fhir.r4b.model.CodeableConcept)2 CodeableReference (org.hl7.fhir.r4b.model.CodeableReference)2 Coding (org.hl7.fhir.r4b.model.Coding)2