use of org.hl7.fhir.r5.model.CanonicalType in project org.hl7.fhir.core by hapifhir.
the class ElementDefinition30_50 method convertTypeRefComponent.
public static void convertTypeRefComponent(org.hl7.fhir.dstu3.model.ElementDefinition.TypeRefComponent src, List<ElementDefinition.TypeRefComponent> list) throws FHIRException {
if (src == null)
return;
ElementDefinition.TypeRefComponent tgt = null;
for (ElementDefinition.TypeRefComponent t : list) if (t.getCode().equals(src.getCode()))
tgt = t;
if (tgt == null) {
tgt = new ElementDefinition.TypeRefComponent();
list.add(tgt);
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
tgt.setCodeElement(Uri30_50.convertUri(src.getCodeElement()));
}
if (src.hasProfile()) {
boolean found = false;
for (CanonicalType p : tgt.getProfile()) {
if (p.equals(src.getProfile()))
found = true;
}
if (!found)
tgt.addProfile(src.getProfile());
}
if (src.hasTargetProfile())
tgt.addTargetProfile(src.getTargetProfile());
for (org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ElementDefinition.AggregationMode> t : src.getAggregation()) {
org.hl7.fhir.r5.model.Enumeration<ElementDefinition.AggregationMode> a = convertAggregationMode(t);
if (!tgt.hasAggregation(a.getValue()))
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(t, tgt.addAggregation(a.getValue()));
}
if (src.hasVersioning())
tgt.setVersioningElement(convertReferenceVersionRules(src.getVersioningElement()));
}
use of org.hl7.fhir.r5.model.CanonicalType in project org.hl7.fhir.core by hapifhir.
the class Canonical10_40 method convertReferenceToCanonical.
public static CanonicalType convertReferenceToCanonical(Reference src) throws FHIRException {
CanonicalType dst = new CanonicalType(src.getReference());
ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, dst);
return dst;
}
use of org.hl7.fhir.r5.model.CanonicalType in project org.hl7.fhir.core by hapifhir.
the class Reference14_40 method convertCanonicalToReference.
public static Reference convertCanonicalToReference(CanonicalType src) throws FHIRException {
Reference dst = new Reference(src.getValue());
ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, dst);
return dst;
}
use of org.hl7.fhir.r5.model.CanonicalType in project org.hl7.fhir.core by hapifhir.
the class Reference14_40 method convertReferenceToCanonical.
public static CanonicalType convertReferenceToCanonical(Reference src) throws FHIRException {
CanonicalType dst = new CanonicalType(src.getReference());
ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, dst);
return dst;
}
use of org.hl7.fhir.r5.model.CanonicalType in project org.hl7.fhir.core by hapifhir.
the class Reference14_50 method convertReferenceToCanonical.
public static CanonicalType convertReferenceToCanonical(Reference src) throws FHIRException {
CanonicalType dst = new CanonicalType(src.getReference());
ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, dst);
return dst;
}
Aggregations