Search in sources :

Example 21 with CodeableReference

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

the class AllergyIntolerance40_50 method convertAllergyIntoleranceReactionComponent.

public static org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceReactionComponent convertAllergyIntoleranceReactionComponent(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceReactionComponent src) throws FHIRException {
    if (src == null)
        return null;
    org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceReactionComponent tgt = new org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceReactionComponent();
    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
    if (src.hasSubstance())
        tgt.setSubstance(CodeableConcept40_50.convertCodeableConcept(src.getSubstance()));
    for (CodeableReference t : src.getManifestation()) if (t.hasConcept())
        tgt.addManifestation(CodeableConcept40_50.convertCodeableConcept(t.getConcept()));
    if (src.hasDescription())
        tgt.setDescriptionElement(String40_50.convertString(src.getDescriptionElement()));
    if (src.hasOnset())
        tgt.setOnsetElement(DateTime40_50.convertDateTime(src.getOnsetElement()));
    if (src.hasSeverity())
        tgt.setSeverityElement(convertAllergyIntoleranceSeverity(src.getSeverityElement()));
    if (src.hasExposureRoute())
        tgt.setExposureRoute(CodeableConcept40_50.convertCodeableConcept(src.getExposureRoute()));
    for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation40_50.convertAnnotation(t));
    return tgt;
}
Also used : CodeableReference(org.hl7.fhir.r5.model.CodeableReference)

Example 22 with CodeableReference

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

the class CarePlan40_50 method convertCarePlan.

public static org.hl7.fhir.r4.model.CarePlan convertCarePlan(org.hl7.fhir.r5.model.CarePlan src) throws FHIRException {
    if (src == null)
        return null;
    org.hl7.fhir.r4.model.CarePlan tgt = new org.hl7.fhir.r4.model.CarePlan();
    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.CanonicalType t : src.getInstantiatesCanonical()) tgt.getInstantiatesCanonical().add(Canonical40_50.convertCanonical(t));
    for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri()) tgt.getInstantiatesUri().add(Uri40_50.convertUri(t));
    for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference40_50.convertReference(t));
    for (org.hl7.fhir.r5.model.Reference t : src.getReplaces()) tgt.addReplaces(Reference40_50.convertReference(t));
    for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference40_50.convertReference(t));
    if (src.hasStatus())
        tgt.setStatusElement(convertCarePlanStatus(src.getStatusElement()));
    if (src.hasIntent())
        tgt.setIntentElement(convertCarePlanIntent(src.getIntentElement()));
    for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) tgt.addCategory(CodeableConcept40_50.convertCodeableConcept(t));
    if (src.hasTitle())
        tgt.setTitleElement(String40_50.convertString(src.getTitleElement()));
    if (src.hasDescription())
        tgt.setDescriptionElement(String40_50.convertString(src.getDescriptionElement()));
    if (src.hasSubject())
        tgt.setSubject(Reference40_50.convertReference(src.getSubject()));
    if (src.hasEncounter())
        tgt.setEncounter(Reference40_50.convertReference(src.getEncounter()));
    if (src.hasPeriod())
        tgt.setPeriod(Period40_50.convertPeriod(src.getPeriod()));
    if (src.hasCreated())
        tgt.setCreatedElement(DateTime40_50.convertDateTime(src.getCreatedElement()));
    if (src.hasAuthor())
        tgt.setAuthor(Reference40_50.convertReference(src.getAuthor()));
    for (org.hl7.fhir.r5.model.Reference t : src.getContributor()) tgt.addContributor(Reference40_50.convertReference(t));
    for (org.hl7.fhir.r5.model.Reference t : src.getCareTeam()) tgt.addCareTeam(Reference40_50.convertReference(t));
    for (CodeableReference t : src.getAddresses()) if (t.hasReference())
        tgt.addAddresses(Reference40_50.convertReference(t.getReference()));
    for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInfo()) tgt.addSupportingInfo(Reference40_50.convertReference(t));
    for (org.hl7.fhir.r5.model.Reference t : src.getGoal()) tgt.addGoal(Reference40_50.convertReference(t));
    for (org.hl7.fhir.r5.model.CarePlan.CarePlanActivityComponent t : src.getActivity()) tgt.addActivity(convertCarePlanActivityComponent(t));
    for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation40_50.convertAnnotation(t));
    return tgt;
}
Also used : CodeableReference(org.hl7.fhir.r5.model.CodeableReference)

Example 23 with CodeableReference

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

the class CarePlan40_50 method convertCarePlanActivityDetailComponent.

public static org.hl7.fhir.r4.model.CarePlan.CarePlanActivityDetailComponent convertCarePlanActivityDetailComponent(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityPlannedActivityDetailComponent src) throws FHIRException {
    if (src == null)
        return null;
    org.hl7.fhir.r4.model.CarePlan.CarePlanActivityDetailComponent tgt = new org.hl7.fhir.r4.model.CarePlan.CarePlanActivityDetailComponent();
    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
    if (src.hasKind())
        tgt.setKindElement(convertCarePlanActivityKind(src.getKindElement()));
    for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical()) tgt.getInstantiatesCanonical().add(Canonical40_50.convertCanonical(t));
    for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri()) tgt.getInstantiatesUri().add(Uri40_50.convertUri(t));
    if (src.hasCode())
        tgt.setCode(CodeableConcept40_50.convertCodeableConcept(src.getCode()));
    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.Reference t : src.getGoal()) tgt.addGoal(Reference40_50.convertReference(t));
    if (src.hasStatus())
        tgt.setStatusElement(convertCarePlanActivityStatus(src.getStatusElement()));
    if (src.hasStatusReason())
        tgt.setStatusReason(CodeableConcept40_50.convertCodeableConcept(src.getStatusReason()));
    if (src.hasDoNotPerform())
        tgt.setDoNotPerformElement(Boolean40_50.convertBoolean(src.getDoNotPerformElement()));
    if (src.hasScheduled())
        tgt.setScheduled(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getScheduled()));
    if (src.getLocation().hasReference())
        tgt.setLocation(Reference40_50.convertReference(src.getLocation().getReference()));
    for (org.hl7.fhir.r5.model.Reference t : src.getPerformer()) tgt.addPerformer(Reference40_50.convertReference(t));
    if (src.hasProduct())
        tgt.setProduct(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getProduct()));
    if (src.hasDailyAmount())
        tgt.setDailyAmount(SimpleQuantity40_50.convertSimpleQuantity(src.getDailyAmount()));
    if (src.hasQuantity())
        tgt.setQuantity(SimpleQuantity40_50.convertSimpleQuantity(src.getQuantity()));
    if (src.hasDescription())
        tgt.setDescriptionElement(String40_50.convertString(src.getDescriptionElement()));
    return tgt;
}
Also used : CodeableReference(org.hl7.fhir.r5.model.CodeableReference)

Example 24 with CodeableReference

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

the class CarePlan40_50 method convertCarePlanActivityComponent.

public static org.hl7.fhir.r4.model.CarePlan.CarePlanActivityComponent convertCarePlanActivityComponent(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityComponent src) throws FHIRException {
    if (src == null)
        return null;
    org.hl7.fhir.r4.model.CarePlan.CarePlanActivityComponent tgt = new org.hl7.fhir.r4.model.CarePlan.CarePlanActivityComponent();
    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
    for (CodeableReference t : src.getPerformedActivity()) if (t.hasConcept())
        tgt.addOutcomeCodeableConcept(CodeableConcept40_50.convertCodeableConcept(t.getConcept()));
    for (CodeableReference t : src.getPerformedActivity()) if (t.hasReference())
        tgt.addOutcomeReference(Reference40_50.convertReference(t.getReference()));
    for (org.hl7.fhir.r5.model.Annotation t : src.getProgress()) tgt.addProgress(Annotation40_50.convertAnnotation(t));
    if (src.hasPlannedActivityReference())
        tgt.setReference(Reference40_50.convertReference(src.getPlannedActivityReference()));
    if (src.hasPlannedActivityDetail())
        tgt.setDetail(convertCarePlanActivityDetailComponent(src.getPlannedActivityDetail()));
    return tgt;
}
Also used : CodeableReference(org.hl7.fhir.r5.model.CodeableReference)

Example 25 with CodeableReference

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

the class Communication40_50 method convertCommunication.

public static org.hl7.fhir.r4.model.Communication convertCommunication(org.hl7.fhir.r5.model.Communication src) throws FHIRException {
    if (src == null)
        return null;
    org.hl7.fhir.r4.model.Communication tgt = new org.hl7.fhir.r4.model.Communication();
    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.CanonicalType t : src.getInstantiatesCanonical()) tgt.getInstantiatesCanonical().add(Canonical40_50.convertCanonical(t));
    for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri()) tgt.getInstantiatesUri().add(Uri40_50.convertUri(t));
    for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference40_50.convertReference(t));
    for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference40_50.convertReference(t));
    for (org.hl7.fhir.r5.model.Reference t : src.getInResponseTo()) tgt.addInResponseTo(Reference40_50.convertReference(t));
    if (src.hasStatus())
        tgt.setStatusElement(convertCommunicationStatus(src.getStatusElement()));
    if (src.hasStatusReason())
        tgt.setStatusReason(CodeableConcept40_50.convertCodeableConcept(src.getStatusReason()));
    for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) tgt.addCategory(CodeableConcept40_50.convertCodeableConcept(t));
    if (src.hasPriority())
        tgt.setPriorityElement(convertCommunicationPriority(src.getPriorityElement()));
    for (org.hl7.fhir.r5.model.CodeableConcept t : src.getMedium()) tgt.addMedium(CodeableConcept40_50.convertCodeableConcept(t));
    if (src.hasSubject())
        tgt.setSubject(Reference40_50.convertReference(src.getSubject()));
    if (src.hasTopic())
        tgt.setTopic(CodeableConcept40_50.convertCodeableConcept(src.getTopic()));
    for (org.hl7.fhir.r5.model.Reference t : src.getAbout()) tgt.addAbout(Reference40_50.convertReference(t));
    if (src.hasEncounter())
        tgt.setEncounter(Reference40_50.convertReference(src.getEncounter()));
    if (src.hasSent())
        tgt.setSentElement(DateTime40_50.convertDateTime(src.getSentElement()));
    if (src.hasReceived())
        tgt.setReceivedElement(DateTime40_50.convertDateTime(src.getReceivedElement()));
    for (org.hl7.fhir.r5.model.Reference t : src.getRecipient()) tgt.addRecipient(Reference40_50.convertReference(t));
    if (src.hasSender())
        tgt.setSender(Reference40_50.convertReference(src.getSender()));
    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.Communication.CommunicationPayloadComponent t : src.getPayload()) tgt.addPayload(convertCommunicationPayloadComponent(t));
    for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation40_50.convertAnnotation(t));
    return tgt;
}
Also used : CodeableConcept(org.hl7.fhir.r5.model.CodeableConcept) 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