diff --git a/org.hl7.fhir.convertors/pom.xml b/org.hl7.fhir.convertors/pom.xml index 363482bd27..43376ef47c 100644 --- a/org.hl7.fhir.convertors/pom.xml +++ b/org.hl7.fhir.convertors/pom.xml @@ -86,6 +86,7 @@ xpp3 true + org.apache.httpcomponents @@ -120,6 +121,12 @@ test + + org.assertj + assertj-core + test + + org.xerial sqlite-jdbc diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/datatypes10_30/ElementDefinition10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/datatypes10_30/ElementDefinition10_30.java index 12df637b7f..139fea6c3c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/datatypes10_30/ElementDefinition10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/datatypes10_30/ElementDefinition10_30.java @@ -14,6 +14,7 @@ import org.hl7.fhir.dstu2.utils.ToolingExtensions; import org.hl7.fhir.dstu3.conformance.ProfileUtilities; import org.hl7.fhir.dstu3.model.ElementDefinition; +import org.hl7.fhir.dstu3.model.Enumerations; import org.hl7.fhir.exceptions.FHIRException; public class ElementDefinition10_30 { @@ -124,17 +125,17 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentationEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case XMLATTR: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation.XMLATTR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation.NULL); - break; - } - } + tgt.setValue(ElementDefinition.PropertyRepresentation.XMLATTR); + break; + default: + tgt.setValue(ElementDefinition.PropertyRepresentation.NULL); + break; + } +} return tgt; } @@ -143,17 +144,17 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ElementDefinition.PropertyRepresentationEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.PropertyRepresentation.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case XMLATTR: - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.PropertyRepresentation.XMLATTR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.PropertyRepresentation.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.PropertyRepresentation.XMLATTR); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.PropertyRepresentation.NULL); + break; + } +} return tgt; } @@ -186,23 +187,23 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new ElementDefinition.SlicingRulesEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(ElementDefinition.SlicingRules.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CLOSED: - tgt.setValue(ElementDefinition.SlicingRules.CLOSED); - break; - case OPEN: - tgt.setValue(ElementDefinition.SlicingRules.OPEN); - break; - case OPENATEND: - tgt.setValue(ElementDefinition.SlicingRules.OPENATEND); - break; - default: - tgt.setValue(ElementDefinition.SlicingRules.NULL); - break; - } - } + tgt.setValue(ElementDefinition.SlicingRules.CLOSED); + break; + case OPEN: + tgt.setValue(ElementDefinition.SlicingRules.OPEN); + break; + case OPENATEND: + tgt.setValue(ElementDefinition.SlicingRules.OPENATEND); + break; + default: + tgt.setValue(ElementDefinition.SlicingRules.NULL); + break; + } +} return tgt; } @@ -211,23 +212,23 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRulesEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CLOSED: - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules.CLOSED); - break; - case OPEN: - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules.OPEN); - break; - case OPENATEND: - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules.OPENATEND); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules.CLOSED); + break; + case OPEN: + tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules.OPEN); + break; + case OPENATEND: + tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules.OPENATEND); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules.NULL); + break; + } +} return tgt; } @@ -280,23 +281,23 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new ElementDefinition.AggregationModeEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(ElementDefinition.AggregationMode.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CONTAINED: - tgt.setValue(ElementDefinition.AggregationMode.CONTAINED); - break; - case REFERENCED: - tgt.setValue(ElementDefinition.AggregationMode.REFERENCED); - break; - case BUNDLED: - tgt.setValue(ElementDefinition.AggregationMode.BUNDLED); - break; - default: - tgt.setValue(ElementDefinition.AggregationMode.NULL); - break; - } - } + tgt.setValue(ElementDefinition.AggregationMode.CONTAINED); + break; + case REFERENCED: + tgt.setValue(ElementDefinition.AggregationMode.REFERENCED); + break; + case BUNDLED: + tgt.setValue(ElementDefinition.AggregationMode.BUNDLED); + break; + default: + tgt.setValue(ElementDefinition.AggregationMode.NULL); + break; + } +} return tgt; } @@ -305,23 +306,23 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ElementDefinition.AggregationModeEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CONTAINED: - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode.CONTAINED); - break; - case REFERENCED: - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode.REFERENCED); - break; - case BUNDLED: - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode.BUNDLED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode.CONTAINED); + break; + case REFERENCED: + tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode.REFERENCED); + break; + case BUNDLED: + tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode.BUNDLED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode.NULL); + break; + } +} return tgt; } @@ -359,20 +360,20 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new ElementDefinition.ConstraintSeverityEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(ElementDefinition.ConstraintSeverity.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case ERROR: - tgt.setValue(ElementDefinition.ConstraintSeverity.ERROR); - break; - case WARNING: - tgt.setValue(ElementDefinition.ConstraintSeverity.WARNING); - break; - default: - tgt.setValue(ElementDefinition.ConstraintSeverity.NULL); - break; - } - } + tgt.setValue(ElementDefinition.ConstraintSeverity.ERROR); + break; + case WARNING: + tgt.setValue(ElementDefinition.ConstraintSeverity.WARNING); + break; + default: + tgt.setValue(ElementDefinition.ConstraintSeverity.NULL); + break; + } +} return tgt; } @@ -381,20 +382,20 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ElementDefinition.ConstraintSeverityEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.ConstraintSeverity.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case ERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.ConstraintSeverity.ERROR); - break; - case WARNING: - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.ConstraintSeverity.WARNING); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.ConstraintSeverity.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.ConstraintSeverity.ERROR); + break; + case WARNING: + tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.ConstraintSeverity.WARNING); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.ConstraintSeverity.NULL); + break; + } +} return tgt; } @@ -425,26 +426,26 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Enumerations.BindingStrengthEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case REQUIRED: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.REQUIRED); - break; - case EXTENSIBLE: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.EXTENSIBLE); - break; - case PREFERRED: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.PREFERRED); - break; - case EXAMPLE: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.EXAMPLE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.NULL); - break; - } - } + tgt.setValue(Enumerations.BindingStrength.REQUIRED); + break; + case EXTENSIBLE: + tgt.setValue(Enumerations.BindingStrength.EXTENSIBLE); + break; + case PREFERRED: + tgt.setValue(Enumerations.BindingStrength.PREFERRED); + break; + case EXAMPLE: + tgt.setValue(Enumerations.BindingStrength.EXAMPLE); + break; + default: + tgt.setValue(Enumerations.BindingStrength.NULL); + break; + } +} return tgt; } @@ -453,26 +454,26 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Enumerations.BindingStrengthEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case REQUIRED: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.REQUIRED); - break; - case EXTENSIBLE: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.EXTENSIBLE); - break; - case PREFERRED: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.PREFERRED); - break; - case EXAMPLE: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.EXAMPLE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.REQUIRED); + break; + case EXTENSIBLE: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.EXTENSIBLE); + break; + case PREFERRED: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.PREFERRED); + break; + case EXAMPLE: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.EXAMPLE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.NULL); + break; + } +} return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/datatypes10_30/Narrative10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/datatypes10_30/Narrative10_30.java index 3890ad3012..74d1845ad8 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/datatypes10_30/Narrative10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/datatypes10_30/Narrative10_30.java @@ -1,6 +1,7 @@ package org.hl7.fhir.convertors.conv10_30.datatypes10_30; import org.hl7.fhir.convertors.context.ConversionContext10_30; +import org.hl7.fhir.dstu3.model.Narrative; import org.hl7.fhir.exceptions.FHIRException; public class Narrative10_30 { @@ -27,26 +28,26 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Narrative.NarrativeStatusEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case GENERATED: - tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.GENERATED); - break; - case EXTENSIONS: - tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.EXTENSIONS); - break; - case ADDITIONAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.ADDITIONAL); - break; - case EMPTY: - tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.EMPTY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.NULL); - break; - } - } + tgt.setValue(Narrative.NarrativeStatus.GENERATED); + break; + case EXTENSIONS: + tgt.setValue(Narrative.NarrativeStatus.EXTENSIONS); + break; + case ADDITIONAL: + tgt.setValue(Narrative.NarrativeStatus.ADDITIONAL); + break; + case EMPTY: + tgt.setValue(Narrative.NarrativeStatus.EMPTY); + break; + default: + tgt.setValue(Narrative.NarrativeStatus.NULL); + break; + } +} return tgt; } @@ -55,26 +56,26 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Narrative.NarrativeStatusEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case GENERATED: - tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.GENERATED); - break; - case EXTENSIONS: - tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.EXTENSIONS); - break; - case ADDITIONAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.ADDITIONAL); - break; - case EMPTY: - tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.EMPTY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.GENERATED); + break; + case EXTENSIONS: + tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.EXTENSIONS); + break; + case ADDITIONAL: + tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.ADDITIONAL); + break; + case EMPTY: + tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.EMPTY); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/datatypes10_30/complextypes10_30/Address10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/datatypes10_30/complextypes10_30/Address10_30.java index ec8274342b..9b59d1ef4a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/datatypes10_30/complextypes10_30/Address10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/datatypes10_30/complextypes10_30/Address10_30.java @@ -2,6 +2,7 @@ import org.hl7.fhir.convertors.context.ConversionContext10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; +import org.hl7.fhir.dstu3.model.Address; import org.hl7.fhir.exceptions.FHIRException; public class Address10_30 { @@ -44,26 +45,26 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Address.AddressUseEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HOME: - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.HOME); - break; - case WORK: - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.WORK); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.OLD); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.NULL); - break; - } - } + tgt.setValue(Address.AddressUse.HOME); + break; + case WORK: + tgt.setValue(Address.AddressUse.WORK); + break; + case TEMP: + tgt.setValue(Address.AddressUse.TEMP); + break; + case OLD: + tgt.setValue(Address.AddressUse.OLD); + break; + default: + tgt.setValue(Address.AddressUse.NULL); + break; + } +} return tgt; } @@ -72,26 +73,26 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Address.AddressUseEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HOME: - tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.HOME); - break; - case WORK: - tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.WORK); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.OLD); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.HOME); + break; + case WORK: + tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.WORK); + break; + case TEMP: + tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.TEMP); + break; + case OLD: + tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.OLD); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.NULL); + break; + } +} return tgt; } @@ -100,23 +101,23 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Address.AddressTypeEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case POSTAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressType.POSTAL); - break; - case PHYSICAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressType.PHYSICAL); - break; - case BOTH: - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressType.BOTH); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressType.NULL); - break; - } - } + tgt.setValue(Address.AddressType.POSTAL); + break; + case PHYSICAL: + tgt.setValue(Address.AddressType.PHYSICAL); + break; + case BOTH: + tgt.setValue(Address.AddressType.BOTH); + break; + default: + tgt.setValue(Address.AddressType.NULL); + break; + } +} return tgt; } @@ -125,23 +126,23 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Address.AddressTypeEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case POSTAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressType.POSTAL); - break; - case PHYSICAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressType.PHYSICAL); - break; - case BOTH: - tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressType.BOTH); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressType.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressType.POSTAL); + break; + case PHYSICAL: + tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressType.PHYSICAL); + break; + case BOTH: + tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressType.BOTH); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressType.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/datatypes10_30/complextypes10_30/ContactPoint10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/datatypes10_30/complextypes10_30/ContactPoint10_30.java index 5a62c9e0f2..054f09a6d7 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/datatypes10_30/complextypes10_30/ContactPoint10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/datatypes10_30/complextypes10_30/ContactPoint10_30.java @@ -3,6 +3,7 @@ import org.hl7.fhir.convertors.context.ConversionContext10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.PositiveInt10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; +import org.hl7.fhir.dstu3.model.ContactPoint; import org.hl7.fhir.exceptions.FHIRException; public class ContactPoint10_30 { @@ -35,29 +36,29 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystemEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case PHONE: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.PHONE); - break; - case FAX: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.FAX); - break; - case EMAIL: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.EMAIL); - break; - case PAGER: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.PAGER); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.NULL); - break; - } - } + tgt.setValue(ContactPoint.ContactPointSystem.PHONE); + break; + case FAX: + tgt.setValue(ContactPoint.ContactPointSystem.FAX); + break; + case EMAIL: + tgt.setValue(ContactPoint.ContactPointSystem.EMAIL); + break; + case PAGER: + tgt.setValue(ContactPoint.ContactPointSystem.PAGER); + break; + case OTHER: + tgt.setValue(ContactPoint.ContactPointSystem.OTHER); + break; + default: + tgt.setValue(ContactPoint.ContactPointSystem.NULL); + break; + } +} return tgt; } @@ -66,32 +67,32 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystemEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case PHONE: - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.PHONE); - break; - case FAX: - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.FAX); - break; - case EMAIL: - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.EMAIL); - break; - case PAGER: - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.PAGER); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.OTHER); - break; - case URL: - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.PHONE); + break; + case FAX: + tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.FAX); + break; + case EMAIL: + tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.EMAIL); + break; + case PAGER: + tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.PAGER); + break; + case OTHER: + tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.OTHER); + break; + case URL: + tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.OTHER); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.NULL); + break; + } +} return tgt; } @@ -100,29 +101,29 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUseEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HOME: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.HOME); - break; - case WORK: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.WORK); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.OLD); - break; - case MOBILE: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.MOBILE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.NULL); - break; - } - } + tgt.setValue(ContactPoint.ContactPointUse.HOME); + break; + case WORK: + tgt.setValue(ContactPoint.ContactPointUse.WORK); + break; + case TEMP: + tgt.setValue(ContactPoint.ContactPointUse.TEMP); + break; + case OLD: + tgt.setValue(ContactPoint.ContactPointUse.OLD); + break; + case MOBILE: + tgt.setValue(ContactPoint.ContactPointUse.MOBILE); + break; + default: + tgt.setValue(ContactPoint.ContactPointUse.NULL); + break; + } +} return tgt; } @@ -131,29 +132,29 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUseEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HOME: - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.HOME); - break; - case WORK: - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.WORK); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.OLD); - break; - case MOBILE: - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.MOBILE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.HOME); + break; + case WORK: + tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.WORK); + break; + case TEMP: + tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.TEMP); + break; + case OLD: + tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.OLD); + break; + case MOBILE: + tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.MOBILE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/datatypes10_30/complextypes10_30/HumanName10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/datatypes10_30/complextypes10_30/HumanName10_30.java index 918e5702ec..ae14b2f648 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/datatypes10_30/complextypes10_30/HumanName10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/datatypes10_30/complextypes10_30/HumanName10_30.java @@ -2,6 +2,7 @@ import org.hl7.fhir.convertors.context.ConversionContext10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; +import org.hl7.fhir.dstu3.model.HumanName; import org.hl7.fhir.exceptions.FHIRException; public class HumanName10_30 { @@ -38,35 +39,35 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.HumanName.NameUseEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case USUAL: - tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.USUAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.OFFICIAL); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.TEMP); - break; - case NICKNAME: - tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.NICKNAME); - break; - case ANONYMOUS: - tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.ANONYMOUS); - break; - case OLD: - tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.OLD); - break; - case MAIDEN: - tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.MAIDEN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.NULL); - break; - } - } + tgt.setValue(HumanName.NameUse.USUAL); + break; + case OFFICIAL: + tgt.setValue(HumanName.NameUse.OFFICIAL); + break; + case TEMP: + tgt.setValue(HumanName.NameUse.TEMP); + break; + case NICKNAME: + tgt.setValue(HumanName.NameUse.NICKNAME); + break; + case ANONYMOUS: + tgt.setValue(HumanName.NameUse.ANONYMOUS); + break; + case OLD: + tgt.setValue(HumanName.NameUse.OLD); + break; + case MAIDEN: + tgt.setValue(HumanName.NameUse.MAIDEN); + break; + default: + tgt.setValue(HumanName.NameUse.NULL); + break; + } +} return tgt; } @@ -75,35 +76,35 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.HumanName.NameUseEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case USUAL: - tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.USUAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.OFFICIAL); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.TEMP); - break; - case NICKNAME: - tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.NICKNAME); - break; - case ANONYMOUS: - tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.ANONYMOUS); - break; - case OLD: - tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.OLD); - break; - case MAIDEN: - tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.MAIDEN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.USUAL); + break; + case OFFICIAL: + tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.OFFICIAL); + break; + case TEMP: + tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.TEMP); + break; + case NICKNAME: + tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.NICKNAME); + break; + case ANONYMOUS: + tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.ANONYMOUS); + break; + case OLD: + tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.OLD); + break; + case MAIDEN: + tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.MAIDEN); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/datatypes10_30/complextypes10_30/Identifier10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/datatypes10_30/complextypes10_30/Identifier10_30.java index f7d210cad5..6f3248535e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/datatypes10_30/complextypes10_30/Identifier10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/datatypes10_30/complextypes10_30/Identifier10_30.java @@ -4,6 +4,7 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Uri10_30; +import org.hl7.fhir.dstu3.model.Identifier; import org.hl7.fhir.exceptions.FHIRException; public class Identifier10_30 { @@ -38,26 +39,26 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Identifier.IdentifierUseEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case USUAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.USUAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.OFFICIAL); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.TEMP); - break; - case SECONDARY: - tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.SECONDARY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.NULL); - break; - } - } + tgt.setValue(Identifier.IdentifierUse.USUAL); + break; + case OFFICIAL: + tgt.setValue(Identifier.IdentifierUse.OFFICIAL); + break; + case TEMP: + tgt.setValue(Identifier.IdentifierUse.TEMP); + break; + case SECONDARY: + tgt.setValue(Identifier.IdentifierUse.SECONDARY); + break; + default: + tgt.setValue(Identifier.IdentifierUse.NULL); + break; + } +} return tgt; } @@ -66,26 +67,26 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Identifier.IdentifierUseEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case USUAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.USUAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.OFFICIAL); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.TEMP); - break; - case SECONDARY: - tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.SECONDARY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.USUAL); + break; + case OFFICIAL: + tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.OFFICIAL); + break; + case TEMP: + tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.TEMP); + break; + case SECONDARY: + tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.SECONDARY); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.NULL); + break; + } +} return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/datatypes10_30/complextypes10_30/Quantity10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/datatypes10_30/complextypes10_30/Quantity10_30.java index 8ec507d6fb..830e874d9b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/datatypes10_30/complextypes10_30/Quantity10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/datatypes10_30/complextypes10_30/Quantity10_30.java @@ -5,6 +5,7 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Decimal10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Uri10_30; +import org.hl7.fhir.dstu3.model.Quantity; import org.hl7.fhir.exceptions.FHIRException; public class Quantity10_30 { @@ -37,26 +38,26 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Quantity.QuantityComparatorEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Quantity.QuantityComparator.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case LESS_THAN: - tgt.setValue(org.hl7.fhir.dstu3.model.Quantity.QuantityComparator.LESS_THAN); - break; - case LESS_OR_EQUAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Quantity.QuantityComparator.LESS_OR_EQUAL); - break; - case GREATER_OR_EQUAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Quantity.QuantityComparator.GREATER_OR_EQUAL); - break; - case GREATER_THAN: - tgt.setValue(org.hl7.fhir.dstu3.model.Quantity.QuantityComparator.GREATER_THAN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Quantity.QuantityComparator.NULL); - break; - } - } + tgt.setValue(Quantity.QuantityComparator.LESS_THAN); + break; + case LESS_OR_EQUAL: + tgt.setValue(Quantity.QuantityComparator.LESS_OR_EQUAL); + break; + case GREATER_OR_EQUAL: + tgt.setValue(Quantity.QuantityComparator.GREATER_OR_EQUAL); + break; + case GREATER_THAN: + tgt.setValue(Quantity.QuantityComparator.GREATER_THAN); + break; + default: + tgt.setValue(Quantity.QuantityComparator.NULL); + break; + } +} return tgt; } @@ -65,26 +66,26 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Quantity.QuantityComparatorEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.Quantity.QuantityComparator.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case LESS_THAN: - tgt.setValue(org.hl7.fhir.dstu2.model.Quantity.QuantityComparator.LESS_THAN); - break; - case LESS_OR_EQUAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Quantity.QuantityComparator.LESS_OR_EQUAL); - break; - case GREATER_OR_EQUAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Quantity.QuantityComparator.GREATER_OR_EQUAL); - break; - case GREATER_THAN: - tgt.setValue(org.hl7.fhir.dstu2.model.Quantity.QuantityComparator.GREATER_THAN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Quantity.QuantityComparator.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.Quantity.QuantityComparator.LESS_THAN); + break; + case LESS_OR_EQUAL: + tgt.setValue(org.hl7.fhir.dstu2.model.Quantity.QuantityComparator.LESS_OR_EQUAL); + break; + case GREATER_OR_EQUAL: + tgt.setValue(org.hl7.fhir.dstu2.model.Quantity.QuantityComparator.GREATER_OR_EQUAL); + break; + case GREATER_THAN: + tgt.setValue(org.hl7.fhir.dstu2.model.Quantity.QuantityComparator.GREATER_THAN); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Quantity.QuantityComparator.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/datatypes10_30/complextypes10_30/Timing10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/datatypes10_30/complextypes10_30/Timing10_30.java index ca047237c2..b8e19e0825 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/datatypes10_30/complextypes10_30/Timing10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/datatypes10_30/complextypes10_30/Timing10_30.java @@ -5,6 +5,7 @@ import org.hl7.fhir.convertors.context.ConversionContext10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Decimal10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Integer10_30; +import org.hl7.fhir.dstu3.model.Timing; import org.hl7.fhir.exceptions.FHIRException; public class Timing10_30 { @@ -75,35 +76,35 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Timing.UnitsOfTimeEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case S: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.S); - break; - case MIN: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.MIN); - break; - case H: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.H); - break; - case D: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.D); - break; - case WK: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.WK); - break; - case MO: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.MO); - break; - case A: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.A); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.NULL); - break; - } - } + tgt.setValue(Timing.UnitsOfTime.S); + break; + case MIN: + tgt.setValue(Timing.UnitsOfTime.MIN); + break; + case H: + tgt.setValue(Timing.UnitsOfTime.H); + break; + case D: + tgt.setValue(Timing.UnitsOfTime.D); + break; + case WK: + tgt.setValue(Timing.UnitsOfTime.WK); + break; + case MO: + tgt.setValue(Timing.UnitsOfTime.MO); + break; + case A: + tgt.setValue(Timing.UnitsOfTime.A); + break; + default: + tgt.setValue(Timing.UnitsOfTime.NULL); + break; + } +} return tgt; } @@ -112,35 +113,35 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Timing.UnitsOfTimeEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case S: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.S); - break; - case MIN: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.MIN); - break; - case H: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.H); - break; - case D: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.D); - break; - case WK: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.WK); - break; - case MO: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.MO); - break; - case A: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.A); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.S); + break; + case MIN: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.MIN); + break; + case H: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.H); + break; + case D: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.D); + break; + case WK: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.WK); + break; + case MO: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.MO); + break; + case A: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.A); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.NULL); + break; + } +} return tgt; } @@ -149,56 +150,56 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Timing.EventTimingEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HS: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.HS); - break; - case WAKE: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.WAKE); - break; - case C: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.C); - break; - case CM: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.CM); - break; - case CD: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.CD); - break; - case CV: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.CV); - break; - case AC: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.AC); - break; - case ACM: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.ACM); - break; - case ACD: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.ACD); - break; - case ACV: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.ACV); - break; - case PC: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.PC); - break; - case PCM: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.PCM); - break; - case PCD: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.PCD); - break; - case PCV: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.PCV); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.NULL); - break; - } - } + tgt.setValue(Timing.EventTiming.HS); + break; + case WAKE: + tgt.setValue(Timing.EventTiming.WAKE); + break; + case C: + tgt.setValue(Timing.EventTiming.C); + break; + case CM: + tgt.setValue(Timing.EventTiming.CM); + break; + case CD: + tgt.setValue(Timing.EventTiming.CD); + break; + case CV: + tgt.setValue(Timing.EventTiming.CV); + break; + case AC: + tgt.setValue(Timing.EventTiming.AC); + break; + case ACM: + tgt.setValue(Timing.EventTiming.ACM); + break; + case ACD: + tgt.setValue(Timing.EventTiming.ACD); + break; + case ACV: + tgt.setValue(Timing.EventTiming.ACV); + break; + case PC: + tgt.setValue(Timing.EventTiming.PC); + break; + case PCM: + tgt.setValue(Timing.EventTiming.PCM); + break; + case PCD: + tgt.setValue(Timing.EventTiming.PCD); + break; + case PCV: + tgt.setValue(Timing.EventTiming.PCV); + break; + default: + tgt.setValue(Timing.EventTiming.NULL); + break; + } +} return tgt; } @@ -207,56 +208,56 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Timing.EventTimingEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HS: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.HS); - break; - case WAKE: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.WAKE); - break; - case C: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.C); - break; - case CM: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.CM); - break; - case CD: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.CD); - break; - case CV: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.CV); - break; - case AC: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.AC); - break; - case ACM: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.ACM); - break; - case ACD: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.ACD); - break; - case ACV: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.ACV); - break; - case PC: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.PC); - break; - case PCM: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.PCM); - break; - case PCD: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.PCD); - break; - case PCV: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.PCV); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.HS); + break; + case WAKE: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.WAKE); + break; + case C: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.C); + break; + case CM: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.CM); + break; + case CD: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.CD); + break; + case CV: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.CV); + break; + case AC: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.AC); + break; + case ACM: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.ACM); + break; + case ACD: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.ACD); + break; + case ACV: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.ACV); + break; + case PC: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.PC); + break; + case PCM: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.PCM); + break; + case PCD: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.PCD); + break; + case PCV: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.PCV); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Account10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Account10_30.java index 6d15eb72a4..2e20ffe88c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Account10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Account10_30.java @@ -7,6 +7,8 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Money10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Period10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; +import org.hl7.fhir.dstu3.model.Account; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; public class Account10_30 { @@ -66,18 +68,22 @@ public static org.hl7.fhir.dstu3.model.Account convertAccount(org.hl7.fhir.dstu2 static public org.hl7.fhir.dstu3.model.Enumeration convertAccountStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { if (src == null || src.isEmpty()) return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Account.AccountStatusEnumFactory()); + Enumeration tgt = new Enumeration<>(new Account.AccountStatusEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Account.AccountStatus.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Account.AccountStatus.INACTIVE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Account.AccountStatus.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Account.AccountStatus.ACTIVE); + break; + case INACTIVE: + tgt.setValue(Account.AccountStatus.INACTIVE); + break; + default: + tgt.setValue(Account.AccountStatus.NULL); + break; + } } return tgt; } @@ -87,16 +93,20 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Account.AccountStatusEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.Account.AccountStatus.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.Account.AccountStatus.INACTIVE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Account.AccountStatus.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu2.model.Account.AccountStatus.ACTIVE); + break; + case INACTIVE: + tgt.setValue(org.hl7.fhir.dstu2.model.Account.AccountStatus.INACTIVE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Account.AccountStatus.NULL); + break; + } } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Appointment10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Appointment10_30.java index f6c047e59f..415eba918b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Appointment10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Appointment10_30.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.PositiveInt10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.UnsignedInt10_30; +import org.hl7.fhir.dstu2.model.Appointment; +import org.hl7.fhir.dstu2.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; public class Appointment10_30 { @@ -105,33 +107,37 @@ public static org.hl7.fhir.dstu3.model.Appointment.AppointmentParticipantCompone static public org.hl7.fhir.dstu2.model.Enumeration convertAppointmentStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { if (src == null || src.isEmpty()) return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Appointment.AppointmentStatusEnumFactory()); + Enumeration tgt = new Enumeration<>(new Appointment.AppointmentStatusEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSED: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.PROPOSED); - break; - case PENDING: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.PENDING); - break; - case BOOKED: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.BOOKED); - break; - case ARRIVED: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.ARRIVED); - break; - case FULFILLED: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.FULFILLED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.CANCELLED); - break; - case NOSHOW: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.NOSHOW); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSED: + tgt.setValue(Appointment.AppointmentStatus.PROPOSED); + break; + case PENDING: + tgt.setValue(Appointment.AppointmentStatus.PENDING); + break; + case BOOKED: + tgt.setValue(Appointment.AppointmentStatus.BOOKED); + break; + case ARRIVED: + tgt.setValue(Appointment.AppointmentStatus.ARRIVED); + break; + case FULFILLED: + tgt.setValue(Appointment.AppointmentStatus.FULFILLED); + break; + case CANCELLED: + tgt.setValue(Appointment.AppointmentStatus.CANCELLED); + break; + case NOSHOW: + tgt.setValue(Appointment.AppointmentStatus.NOSHOW); + break; + default: + tgt.setValue(Appointment.AppointmentStatus.NULL); + break; + } } return tgt; } @@ -141,31 +147,35 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Appointment.AppointmentStatusEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSED: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.PROPOSED); - break; - case PENDING: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.PENDING); - break; - case BOOKED: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.BOOKED); - break; - case ARRIVED: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.ARRIVED); - break; - case FULFILLED: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.FULFILLED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.CANCELLED); - break; - case NOSHOW: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.NOSHOW); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSED: + tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.PROPOSED); + break; + case PENDING: + tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.PENDING); + break; + case BOOKED: + tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.BOOKED); + break; + case ARRIVED: + tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.ARRIVED); + break; + case FULFILLED: + tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.FULFILLED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.CANCELLED); + break; + case NOSHOW: + tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.NOSHOW); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.NULL); + break; + } } return tgt; } @@ -173,21 +183,25 @@ static public org.hl7.fhir.dstu3.model.Enumeration convertParticipantRequired(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { if (src == null || src.isEmpty()) return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Appointment.ParticipantRequiredEnumFactory()); + Enumeration tgt = new Enumeration<>(new Appointment.ParticipantRequiredEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case REQUIRED: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipantRequired.REQUIRED); - break; - case OPTIONAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipantRequired.OPTIONAL); - break; - case INFORMATIONONLY: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipantRequired.INFORMATIONONLY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipantRequired.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REQUIRED: + tgt.setValue(Appointment.ParticipantRequired.REQUIRED); + break; + case OPTIONAL: + tgt.setValue(Appointment.ParticipantRequired.OPTIONAL); + break; + case INFORMATIONONLY: + tgt.setValue(Appointment.ParticipantRequired.INFORMATIONONLY); + break; + default: + tgt.setValue(Appointment.ParticipantRequired.NULL); + break; + } } return tgt; } @@ -197,19 +211,23 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Appointment.ParticipantRequiredEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case REQUIRED: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipantRequired.REQUIRED); - break; - case OPTIONAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipantRequired.OPTIONAL); - break; - case INFORMATIONONLY: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipantRequired.INFORMATIONONLY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipantRequired.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REQUIRED: + tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipantRequired.REQUIRED); + break; + case OPTIONAL: + tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipantRequired.OPTIONAL); + break; + case INFORMATIONONLY: + tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipantRequired.INFORMATIONONLY); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipantRequired.NULL); + break; + } } return tgt; } @@ -217,24 +235,28 @@ static public org.hl7.fhir.dstu3.model.Enumeration convertParticipationStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { if (src == null || src.isEmpty()) return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Appointment.ParticipationStatusEnumFactory()); + Enumeration tgt = new Enumeration<>(new Appointment.ParticipationStatusEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case ACCEPTED: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipationStatus.ACCEPTED); - break; - case DECLINED: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipationStatus.DECLINED); - break; - case TENTATIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipationStatus.TENTATIVE); - break; - case NEEDSACTION: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipationStatus.NEEDSACTION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipationStatus.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACCEPTED: + tgt.setValue(Appointment.ParticipationStatus.ACCEPTED); + break; + case DECLINED: + tgt.setValue(Appointment.ParticipationStatus.DECLINED); + break; + case TENTATIVE: + tgt.setValue(Appointment.ParticipationStatus.TENTATIVE); + break; + case NEEDSACTION: + tgt.setValue(Appointment.ParticipationStatus.NEEDSACTION); + break; + default: + tgt.setValue(Appointment.ParticipationStatus.NULL); + break; + } } return tgt; } @@ -244,22 +266,26 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Appointment.ParticipationStatusEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case ACCEPTED: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipationStatus.ACCEPTED); - break; - case DECLINED: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipationStatus.DECLINED); - break; - case TENTATIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipationStatus.TENTATIVE); - break; - case NEEDSACTION: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipationStatus.NEEDSACTION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipationStatus.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACCEPTED: + tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipationStatus.ACCEPTED); + break; + case DECLINED: + tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipationStatus.DECLINED); + break; + case TENTATIVE: + tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipationStatus.TENTATIVE); + break; + case NEEDSACTION: + tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipationStatus.NEEDSACTION); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipationStatus.NULL); + break; + } } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/AppointmentResponse10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/AppointmentResponse10_30.java index c8828a4352..d917bc95cb 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/AppointmentResponse10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/AppointmentResponse10_30.java @@ -6,6 +6,8 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Identifier10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Instant10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; +import org.hl7.fhir.dstu3.model.AppointmentResponse; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; public class AppointmentResponse10_30 { @@ -61,30 +63,34 @@ public static org.hl7.fhir.dstu3.model.AppointmentResponse convertAppointmentRes static public org.hl7.fhir.dstu3.model.Enumeration convertParticipantStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { if (src == null || src.isEmpty()) return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatusEnumFactory()); + Enumeration tgt = new Enumeration<>(new AppointmentResponse.ParticipantStatusEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case ACCEPTED: - tgt.setValue(org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatus.ACCEPTED); - break; - case DECLINED: - tgt.setValue(org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatus.DECLINED); - break; - case TENTATIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatus.TENTATIVE); - break; - case INPROCESS: - tgt.setValue(org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatus.ACCEPTED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatus.ACCEPTED); - break; - case NEEDSACTION: - tgt.setValue(org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatus.NEEDSACTION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatus.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACCEPTED: + tgt.setValue(AppointmentResponse.ParticipantStatus.ACCEPTED); + break; + case DECLINED: + tgt.setValue(AppointmentResponse.ParticipantStatus.DECLINED); + break; + case TENTATIVE: + tgt.setValue(AppointmentResponse.ParticipantStatus.TENTATIVE); + break; + case INPROCESS: + tgt.setValue(AppointmentResponse.ParticipantStatus.ACCEPTED); + break; + case COMPLETED: + tgt.setValue(AppointmentResponse.ParticipantStatus.ACCEPTED); + break; + case NEEDSACTION: + tgt.setValue(AppointmentResponse.ParticipantStatus.NEEDSACTION); + break; + default: + tgt.setValue(AppointmentResponse.ParticipantStatus.NULL); + break; + } } return tgt; } @@ -94,22 +100,26 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatusEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case ACCEPTED: - tgt.setValue(org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus.ACCEPTED); - break; - case DECLINED: - tgt.setValue(org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus.DECLINED); - break; - case TENTATIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus.TENTATIVE); - break; - case NEEDSACTION: - tgt.setValue(org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus.NEEDSACTION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACCEPTED: + tgt.setValue(org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus.ACCEPTED); + break; + case DECLINED: + tgt.setValue(org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus.DECLINED); + break; + case TENTATIVE: + tgt.setValue(org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus.TENTATIVE); + break; + case NEEDSACTION: + tgt.setValue(org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus.NEEDSACTION); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus.NULL); + break; + } } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/AuditEvent10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/AuditEvent10_30.java index 51d0c67101..2009d570a1 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/AuditEvent10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/AuditEvent10_30.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Base64Binary10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Boolean10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; +import org.hl7.fhir.dstu3.model.AuditEvent; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; public class AuditEvent10_30 { @@ -62,59 +64,67 @@ public static org.hl7.fhir.dstu3.model.AuditEvent convertAuditEvent(org.hl7.fhir } static public org.hl7.fhir.dstu3.model.Enumeration convertAuditEventAction(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventActionEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case C: - tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.C); - break; - case R: - tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.R); - break; - case U: - tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.U); - break; - case D: - tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.D); - break; - case E: - tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.E); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new AuditEvent.AuditEventActionEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case C: + tgt.setValue(AuditEvent.AuditEventAction.C); + break; + case R: + tgt.setValue(AuditEvent.AuditEventAction.R); + break; + case U: + tgt.setValue(AuditEvent.AuditEventAction.U); + break; + case D: + tgt.setValue(AuditEvent.AuditEventAction.D); + break; + case E: + tgt.setValue(AuditEvent.AuditEventAction.E); + break; + default: + tgt.setValue(AuditEvent.AuditEventAction.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertAuditEventAction(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventActionEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case C: - tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.C); - break; - case R: - tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.R); - break; - case U: - tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.U); - break; - case D: - tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.D); - break; - case E: - tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.E); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventActionEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case C: + tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.C); + break; + case R: + tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.R); + break; + case U: + tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.U); + break; + case D: + tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.D); + break; + case E: + tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.E); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentComponent convertAuditEventAgentComponent(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantComponent src) throws FHIRException { @@ -278,109 +288,125 @@ public static org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityDetailComponen } static public org.hl7.fhir.dstu3.model.Enumeration convertAuditEventOutcome(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventOutcomeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case _0: - tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventOutcome._0); - break; - case _4: - tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventOutcome._4); - break; - case _8: - tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventOutcome._8); - break; - case _12: - tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventOutcome._12); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventOutcome.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new AuditEvent.AuditEventOutcomeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case _0: + tgt.setValue(AuditEvent.AuditEventOutcome._0); + break; + case _4: + tgt.setValue(AuditEvent.AuditEventOutcome._4); + break; + case _8: + tgt.setValue(AuditEvent.AuditEventOutcome._8); + break; + case _12: + tgt.setValue(AuditEvent.AuditEventOutcome._12); + break; + default: + tgt.setValue(AuditEvent.AuditEventOutcome.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertAuditEventOutcome(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventOutcomeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case _0: - tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventOutcome._0); - break; - case _4: - tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventOutcome._4); - break; - case _8: - tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventOutcome._8); - break; - case _12: - tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventOutcome._12); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventOutcome.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventOutcomeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case _0: + tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventOutcome._0); + break; + case _4: + tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventOutcome._4); + break; + case _8: + tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventOutcome._8); + break; + case _12: + tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventOutcome._12); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventOutcome.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertAuditEventParticipantNetworkType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkTypeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case _1: - tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkType._1); - break; - case _2: - tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkType._2); - break; - case _3: - tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkType._3); - break; - case _4: - tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkType._4); - break; - case _5: - tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkType._5); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkTypeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case _1: + tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkType._1); + break; + case _2: + tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkType._2); + break; + case _3: + tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkType._3); + break; + case _4: + tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkType._4); + break; + case _5: + tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkType._5); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertAuditEventParticipantNetworkType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkTypeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case _1: - tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType._1); - break; - case _2: - tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType._2); - break; - case _3: - tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType._3); - break; - case _4: - tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType._4); - break; - case _5: - tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType._5); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new AuditEvent.AuditEventAgentNetworkTypeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case _1: + tgt.setValue(AuditEvent.AuditEventAgentNetworkType._1); + break; + case _2: + tgt.setValue(AuditEvent.AuditEventAgentNetworkType._2); + break; + case _3: + tgt.setValue(AuditEvent.AuditEventAgentNetworkType._3); + break; + case _4: + tgt.setValue(AuditEvent.AuditEventAgentNetworkType._4); + break; + case _5: + tgt.setValue(AuditEvent.AuditEventAgentNetworkType._5); + break; + default: + tgt.setValue(AuditEvent.AuditEventAgentNetworkType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2.model.AuditEvent.AuditEventSourceComponent convertAuditEventSourceComponent(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventSourceComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Bundle10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Bundle10_30.java index 56dafebf6e..4ff0e88262 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Bundle10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Bundle10_30.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.UnsignedInt10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Uri10_30; +import org.hl7.fhir.dstu3.model.Bundle; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.utilities.FhirPublication; @@ -220,176 +222,200 @@ public static org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent convertBundleL } static public org.hl7.fhir.dstu3.model.Enumeration convertBundleType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Bundle.BundleTypeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case DOCUMENT: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.DOCUMENT); - break; - case MESSAGE: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.MESSAGE); - break; - case TRANSACTION: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.TRANSACTION); - break; - case TRANSACTIONRESPONSE: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.TRANSACTIONRESPONSE); - break; - case BATCH: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.BATCH); - break; - case BATCHRESPONSE: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.BATCHRESPONSE); - break; - case HISTORY: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.HISTORY); - break; - case SEARCHSET: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.SEARCHSET); - break; - case COLLECTION: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.COLLECTION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Bundle.BundleTypeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DOCUMENT: + tgt.setValue(Bundle.BundleType.DOCUMENT); + break; + case MESSAGE: + tgt.setValue(Bundle.BundleType.MESSAGE); + break; + case TRANSACTION: + tgt.setValue(Bundle.BundleType.TRANSACTION); + break; + case TRANSACTIONRESPONSE: + tgt.setValue(Bundle.BundleType.TRANSACTIONRESPONSE); + break; + case BATCH: + tgt.setValue(Bundle.BundleType.BATCH); + break; + case BATCHRESPONSE: + tgt.setValue(Bundle.BundleType.BATCHRESPONSE); + break; + case HISTORY: + tgt.setValue(Bundle.BundleType.HISTORY); + break; + case SEARCHSET: + tgt.setValue(Bundle.BundleType.SEARCHSET); + break; + case COLLECTION: + tgt.setValue(Bundle.BundleType.COLLECTION); + break; + default: + tgt.setValue(Bundle.BundleType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertBundleType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Bundle.BundleTypeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case DOCUMENT: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.DOCUMENT); - break; - case MESSAGE: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.MESSAGE); - break; - case TRANSACTION: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.TRANSACTION); - break; - case TRANSACTIONRESPONSE: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.TRANSACTIONRESPONSE); - break; - case BATCH: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.BATCH); - break; - case BATCHRESPONSE: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.BATCHRESPONSE); - break; - case HISTORY: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.HISTORY); - break; - case SEARCHSET: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.SEARCHSET); - break; - case COLLECTION: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.COLLECTION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Bundle.BundleTypeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DOCUMENT: + tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.DOCUMENT); + break; + case MESSAGE: + tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.MESSAGE); + break; + case TRANSACTION: + tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.TRANSACTION); + break; + case TRANSACTIONRESPONSE: + tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.TRANSACTIONRESPONSE); + break; + case BATCH: + tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.BATCH); + break; + case BATCHRESPONSE: + tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.BATCHRESPONSE); + break; + case HISTORY: + tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.HISTORY); + break; + case SEARCHSET: + tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.SEARCHSET); + break; + case COLLECTION: + tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.COLLECTION); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertHTTPVerb(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Bundle.HTTPVerbEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case GET: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.HTTPVerb.GET); - break; - case POST: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.HTTPVerb.POST); - break; - case PUT: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.HTTPVerb.PUT); - break; - case DELETE: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.HTTPVerb.DELETE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.HTTPVerb.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Bundle.HTTPVerbEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case GET: + tgt.setValue(Bundle.HTTPVerb.GET); + break; + case POST: + tgt.setValue(Bundle.HTTPVerb.POST); + break; + case PUT: + tgt.setValue(Bundle.HTTPVerb.PUT); + break; + case DELETE: + tgt.setValue(Bundle.HTTPVerb.DELETE); + break; + default: + tgt.setValue(Bundle.HTTPVerb.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertHTTPVerb(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Bundle.HTTPVerbEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case GET: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.HTTPVerb.GET); - break; - case POST: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.HTTPVerb.POST); - break; - case PUT: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.HTTPVerb.PUT); - break; - case DELETE: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.HTTPVerb.DELETE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.HTTPVerb.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Bundle.HTTPVerbEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case GET: + tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.HTTPVerb.GET); + break; + case POST: + tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.HTTPVerb.POST); + break; + case PUT: + tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.HTTPVerb.PUT); + break; + case DELETE: + tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.HTTPVerb.DELETE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.HTTPVerb.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertSearchEntryMode(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Bundle.SearchEntryModeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case MATCH: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.SearchEntryMode.MATCH); - break; - case INCLUDE: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.SearchEntryMode.INCLUDE); - break; - case OUTCOME: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.SearchEntryMode.OUTCOME); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.SearchEntryMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Bundle.SearchEntryModeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MATCH: + tgt.setValue(Bundle.SearchEntryMode.MATCH); + break; + case INCLUDE: + tgt.setValue(Bundle.SearchEntryMode.INCLUDE); + break; + case OUTCOME: + tgt.setValue(Bundle.SearchEntryMode.OUTCOME); + break; + default: + tgt.setValue(Bundle.SearchEntryMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertSearchEntryMode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Bundle.SearchEntryModeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case MATCH: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.SearchEntryMode.MATCH); - break; - case INCLUDE: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.SearchEntryMode.INCLUDE); - break; - case OUTCOME: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.SearchEntryMode.OUTCOME); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.SearchEntryMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Bundle.SearchEntryModeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MATCH: + tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.SearchEntryMode.MATCH); + break; + case INCLUDE: + tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.SearchEntryMode.INCLUDE); + break; + case OUTCOME: + tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.SearchEntryMode.OUTCOME); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.SearchEntryMode.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/CarePlan10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/CarePlan10_30.java index 68e2ed269f..3db71f748c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/CarePlan10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/CarePlan10_30.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.SimpleQuantity10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Boolean10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; +import org.hl7.fhir.dstu2.model.CarePlan; +import org.hl7.fhir.dstu2.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; public class CarePlan10_30 { @@ -168,117 +170,133 @@ public static org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityDetailComponent } static public org.hl7.fhir.dstu2.model.Enumeration convertCarePlanActivityStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case NOTSTARTED: - tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatus.NOTSTARTED); - break; - case SCHEDULED: - tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatus.SCHEDULED); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatus.INPROGRESS); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatus.ONHOLD); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatus.COMPLETED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatus.CANCELLED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CarePlan.CarePlanActivityStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTSTARTED: + tgt.setValue(CarePlan.CarePlanActivityStatus.NOTSTARTED); + break; + case SCHEDULED: + tgt.setValue(CarePlan.CarePlanActivityStatus.SCHEDULED); + break; + case INPROGRESS: + tgt.setValue(CarePlan.CarePlanActivityStatus.INPROGRESS); + break; + case ONHOLD: + tgt.setValue(CarePlan.CarePlanActivityStatus.ONHOLD); + break; + case COMPLETED: + tgt.setValue(CarePlan.CarePlanActivityStatus.COMPLETED); + break; + case CANCELLED: + tgt.setValue(CarePlan.CarePlanActivityStatus.CANCELLED); + break; + default: + tgt.setValue(CarePlan.CarePlanActivityStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertCarePlanActivityStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case NOTSTARTED: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus.NOTSTARTED); - break; - case SCHEDULED: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus.SCHEDULED); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus.INPROGRESS); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus.ONHOLD); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus.COMPLETED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus.CANCELLED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTSTARTED: + tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus.NOTSTARTED); + break; + case SCHEDULED: + tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus.SCHEDULED); + break; + case INPROGRESS: + tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus.INPROGRESS); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus.ONHOLD); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus.COMPLETED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus.CANCELLED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertCarePlanStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatus.ACTIVE); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatus.COMPLETED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatus.CANCELLED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CarePlan.CarePlanStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(CarePlan.CarePlanStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(CarePlan.CarePlanStatus.ACTIVE); + break; + case COMPLETED: + tgt.setValue(CarePlan.CarePlanStatus.COMPLETED); + break; + case CANCELLED: + tgt.setValue(CarePlan.CarePlanStatus.CANCELLED); + break; + default: + tgt.setValue(CarePlan.CarePlanStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertCarePlanStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSED: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus.DRAFT); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus.ACTIVE); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus.COMPLETED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus.CANCELLED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSED: + tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus.DRAFT); + break; + case DRAFT: + tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus.ACTIVE); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus.COMPLETED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus.CANCELLED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/ClinicalImpression10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/ClinicalImpression10_30.java index f53be89bf6..3b9751ebce 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/ClinicalImpression10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/ClinicalImpression10_30.java @@ -5,6 +5,8 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.CodeableConcept10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.DateTime10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; +import org.hl7.fhir.dstu3.model.ClinicalImpression; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.dstu3.model.UriType; import org.hl7.fhir.exceptions.FHIRException; @@ -93,46 +95,54 @@ public static org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionFind } static public org.hl7.fhir.dstu3.model.Enumeration convertClinicalImpressionStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionStatus.DRAFT); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ClinicalImpression.ClinicalImpressionStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(ClinicalImpression.ClinicalImpressionStatus.DRAFT); + break; + case COMPLETED: + tgt.setValue(ClinicalImpression.ClinicalImpressionStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(ClinicalImpression.ClinicalImpressionStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(ClinicalImpression.ClinicalImpressionStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertClinicalImpressionStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Communication10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Communication10_30.java index 0ec05a439b..052a3533d5 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Communication10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Communication10_30.java @@ -5,6 +5,8 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.CodeableConcept10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Identifier10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.DateTime10_30; +import org.hl7.fhir.dstu3.model.Communication; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; public class Communication10_30 { @@ -94,58 +96,66 @@ public static org.hl7.fhir.dstu3.model.Communication.CommunicationPayloadCompone } static public org.hl7.fhir.dstu3.model.Enumeration convertCommunicationStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Communication.CommunicationStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu3.model.Communication.CommunicationStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.Communication.CommunicationStatus.COMPLETED); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.dstu3.model.Communication.CommunicationStatus.SUSPENDED); - break; - case REJECTED: - tgt.setValue(org.hl7.fhir.dstu3.model.Communication.CommunicationStatus.ENTEREDINERROR); - break; - case FAILED: - tgt.setValue(org.hl7.fhir.dstu3.model.Communication.CommunicationStatus.ABORTED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Communication.CommunicationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Communication.CommunicationStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(Communication.CommunicationStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(Communication.CommunicationStatus.COMPLETED); + break; + case SUSPENDED: + tgt.setValue(Communication.CommunicationStatus.SUSPENDED); + break; + case REJECTED: + tgt.setValue(Communication.CommunicationStatus.ENTEREDINERROR); + break; + case FAILED: + tgt.setValue(Communication.CommunicationStatus.ABORTED); + break; + default: + tgt.setValue(Communication.CommunicationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertCommunicationStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Communication.CommunicationStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu2.model.Communication.CommunicationStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu2.model.Communication.CommunicationStatus.COMPLETED); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.dstu2.model.Communication.CommunicationStatus.SUSPENDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.Communication.CommunicationStatus.REJECTED); - break; - case ABORTED: - tgt.setValue(org.hl7.fhir.dstu2.model.Communication.CommunicationStatus.FAILED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Communication.CommunicationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Communication.CommunicationStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(org.hl7.fhir.dstu2.model.Communication.CommunicationStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.dstu2.model.Communication.CommunicationStatus.COMPLETED); + break; + case SUSPENDED: + tgt.setValue(org.hl7.fhir.dstu2.model.Communication.CommunicationStatus.SUSPENDED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu2.model.Communication.CommunicationStatus.REJECTED); + break; + case ABORTED: + tgt.setValue(org.hl7.fhir.dstu2.model.Communication.CommunicationStatus.FAILED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Communication.CommunicationStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/CommunicationRequest10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/CommunicationRequest10_30.java index f37d6e1875..993be190e6 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/CommunicationRequest10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/CommunicationRequest10_30.java @@ -5,6 +5,8 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.CodeableConcept10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Identifier10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.DateTime10_30; +import org.hl7.fhir.dstu3.model.CommunicationRequest; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; public class CommunicationRequest10_30 { @@ -100,71 +102,79 @@ public static org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequest } static public org.hl7.fhir.dstu3.model.Enumeration convertCommunicationRequestStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSED: - tgt.setValue(org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestStatus.DRAFT); - break; - case PLANNED: - tgt.setValue(org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestStatus.ACTIVE); - break; - case REQUESTED: - tgt.setValue(org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestStatus.ACTIVE); - break; - case RECEIVED: - tgt.setValue(org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestStatus.ACTIVE); - break; - case ACCEPTED: - tgt.setValue(org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestStatus.ACTIVE); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestStatus.ACTIVE); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestStatus.COMPLETED); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestStatus.SUSPENDED); - break; - case REJECTED: - tgt.setValue(org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CommunicationRequest.CommunicationRequestStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSED: + tgt.setValue(CommunicationRequest.CommunicationRequestStatus.DRAFT); + break; + case PLANNED: + tgt.setValue(CommunicationRequest.CommunicationRequestStatus.ACTIVE); + break; + case REQUESTED: + tgt.setValue(CommunicationRequest.CommunicationRequestStatus.ACTIVE); + break; + case RECEIVED: + tgt.setValue(CommunicationRequest.CommunicationRequestStatus.ACTIVE); + break; + case ACCEPTED: + tgt.setValue(CommunicationRequest.CommunicationRequestStatus.ACTIVE); + break; + case INPROGRESS: + tgt.setValue(CommunicationRequest.CommunicationRequestStatus.ACTIVE); + break; + case COMPLETED: + tgt.setValue(CommunicationRequest.CommunicationRequestStatus.COMPLETED); + break; + case SUSPENDED: + tgt.setValue(CommunicationRequest.CommunicationRequestStatus.SUSPENDED); + break; + case REJECTED: + tgt.setValue(CommunicationRequest.CommunicationRequestStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(CommunicationRequest.CommunicationRequestStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertCommunicationRequestStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.PROPOSED); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.COMPLETED); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.SUSPENDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.REJECTED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.PROPOSED); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.COMPLETED); + break; + case SUSPENDED: + tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.SUSPENDED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.REJECTED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.CodeableConcept convertPriorityCode(org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationPriority priority) { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Composition10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Composition10_30.java index 53a998aa3c..84f05d4a9f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Composition10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Composition10_30.java @@ -10,6 +10,8 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Period10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.DateTime10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; +import org.hl7.fhir.dstu3.model.Composition; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; public class Composition10_30 { @@ -88,53 +90,61 @@ public static org.hl7.fhir.dstu2.model.Composition convertComposition(org.hl7.fh } static public org.hl7.fhir.dstu3.model.Enumeration convertCompositionAttestationMode(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Composition.CompositionAttestationModeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case PERSONAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode.PERSONAL); - break; - case PROFESSIONAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode.PROFESSIONAL); - break; - case LEGAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode.LEGAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode.OFFICIAL); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Composition.CompositionAttestationModeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PERSONAL: + tgt.setValue(Composition.CompositionAttestationMode.PERSONAL); + break; + case PROFESSIONAL: + tgt.setValue(Composition.CompositionAttestationMode.PROFESSIONAL); + break; + case LEGAL: + tgt.setValue(Composition.CompositionAttestationMode.LEGAL); + break; + case OFFICIAL: + tgt.setValue(Composition.CompositionAttestationMode.OFFICIAL); + break; + default: + tgt.setValue(Composition.CompositionAttestationMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertCompositionAttestationMode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Composition.CompositionAttestationModeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case PERSONAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode.PERSONAL); - break; - case PROFESSIONAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode.PROFESSIONAL); - break; - case LEGAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode.LEGAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode.OFFICIAL); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Composition.CompositionAttestationModeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PERSONAL: + tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode.PERSONAL); + break; + case PROFESSIONAL: + tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode.PROFESSIONAL); + break; + case LEGAL: + tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode.LEGAL); + break; + case OFFICIAL: + tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode.OFFICIAL); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.Composition.CompositionAttesterComponent convertCompositionAttesterComponent(org.hl7.fhir.dstu2.model.Composition.CompositionAttesterComponent src) throws FHIRException { @@ -194,53 +204,61 @@ public static org.hl7.fhir.dstu3.model.Composition.CompositionEventComponent con } static public org.hl7.fhir.dstu3.model.Enumeration convertCompositionStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Composition.CompositionStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionStatus.AMENDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Composition.CompositionStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRELIMINARY: + tgt.setValue(Composition.CompositionStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(Composition.CompositionStatus.FINAL); + break; + case AMENDED: + tgt.setValue(Composition.CompositionStatus.AMENDED); + break; + case ENTEREDINERROR: + tgt.setValue(Composition.CompositionStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Composition.CompositionStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertCompositionStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Composition.CompositionStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionStatus.AMENDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Composition.CompositionStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRELIMINARY: + tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionStatus.FINAL); + break; + case AMENDED: + tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionStatus.AMENDED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.Composition.SectionComponent convertSectionComponent(org.hl7.fhir.dstu2.model.Composition.SectionComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/ConceptMap10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/ConceptMap10_30.java index 79f99dd3f8..a2902bd548 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/ConceptMap10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/ConceptMap10_30.java @@ -16,6 +16,8 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Uri10_30; import org.hl7.fhir.dstu3.model.ConceptMap; import org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupComponent; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.Enumerations; import org.hl7.fhir.exceptions.FHIRException; public class ConceptMap10_30 { @@ -135,83 +137,91 @@ public static org.hl7.fhir.dstu2.model.ConceptMap.ConceptMapContactComponent con } static public org.hl7.fhir.dstu3.model.Enumeration convertConceptMapEquivalence(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalenceEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case EQUIVALENT: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.EQUIVALENT); - break; - case EQUAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.EQUAL); - break; - case WIDER: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.WIDER); - break; - case SUBSUMES: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.SUBSUMES); - break; - case NARROWER: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.NARROWER); - break; - case SPECIALIZES: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.SPECIALIZES); - break; - case INEXACT: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.INEXACT); - break; - case UNMATCHED: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.UNMATCHED); - break; - case DISJOINT: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.DISJOINT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ConceptMapEquivalenceEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUIVALENT: + tgt.setValue(Enumerations.ConceptMapEquivalence.EQUIVALENT); + break; + case EQUAL: + tgt.setValue(Enumerations.ConceptMapEquivalence.EQUAL); + break; + case WIDER: + tgt.setValue(Enumerations.ConceptMapEquivalence.WIDER); + break; + case SUBSUMES: + tgt.setValue(Enumerations.ConceptMapEquivalence.SUBSUMES); + break; + case NARROWER: + tgt.setValue(Enumerations.ConceptMapEquivalence.NARROWER); + break; + case SPECIALIZES: + tgt.setValue(Enumerations.ConceptMapEquivalence.SPECIALIZES); + break; + case INEXACT: + tgt.setValue(Enumerations.ConceptMapEquivalence.INEXACT); + break; + case UNMATCHED: + tgt.setValue(Enumerations.ConceptMapEquivalence.UNMATCHED); + break; + case DISJOINT: + tgt.setValue(Enumerations.ConceptMapEquivalence.DISJOINT); + break; + default: + tgt.setValue(Enumerations.ConceptMapEquivalence.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertConceptMapEquivalence(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalenceEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case EQUIVALENT: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.EQUIVALENT); - break; - case EQUAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.EQUAL); - break; - case WIDER: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.WIDER); - break; - case SUBSUMES: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.SUBSUMES); - break; - case NARROWER: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.NARROWER); - break; - case SPECIALIZES: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.SPECIALIZES); - break; - case INEXACT: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.INEXACT); - break; - case UNMATCHED: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.UNMATCHED); - break; - case DISJOINT: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.DISJOINT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalenceEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUIVALENT: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.EQUIVALENT); + break; + case EQUAL: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.EQUAL); + break; + case WIDER: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.WIDER); + break; + case SUBSUMES: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.SUBSUMES); + break; + case NARROWER: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.NARROWER); + break; + case SPECIALIZES: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.SPECIALIZES); + break; + case INEXACT: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.INEXACT); + break; + case UNMATCHED: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.UNMATCHED); + break; + case DISJOINT: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.DISJOINT); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent convertOtherElementComponent(org.hl7.fhir.dstu2.model.ConceptMap.OtherElementComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Condition10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Condition10_30.java index c705d77587..8718cc1fb7 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Condition10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Condition10_30.java @@ -4,6 +4,8 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.CodeableConcept10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Identifier10_30; +import org.hl7.fhir.dstu2.model.Condition; +import org.hl7.fhir.dstu2.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; public class Condition10_30 { @@ -134,64 +136,72 @@ public static org.hl7.fhir.dstu2.model.Condition.ConditionStageComponent convert } static public org.hl7.fhir.dstu2.model.Enumeration convertConditionVerificationStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Condition.ConditionVerificationStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case PROVISIONAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Condition.ConditionVerificationStatus.PROVISIONAL); - break; - case DIFFERENTIAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Condition.ConditionVerificationStatus.DIFFERENTIAL); - break; - case CONFIRMED: - tgt.setValue(org.hl7.fhir.dstu2.model.Condition.ConditionVerificationStatus.CONFIRMED); - break; - case REFUTED: - tgt.setValue(org.hl7.fhir.dstu2.model.Condition.ConditionVerificationStatus.REFUTED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.Condition.ConditionVerificationStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu2.model.Condition.ConditionVerificationStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Condition.ConditionVerificationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Condition.ConditionVerificationStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROVISIONAL: + tgt.setValue(Condition.ConditionVerificationStatus.PROVISIONAL); + break; + case DIFFERENTIAL: + tgt.setValue(Condition.ConditionVerificationStatus.DIFFERENTIAL); + break; + case CONFIRMED: + tgt.setValue(Condition.ConditionVerificationStatus.CONFIRMED); + break; + case REFUTED: + tgt.setValue(Condition.ConditionVerificationStatus.REFUTED); + break; + case ENTEREDINERROR: + tgt.setValue(Condition.ConditionVerificationStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Condition.ConditionVerificationStatus.UNKNOWN); + break; + default: + tgt.setValue(Condition.ConditionVerificationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertConditionVerificationStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Condition.ConditionVerificationStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case PROVISIONAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Condition.ConditionVerificationStatus.PROVISIONAL); - break; - case DIFFERENTIAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Condition.ConditionVerificationStatus.DIFFERENTIAL); - break; - case CONFIRMED: - tgt.setValue(org.hl7.fhir.dstu3.model.Condition.ConditionVerificationStatus.CONFIRMED); - break; - case REFUTED: - tgt.setValue(org.hl7.fhir.dstu3.model.Condition.ConditionVerificationStatus.REFUTED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Condition.ConditionVerificationStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu3.model.Condition.ConditionVerificationStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Condition.ConditionVerificationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Condition.ConditionVerificationStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROVISIONAL: + tgt.setValue(org.hl7.fhir.dstu3.model.Condition.ConditionVerificationStatus.PROVISIONAL); + break; + case DIFFERENTIAL: + tgt.setValue(org.hl7.fhir.dstu3.model.Condition.ConditionVerificationStatus.DIFFERENTIAL); + break; + case CONFIRMED: + tgt.setValue(org.hl7.fhir.dstu3.model.Condition.ConditionVerificationStatus.CONFIRMED); + break; + case REFUTED: + tgt.setValue(org.hl7.fhir.dstu3.model.Condition.ConditionVerificationStatus.REFUTED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu3.model.Condition.ConditionVerificationStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.dstu3.model.Condition.ConditionVerificationStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Condition.ConditionVerificationStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Conformance10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Conformance10_30.java index e7c1301c7a..018b887feb 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Conformance10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Conformance10_30.java @@ -13,53 +13,64 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.UnsignedInt10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Uri10_30; +import org.hl7.fhir.dstu2.model.Conformance; +import org.hl7.fhir.dstu2.model.Enumeration; +import org.hl7.fhir.dstu3.model.CapabilityStatement; import org.hl7.fhir.dstu3.model.CapabilityStatement.SystemRestfulInteraction; import org.hl7.fhir.exceptions.FHIRException; public class Conformance10_30 { static public org.hl7.fhir.dstu2.model.Enumeration convertConditionalDeleteStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Conformance.ConditionalDeleteStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ConditionalDeleteStatus.NOTSUPPORTED); - break; - case SINGLE: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ConditionalDeleteStatus.SINGLE); - break; - case MULTIPLE: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ConditionalDeleteStatus.MULTIPLE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ConditionalDeleteStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Conformance.ConditionalDeleteStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTSUPPORTED: + tgt.setValue(Conformance.ConditionalDeleteStatus.NOTSUPPORTED); + break; + case SINGLE: + tgt.setValue(Conformance.ConditionalDeleteStatus.SINGLE); + break; + case MULTIPLE: + tgt.setValue(Conformance.ConditionalDeleteStatus.MULTIPLE); + break; + default: + tgt.setValue(Conformance.ConditionalDeleteStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertConditionalDeleteStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalDeleteStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalDeleteStatus.NOTSUPPORTED); - break; - case SINGLE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalDeleteStatus.SINGLE); - break; - case MULTIPLE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalDeleteStatus.MULTIPLE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalDeleteStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new CapabilityStatement.ConditionalDeleteStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTSUPPORTED: + tgt.setValue(CapabilityStatement.ConditionalDeleteStatus.NOTSUPPORTED); + break; + case SINGLE: + tgt.setValue(CapabilityStatement.ConditionalDeleteStatus.SINGLE); + break; + case MULTIPLE: + tgt.setValue(CapabilityStatement.ConditionalDeleteStatus.MULTIPLE); + break; + default: + tgt.setValue(CapabilityStatement.ConditionalDeleteStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2.model.Conformance convertConformance(org.hl7.fhir.dstu3.model.CapabilityStatement src) throws FHIRException { @@ -211,41 +222,49 @@ public static org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementDo } static public org.hl7.fhir.dstu2.model.Enumeration convertConformanceEventMode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Conformance.ConformanceEventModeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case SENDER: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ConformanceEventMode.SENDER); - break; - case RECEIVER: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ConformanceEventMode.RECEIVER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ConformanceEventMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Conformance.ConformanceEventModeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SENDER: + tgt.setValue(Conformance.ConformanceEventMode.SENDER); + break; + case RECEIVER: + tgt.setValue(Conformance.ConformanceEventMode.RECEIVER); + break; + default: + tgt.setValue(Conformance.ConformanceEventMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertConformanceEventMode(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.EventCapabilityModeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case SENDER: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.EventCapabilityMode.SENDER); - break; - case RECEIVER: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.EventCapabilityMode.RECEIVER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.EventCapabilityMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new CapabilityStatement.EventCapabilityModeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SENDER: + tgt.setValue(CapabilityStatement.EventCapabilityMode.SENDER); + break; + case RECEIVER: + tgt.setValue(CapabilityStatement.EventCapabilityMode.RECEIVER); + break; + default: + tgt.setValue(CapabilityStatement.EventCapabilityMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2.model.Conformance.ConformanceImplementationComponent convertConformanceImplementationComponent(org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementImplementationComponent src) throws FHIRException { @@ -633,129 +652,153 @@ public static org.hl7.fhir.dstu2.model.Conformance.ConformanceSoftwareComponent } static public org.hl7.fhir.dstu3.model.Enumeration convertConformanceStatementKind(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementKindEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementKind.INSTANCE); - break; - case CAPABILITY: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementKind.CAPABILITY); - break; - case REQUIREMENTS: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementKind.REQUIREMENTS); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new CapabilityStatement.CapabilityStatementKindEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(CapabilityStatement.CapabilityStatementKind.INSTANCE); + break; + case CAPABILITY: + tgt.setValue(CapabilityStatement.CapabilityStatementKind.CAPABILITY); + break; + case REQUIREMENTS: + tgt.setValue(CapabilityStatement.CapabilityStatementKind.REQUIREMENTS); + break; + default: + tgt.setValue(CapabilityStatement.CapabilityStatementKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertConformanceStatementKind(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Conformance.ConformanceStatementKindEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ConformanceStatementKind.INSTANCE); - break; - case CAPABILITY: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ConformanceStatementKind.CAPABILITY); - break; - case REQUIREMENTS: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ConformanceStatementKind.REQUIREMENTS); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ConformanceStatementKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Conformance.ConformanceStatementKindEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(Conformance.ConformanceStatementKind.INSTANCE); + break; + case CAPABILITY: + tgt.setValue(Conformance.ConformanceStatementKind.CAPABILITY); + break; + case REQUIREMENTS: + tgt.setValue(Conformance.ConformanceStatementKind.REQUIREMENTS); + break; + default: + tgt.setValue(Conformance.ConformanceStatementKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertDocumentMode(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.DocumentModeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case PRODUCER: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.DocumentMode.PRODUCER); - break; - case CONSUMER: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.DocumentMode.CONSUMER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.DocumentMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new CapabilityStatement.DocumentModeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRODUCER: + tgt.setValue(CapabilityStatement.DocumentMode.PRODUCER); + break; + case CONSUMER: + tgt.setValue(CapabilityStatement.DocumentMode.CONSUMER); + break; + default: + tgt.setValue(CapabilityStatement.DocumentMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertDocumentMode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Conformance.DocumentModeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case PRODUCER: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.DocumentMode.PRODUCER); - break; - case CONSUMER: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.DocumentMode.CONSUMER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.DocumentMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Conformance.DocumentModeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRODUCER: + tgt.setValue(Conformance.DocumentMode.PRODUCER); + break; + case CONSUMER: + tgt.setValue(Conformance.DocumentMode.CONSUMER); + break; + default: + tgt.setValue(Conformance.DocumentMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertMessageSignificanceCategory(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.MessageSignificanceCategoryEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case CONSEQUENCE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.MessageSignificanceCategory.CONSEQUENCE); - break; - case CURRENCY: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.MessageSignificanceCategory.CURRENCY); - break; - case NOTIFICATION: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.MessageSignificanceCategory.NOTIFICATION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.MessageSignificanceCategory.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new CapabilityStatement.MessageSignificanceCategoryEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CONSEQUENCE: + tgt.setValue(CapabilityStatement.MessageSignificanceCategory.CONSEQUENCE); + break; + case CURRENCY: + tgt.setValue(CapabilityStatement.MessageSignificanceCategory.CURRENCY); + break; + case NOTIFICATION: + tgt.setValue(CapabilityStatement.MessageSignificanceCategory.NOTIFICATION); + break; + default: + tgt.setValue(CapabilityStatement.MessageSignificanceCategory.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertMessageSignificanceCategory(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Conformance.MessageSignificanceCategoryEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case CONSEQUENCE: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.MessageSignificanceCategory.CONSEQUENCE); - break; - case CURRENCY: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.MessageSignificanceCategory.CURRENCY); - break; - case NOTIFICATION: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.MessageSignificanceCategory.NOTIFICATION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.MessageSignificanceCategory.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Conformance.MessageSignificanceCategoryEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CONSEQUENCE: + tgt.setValue(Conformance.MessageSignificanceCategory.CONSEQUENCE); + break; + case CURRENCY: + tgt.setValue(Conformance.MessageSignificanceCategory.CURRENCY); + break; + case NOTIFICATION: + tgt.setValue(Conformance.MessageSignificanceCategory.NOTIFICATION); + break; + default: + tgt.setValue(Conformance.MessageSignificanceCategory.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceInteractionComponent convertResourceInteractionComponent(org.hl7.fhir.dstu2.model.Conformance.ResourceInteractionComponent src) throws FHIRException { @@ -783,85 +826,101 @@ public static org.hl7.fhir.dstu2.model.Conformance.ResourceInteractionComponent } static public org.hl7.fhir.dstu2.model.Enumeration convertResourceVersionPolicy(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Conformance.ResourceVersionPolicyEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case NOVERSION: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ResourceVersionPolicy.NOVERSION); - break; - case VERSIONED: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ResourceVersionPolicy.VERSIONED); - break; - case VERSIONEDUPDATE: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ResourceVersionPolicy.VERSIONEDUPDATE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ResourceVersionPolicy.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Conformance.ResourceVersionPolicyEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOVERSION: + tgt.setValue(Conformance.ResourceVersionPolicy.NOVERSION); + break; + case VERSIONED: + tgt.setValue(Conformance.ResourceVersionPolicy.VERSIONED); + break; + case VERSIONEDUPDATE: + tgt.setValue(Conformance.ResourceVersionPolicy.VERSIONEDUPDATE); + break; + default: + tgt.setValue(Conformance.ResourceVersionPolicy.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertResourceVersionPolicy(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceVersionPolicyEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case NOVERSION: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceVersionPolicy.NOVERSION); - break; - case VERSIONED: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceVersionPolicy.VERSIONED); - break; - case VERSIONEDUPDATE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceVersionPolicy.VERSIONEDUPDATE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceVersionPolicy.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new CapabilityStatement.ResourceVersionPolicyEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOVERSION: + tgt.setValue(CapabilityStatement.ResourceVersionPolicy.NOVERSION); + break; + case VERSIONED: + tgt.setValue(CapabilityStatement.ResourceVersionPolicy.VERSIONED); + break; + case VERSIONEDUPDATE: + tgt.setValue(CapabilityStatement.ResourceVersionPolicy.VERSIONEDUPDATE); + break; + default: + tgt.setValue(CapabilityStatement.ResourceVersionPolicy.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertRestfulConformanceMode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Conformance.RestfulConformanceModeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case CLIENT: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.RestfulConformanceMode.CLIENT); - break; - case SERVER: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.RestfulConformanceMode.SERVER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.RestfulConformanceMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Conformance.RestfulConformanceModeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CLIENT: + tgt.setValue(Conformance.RestfulConformanceMode.CLIENT); + break; + case SERVER: + tgt.setValue(Conformance.RestfulConformanceMode.SERVER); + break; + default: + tgt.setValue(Conformance.RestfulConformanceMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertRestfulConformanceMode(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.RestfulCapabilityModeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case CLIENT: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.RestfulCapabilityMode.CLIENT); - break; - case SERVER: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.RestfulCapabilityMode.SERVER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.RestfulCapabilityMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new CapabilityStatement.RestfulCapabilityModeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CLIENT: + tgt.setValue(CapabilityStatement.RestfulCapabilityMode.CLIENT); + break; + case SERVER: + tgt.setValue(CapabilityStatement.RestfulCapabilityMode.SERVER); + break; + default: + tgt.setValue(CapabilityStatement.RestfulCapabilityMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2.model.Conformance.SystemInteractionComponent convertSystemInteractionComponent(org.hl7.fhir.dstu3.model.CapabilityStatement.SystemInteractionComponent src) throws FHIRException { @@ -889,170 +948,194 @@ public static org.hl7.fhir.dstu3.model.CapabilityStatement.SystemInteractionComp } static public org.hl7.fhir.dstu3.model.Enumeration convertSystemRestfulInteraction(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.SystemRestfulInteractionEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case TRANSACTION: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.SystemRestfulInteraction.TRANSACTION); - break; - case SEARCHSYSTEM: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.SystemRestfulInteraction.SEARCHSYSTEM); - break; - case HISTORYSYSTEM: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.SystemRestfulInteraction.HISTORYSYSTEM); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.SystemRestfulInteraction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new CapabilityStatement.SystemRestfulInteractionEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case TRANSACTION: + tgt.setValue(SystemRestfulInteraction.TRANSACTION); + break; + case SEARCHSYSTEM: + tgt.setValue(SystemRestfulInteraction.SEARCHSYSTEM); + break; + case HISTORYSYSTEM: + tgt.setValue(SystemRestfulInteraction.HISTORYSYSTEM); + break; + default: + tgt.setValue(SystemRestfulInteraction.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertSystemRestfulInteraction(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Conformance.SystemRestfulInteractionEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case TRANSACTION: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.SystemRestfulInteraction.TRANSACTION); - break; - case SEARCHSYSTEM: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.SystemRestfulInteraction.SEARCHSYSTEM); - break; - case HISTORYSYSTEM: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.SystemRestfulInteraction.HISTORYSYSTEM); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.SystemRestfulInteraction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Conformance.SystemRestfulInteractionEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case TRANSACTION: + tgt.setValue(Conformance.SystemRestfulInteraction.TRANSACTION); + break; + case SEARCHSYSTEM: + tgt.setValue(Conformance.SystemRestfulInteraction.SEARCHSYSTEM); + break; + case HISTORYSYSTEM: + tgt.setValue(Conformance.SystemRestfulInteraction.HISTORYSYSTEM); + break; + default: + tgt.setValue(Conformance.SystemRestfulInteraction.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertTypeRestfulInteraction(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteractionEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case READ: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.READ); - break; - case VREAD: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.VREAD); - break; - case UPDATE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.UPDATE); - break; - case DELETE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.DELETE); - break; - case HISTORYINSTANCE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.HISTORYINSTANCE); - break; - case HISTORYTYPE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.HISTORYTYPE); - break; - case CREATE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.CREATE); - break; - case SEARCHTYPE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.SEARCHTYPE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new CapabilityStatement.TypeRestfulInteractionEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case READ: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.READ); + break; + case VREAD: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.VREAD); + break; + case UPDATE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.UPDATE); + break; + case DELETE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.DELETE); + break; + case HISTORYINSTANCE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.HISTORYINSTANCE); + break; + case HISTORYTYPE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.HISTORYTYPE); + break; + case CREATE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.CREATE); + break; + case SEARCHTYPE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.SEARCHTYPE); + break; + default: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertTypeRestfulInteraction(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Conformance.TypeRestfulInteractionEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case READ: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.TypeRestfulInteraction.READ); - break; - case VREAD: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.TypeRestfulInteraction.VREAD); - break; - case UPDATE: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.TypeRestfulInteraction.UPDATE); - break; - case DELETE: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.TypeRestfulInteraction.DELETE); - break; - case HISTORYINSTANCE: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.TypeRestfulInteraction.HISTORYINSTANCE); - break; - case HISTORYTYPE: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.TypeRestfulInteraction.HISTORYTYPE); - break; - case CREATE: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.TypeRestfulInteraction.CREATE); - break; - case SEARCHTYPE: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.TypeRestfulInteraction.SEARCHTYPE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.TypeRestfulInteraction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Conformance.TypeRestfulInteractionEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case READ: + tgt.setValue(Conformance.TypeRestfulInteraction.READ); + break; + case VREAD: + tgt.setValue(Conformance.TypeRestfulInteraction.VREAD); + break; + case UPDATE: + tgt.setValue(Conformance.TypeRestfulInteraction.UPDATE); + break; + case DELETE: + tgt.setValue(Conformance.TypeRestfulInteraction.DELETE); + break; + case HISTORYINSTANCE: + tgt.setValue(Conformance.TypeRestfulInteraction.HISTORYINSTANCE); + break; + case HISTORYTYPE: + tgt.setValue(Conformance.TypeRestfulInteraction.HISTORYTYPE); + break; + case CREATE: + tgt.setValue(Conformance.TypeRestfulInteraction.CREATE); + break; + case SEARCHTYPE: + tgt.setValue(Conformance.TypeRestfulInteraction.SEARCHTYPE); + break; + default: + tgt.setValue(Conformance.TypeRestfulInteraction.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertUnknownContentCode(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.UnknownContentCodeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case NO: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.UnknownContentCode.NO); - break; - case EXTENSIONS: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.UnknownContentCode.EXTENSIONS); - break; - case ELEMENTS: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.UnknownContentCode.ELEMENTS); - break; - case BOTH: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.UnknownContentCode.BOTH); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.UnknownContentCode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new CapabilityStatement.UnknownContentCodeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NO: + tgt.setValue(CapabilityStatement.UnknownContentCode.NO); + break; + case EXTENSIONS: + tgt.setValue(CapabilityStatement.UnknownContentCode.EXTENSIONS); + break; + case ELEMENTS: + tgt.setValue(CapabilityStatement.UnknownContentCode.ELEMENTS); + break; + case BOTH: + tgt.setValue(CapabilityStatement.UnknownContentCode.BOTH); + break; + default: + tgt.setValue(CapabilityStatement.UnknownContentCode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertUnknownContentCode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Conformance.UnknownContentCodeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case NO: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.UnknownContentCode.NO); - break; - case EXTENSIONS: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.UnknownContentCode.EXTENSIONS); - break; - case ELEMENTS: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.UnknownContentCode.ELEMENTS); - break; - case BOTH: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.UnknownContentCode.BOTH); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.UnknownContentCode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Conformance.UnknownContentCodeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NO: + tgt.setValue(Conformance.UnknownContentCode.NO); + break; + case EXTENSIONS: + tgt.setValue(Conformance.UnknownContentCode.EXTENSIONS); + break; + case ELEMENTS: + tgt.setValue(Conformance.UnknownContentCode.ELEMENTS); + break; + case BOTH: + tgt.setValue(Conformance.UnknownContentCode.BOTH); + break; + default: + tgt.setValue(Conformance.UnknownContentCode.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/DataElement10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/DataElement10_30.java index 479b3dec5c..7ec44dd64a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/DataElement10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/DataElement10_30.java @@ -14,6 +14,8 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Id10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Uri10_30; +import org.hl7.fhir.dstu2.model.DataElement; +import org.hl7.fhir.dstu2.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; public class DataElement10_30 { @@ -157,64 +159,72 @@ public static org.hl7.fhir.dstu2.model.DataElement.DataElementMappingComponent c } static public org.hl7.fhir.dstu2.model.Enumeration convertDataElementStringency(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DataElement.DataElementStringencyEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case COMPARABLE: - tgt.setValue(org.hl7.fhir.dstu2.model.DataElement.DataElementStringency.COMPARABLE); - break; - case FULLYSPECIFIED: - tgt.setValue(org.hl7.fhir.dstu2.model.DataElement.DataElementStringency.FULLYSPECIFIED); - break; - case EQUIVALENT: - tgt.setValue(org.hl7.fhir.dstu2.model.DataElement.DataElementStringency.EQUIVALENT); - break; - case CONVERTABLE: - tgt.setValue(org.hl7.fhir.dstu2.model.DataElement.DataElementStringency.CONVERTABLE); - break; - case SCALEABLE: - tgt.setValue(org.hl7.fhir.dstu2.model.DataElement.DataElementStringency.SCALEABLE); - break; - case FLEXIBLE: - tgt.setValue(org.hl7.fhir.dstu2.model.DataElement.DataElementStringency.FLEXIBLE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.DataElement.DataElementStringency.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DataElement.DataElementStringencyEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case COMPARABLE: + tgt.setValue(DataElement.DataElementStringency.COMPARABLE); + break; + case FULLYSPECIFIED: + tgt.setValue(DataElement.DataElementStringency.FULLYSPECIFIED); + break; + case EQUIVALENT: + tgt.setValue(DataElement.DataElementStringency.EQUIVALENT); + break; + case CONVERTABLE: + tgt.setValue(DataElement.DataElementStringency.CONVERTABLE); + break; + case SCALEABLE: + tgt.setValue(DataElement.DataElementStringency.SCALEABLE); + break; + case FLEXIBLE: + tgt.setValue(DataElement.DataElementStringency.FLEXIBLE); + break; + default: + tgt.setValue(DataElement.DataElementStringency.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertDataElementStringency(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DataElement.DataElementStringencyEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case COMPARABLE: - tgt.setValue(org.hl7.fhir.dstu3.model.DataElement.DataElementStringency.COMPARABLE); - break; - case FULLYSPECIFIED: - tgt.setValue(org.hl7.fhir.dstu3.model.DataElement.DataElementStringency.FULLYSPECIFIED); - break; - case EQUIVALENT: - tgt.setValue(org.hl7.fhir.dstu3.model.DataElement.DataElementStringency.EQUIVALENT); - break; - case CONVERTABLE: - tgt.setValue(org.hl7.fhir.dstu3.model.DataElement.DataElementStringency.CONVERTABLE); - break; - case SCALEABLE: - tgt.setValue(org.hl7.fhir.dstu3.model.DataElement.DataElementStringency.SCALEABLE); - break; - case FLEXIBLE: - tgt.setValue(org.hl7.fhir.dstu3.model.DataElement.DataElementStringency.FLEXIBLE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.DataElement.DataElementStringency.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DataElement.DataElementStringencyEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case COMPARABLE: + tgt.setValue(org.hl7.fhir.dstu3.model.DataElement.DataElementStringency.COMPARABLE); + break; + case FULLYSPECIFIED: + tgt.setValue(org.hl7.fhir.dstu3.model.DataElement.DataElementStringency.FULLYSPECIFIED); + break; + case EQUIVALENT: + tgt.setValue(org.hl7.fhir.dstu3.model.DataElement.DataElementStringency.EQUIVALENT); + break; + case CONVERTABLE: + tgt.setValue(org.hl7.fhir.dstu3.model.DataElement.DataElementStringency.CONVERTABLE); + break; + case SCALEABLE: + tgt.setValue(org.hl7.fhir.dstu3.model.DataElement.DataElementStringency.SCALEABLE); + break; + case FLEXIBLE: + tgt.setValue(org.hl7.fhir.dstu3.model.DataElement.DataElementStringency.FLEXIBLE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.DataElement.DataElementStringency.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/DetectedIssue10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/DetectedIssue10_30.java index 8606560ecf..6c19acbdc0 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/DetectedIssue10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/DetectedIssue10_30.java @@ -7,6 +7,8 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.DateTime10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Uri10_30; +import org.hl7.fhir.dstu3.model.DetectedIssue; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; public class DetectedIssue10_30 { @@ -96,46 +98,54 @@ public static org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueMitigationComp } static public org.hl7.fhir.dstu3.model.Enumeration convertDetectedIssueSeverity(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueSeverityEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case HIGH: - tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueSeverity.HIGH); - break; - case MODERATE: - tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueSeverity.MODERATE); - break; - case LOW: - tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueSeverity.LOW); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueSeverity.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DetectedIssue.DetectedIssueSeverityEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case HIGH: + tgt.setValue(DetectedIssue.DetectedIssueSeverity.HIGH); + break; + case MODERATE: + tgt.setValue(DetectedIssue.DetectedIssueSeverity.MODERATE); + break; + case LOW: + tgt.setValue(DetectedIssue.DetectedIssueSeverity.LOW); + break; + default: + tgt.setValue(DetectedIssue.DetectedIssueSeverity.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertDetectedIssueSeverity(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueSeverityEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case HIGH: - tgt.setValue(org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueSeverity.HIGH); - break; - case MODERATE: - tgt.setValue(org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueSeverity.MODERATE); - break; - case LOW: - tgt.setValue(org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueSeverity.LOW); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueSeverity.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueSeverityEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case HIGH: + tgt.setValue(org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueSeverity.HIGH); + break; + case MODERATE: + tgt.setValue(org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueSeverity.MODERATE); + break; + case LOW: + tgt.setValue(org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueSeverity.LOW); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueSeverity.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Device10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Device10_30.java index 5e40f2fce9..3e50ceed29 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Device10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Device10_30.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.DateTime10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Uri10_30; +import org.hl7.fhir.dstu3.model.Device; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; public class Device10_30 { @@ -92,46 +94,54 @@ public static org.hl7.fhir.dstu3.model.Device convertDevice(org.hl7.fhir.dstu2.m } static public org.hl7.fhir.dstu3.model.Enumeration convertDeviceStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Device.FHIRDeviceStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case AVAILABLE: - tgt.setValue(org.hl7.fhir.dstu3.model.Device.FHIRDeviceStatus.ACTIVE); - break; - case NOTAVAILABLE: - tgt.setValue(org.hl7.fhir.dstu3.model.Device.FHIRDeviceStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Device.FHIRDeviceStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Device.FHIRDeviceStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Device.FHIRDeviceStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case AVAILABLE: + tgt.setValue(Device.FHIRDeviceStatus.ACTIVE); + break; + case NOTAVAILABLE: + tgt.setValue(Device.FHIRDeviceStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(Device.FHIRDeviceStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Device.FHIRDeviceStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertDeviceStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Device.DeviceStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.Device.DeviceStatus.AVAILABLE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.Device.DeviceStatus.NOTAVAILABLE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.Device.DeviceStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Device.DeviceStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Device.DeviceStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu2.model.Device.DeviceStatus.AVAILABLE); + break; + case INACTIVE: + tgt.setValue(org.hl7.fhir.dstu2.model.Device.DeviceStatus.NOTAVAILABLE); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu2.model.Device.DeviceStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Device.DeviceStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/DeviceComponent10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/DeviceComponent10_30.java index e4581ba03d..12afc15a38 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/DeviceComponent10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/DeviceComponent10_30.java @@ -6,6 +6,8 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Identifier10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Instant10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; +import org.hl7.fhir.dstu3.model.DeviceComponent; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; public class DeviceComponent10_30 { @@ -95,94 +97,102 @@ public static org.hl7.fhir.dstu2.model.DeviceComponent.DeviceComponentProduction } static public org.hl7.fhir.dstu3.model.Enumeration convertMeasmntPrinciple(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrincipleEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case OTHER: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple.OTHER); - break; - case CHEMICAL: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple.CHEMICAL); - break; - case ELECTRICAL: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple.ELECTRICAL); - break; - case IMPEDANCE: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple.IMPEDANCE); - break; - case NUCLEAR: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple.NUCLEAR); - break; - case OPTICAL: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple.OPTICAL); - break; - case THERMAL: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple.THERMAL); - break; - case BIOLOGICAL: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple.BIOLOGICAL); - break; - case MECHANICAL: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple.MECHANICAL); - break; - case ACOUSTICAL: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple.ACOUSTICAL); - break; - case MANUAL: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple.MANUAL); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DeviceComponent.MeasmntPrincipleEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OTHER: + tgt.setValue(DeviceComponent.MeasmntPrinciple.OTHER); + break; + case CHEMICAL: + tgt.setValue(DeviceComponent.MeasmntPrinciple.CHEMICAL); + break; + case ELECTRICAL: + tgt.setValue(DeviceComponent.MeasmntPrinciple.ELECTRICAL); + break; + case IMPEDANCE: + tgt.setValue(DeviceComponent.MeasmntPrinciple.IMPEDANCE); + break; + case NUCLEAR: + tgt.setValue(DeviceComponent.MeasmntPrinciple.NUCLEAR); + break; + case OPTICAL: + tgt.setValue(DeviceComponent.MeasmntPrinciple.OPTICAL); + break; + case THERMAL: + tgt.setValue(DeviceComponent.MeasmntPrinciple.THERMAL); + break; + case BIOLOGICAL: + tgt.setValue(DeviceComponent.MeasmntPrinciple.BIOLOGICAL); + break; + case MECHANICAL: + tgt.setValue(DeviceComponent.MeasmntPrinciple.MECHANICAL); + break; + case ACOUSTICAL: + tgt.setValue(DeviceComponent.MeasmntPrinciple.ACOUSTICAL); + break; + case MANUAL: + tgt.setValue(DeviceComponent.MeasmntPrinciple.MANUAL); + break; + default: + tgt.setValue(DeviceComponent.MeasmntPrinciple.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertMeasmntPrinciple(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrincipleEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case OTHER: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.OTHER); - break; - case CHEMICAL: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.CHEMICAL); - break; - case ELECTRICAL: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.ELECTRICAL); - break; - case IMPEDANCE: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.IMPEDANCE); - break; - case NUCLEAR: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.NUCLEAR); - break; - case OPTICAL: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.OPTICAL); - break; - case THERMAL: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.THERMAL); - break; - case BIOLOGICAL: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.BIOLOGICAL); - break; - case MECHANICAL: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.MECHANICAL); - break; - case ACOUSTICAL: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.ACOUSTICAL); - break; - case MANUAL: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.MANUAL); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrincipleEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OTHER: + tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.OTHER); + break; + case CHEMICAL: + tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.CHEMICAL); + break; + case ELECTRICAL: + tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.ELECTRICAL); + break; + case IMPEDANCE: + tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.IMPEDANCE); + break; + case NUCLEAR: + tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.NUCLEAR); + break; + case OPTICAL: + tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.OPTICAL); + break; + case THERMAL: + tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.THERMAL); + break; + case BIOLOGICAL: + tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.BIOLOGICAL); + break; + case MECHANICAL: + tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.MECHANICAL); + break; + case ACOUSTICAL: + tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.ACOUSTICAL); + break; + case MANUAL: + tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.MANUAL); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/DeviceMetric10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/DeviceMetric10_30.java index cc076fe6ee..6f64a6c85f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/DeviceMetric10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/DeviceMetric10_30.java @@ -6,6 +6,8 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Identifier10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Timing10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Instant10_30; +import org.hl7.fhir.dstu2.model.DeviceMetric; +import org.hl7.fhir.dstu2.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; public class DeviceMetric10_30 { @@ -95,270 +97,310 @@ public static org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationCompo } static public org.hl7.fhir.dstu2.model.Enumeration convertDeviceMetricCalibrationState(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationStateEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case NOTCALIBRATED: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState.NOTCALIBRATED); - break; - case CALIBRATIONREQUIRED: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATIONREQUIRED); - break; - case CALIBRATED: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATED); - break; - case UNSPECIFIED: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState.UNSPECIFIED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DeviceMetric.DeviceMetricCalibrationStateEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTCALIBRATED: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationState.NOTCALIBRATED); + break; + case CALIBRATIONREQUIRED: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationState.CALIBRATIONREQUIRED); + break; + case CALIBRATED: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationState.CALIBRATED); + break; + case UNSPECIFIED: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationState.UNSPECIFIED); + break; + default: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationState.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertDeviceMetricCalibrationState(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationStateEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case NOTCALIBRATED: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationState.NOTCALIBRATED); - break; - case CALIBRATIONREQUIRED: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATIONREQUIRED); - break; - case CALIBRATED: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATED); - break; - case UNSPECIFIED: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationState.UNSPECIFIED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationState.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationStateEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTCALIBRATED: + tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationState.NOTCALIBRATED); + break; + case CALIBRATIONREQUIRED: + tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATIONREQUIRED); + break; + case CALIBRATED: + tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATED); + break; + case UNSPECIFIED: + tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationState.UNSPECIFIED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationState.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertDeviceMetricCalibrationType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationTypeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case UNSPECIFIED: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationType.UNSPECIFIED); - break; - case OFFSET: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationType.OFFSET); - break; - case GAIN: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationType.GAIN); - break; - case TWOPOINT: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationType.TWOPOINT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationTypeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case UNSPECIFIED: + tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationType.UNSPECIFIED); + break; + case OFFSET: + tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationType.OFFSET); + break; + case GAIN: + tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationType.GAIN); + break; + case TWOPOINT: + tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationType.TWOPOINT); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertDeviceMetricCalibrationType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationTypeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case UNSPECIFIED: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType.UNSPECIFIED); - break; - case OFFSET: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType.OFFSET); - break; - case GAIN: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType.GAIN); - break; - case TWOPOINT: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType.TWOPOINT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DeviceMetric.DeviceMetricCalibrationTypeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case UNSPECIFIED: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationType.UNSPECIFIED); + break; + case OFFSET: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationType.OFFSET); + break; + case GAIN: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationType.GAIN); + break; + case TWOPOINT: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationType.TWOPOINT); + break; + default: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertDeviceMetricCategory(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCategoryEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case MEASUREMENT: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCategory.MEASUREMENT); - break; - case SETTING: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCategory.SETTING); - break; - case CALCULATION: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCategory.CALCULATION); - break; - case UNSPECIFIED: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCategory.UNSPECIFIED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCategory.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCategoryEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MEASUREMENT: + tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCategory.MEASUREMENT); + break; + case SETTING: + tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCategory.SETTING); + break; + case CALCULATION: + tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCategory.CALCULATION); + break; + case UNSPECIFIED: + tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCategory.UNSPECIFIED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCategory.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertDeviceMetricCategory(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategoryEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case MEASUREMENT: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory.MEASUREMENT); - break; - case SETTING: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory.SETTING); - break; - case CALCULATION: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory.CALCULATION); - break; - case UNSPECIFIED: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory.UNSPECIFIED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DeviceMetric.DeviceMetricCategoryEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MEASUREMENT: + tgt.setValue(DeviceMetric.DeviceMetricCategory.MEASUREMENT); + break; + case SETTING: + tgt.setValue(DeviceMetric.DeviceMetricCategory.SETTING); + break; + case CALCULATION: + tgt.setValue(DeviceMetric.DeviceMetricCategory.CALCULATION); + break; + case UNSPECIFIED: + tgt.setValue(DeviceMetric.DeviceMetricCategory.UNSPECIFIED); + break; + default: + tgt.setValue(DeviceMetric.DeviceMetricCategory.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertDeviceMetricColor(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColorEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case BLACK: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.BLACK); - break; - case RED: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.RED); - break; - case GREEN: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.GREEN); - break; - case YELLOW: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.YELLOW); - break; - case BLUE: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.BLUE); - break; - case MAGENTA: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.MAGENTA); - break; - case CYAN: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.CYAN); - break; - case WHITE: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.WHITE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DeviceMetric.DeviceMetricColorEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case BLACK: + tgt.setValue(DeviceMetric.DeviceMetricColor.BLACK); + break; + case RED: + tgt.setValue(DeviceMetric.DeviceMetricColor.RED); + break; + case GREEN: + tgt.setValue(DeviceMetric.DeviceMetricColor.GREEN); + break; + case YELLOW: + tgt.setValue(DeviceMetric.DeviceMetricColor.YELLOW); + break; + case BLUE: + tgt.setValue(DeviceMetric.DeviceMetricColor.BLUE); + break; + case MAGENTA: + tgt.setValue(DeviceMetric.DeviceMetricColor.MAGENTA); + break; + case CYAN: + tgt.setValue(DeviceMetric.DeviceMetricColor.CYAN); + break; + case WHITE: + tgt.setValue(DeviceMetric.DeviceMetricColor.WHITE); + break; + default: + tgt.setValue(DeviceMetric.DeviceMetricColor.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertDeviceMetricColor(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColorEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case BLACK: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.BLACK); - break; - case RED: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.RED); - break; - case GREEN: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.GREEN); - break; - case YELLOW: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.YELLOW); - break; - case BLUE: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.BLUE); - break; - case MAGENTA: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.MAGENTA); - break; - case CYAN: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.CYAN); - break; - case WHITE: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.WHITE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColorEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case BLACK: + tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.BLACK); + break; + case RED: + tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.RED); + break; + case GREEN: + tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.GREEN); + break; + case YELLOW: + tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.YELLOW); + break; + case BLUE: + tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.BLUE); + break; + case MAGENTA: + tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.MAGENTA); + break; + case CYAN: + tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.CYAN); + break; + case WHITE: + tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.WHITE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertDeviceMetricOperationalStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case ON: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatus.ON); - break; - case OFF: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatus.OFF); - break; - case STANDBY: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatus.STANDBY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DeviceMetric.DeviceMetricOperationalStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ON: + tgt.setValue(DeviceMetric.DeviceMetricOperationalStatus.ON); + break; + case OFF: + tgt.setValue(DeviceMetric.DeviceMetricOperationalStatus.OFF); + break; + case STANDBY: + tgt.setValue(DeviceMetric.DeviceMetricOperationalStatus.STANDBY); + break; + default: + tgt.setValue(DeviceMetric.DeviceMetricOperationalStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertDeviceMetricOperationalStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricOperationalStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case ON: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricOperationalStatus.ON); - break; - case OFF: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricOperationalStatus.OFF); - break; - case STANDBY: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricOperationalStatus.STANDBY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricOperationalStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricOperationalStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ON: + tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricOperationalStatus.ON); + break; + case OFF: + tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricOperationalStatus.OFF); + break; + case STANDBY: + tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricOperationalStatus.STANDBY); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricOperationalStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/DiagnosticReport10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/DiagnosticReport10_30.java index e68c7b8f83..bcb2ebba47 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/DiagnosticReport10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/DiagnosticReport10_30.java @@ -7,6 +7,8 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Identifier10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Instant10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; +import org.hl7.fhir.dstu3.model.DiagnosticReport; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; public class DiagnosticReport10_30 { @@ -110,70 +112,78 @@ public static org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportImageCom } static public org.hl7.fhir.dstu3.model.Enumeration convertDiagnosticReportStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.REGISTERED); - break; - case PARTIAL: - tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.PARTIAL); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.FINAL); - break; - case CORRECTED: - tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.CORRECTED); - break; - case APPENDED: - tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.APPENDED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DiagnosticReport.DiagnosticReportStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.REGISTERED); + break; + case PARTIAL: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.PARTIAL); + break; + case FINAL: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.FINAL); + break; + case CORRECTED: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.CORRECTED); + break; + case APPENDED: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.APPENDED); + break; + case CANCELLED: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertDiagnosticReportStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.REGISTERED); - break; - case PARTIAL: - tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.PARTIAL); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.FINAL); - break; - case CORRECTED: - tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.CORRECTED); - break; - case APPENDED: - tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.APPENDED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.REGISTERED); + break; + case PARTIAL: + tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.PARTIAL); + break; + case FINAL: + tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.FINAL); + break; + case CORRECTED: + tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.CORRECTED); + break; + case APPENDED: + tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.APPENDED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/DocumentReference10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/DocumentReference10_30.java index 39f3e0303f..1ff7a8e93f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/DocumentReference10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/DocumentReference10_30.java @@ -11,7 +11,10 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Instant10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; import org.hl7.fhir.dstu2.model.CodeableConcept; +import org.hl7.fhir.dstu2.model.DocumentReference; +import org.hl7.fhir.dstu2.model.Enumeration; import org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatus; +import org.hl7.fhir.dstu3.model.Enumerations; import org.hl7.fhir.exceptions.FHIRException; public class DocumentReference10_30 { @@ -247,53 +250,61 @@ public static org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceRelate } static public org.hl7.fhir.dstu2.model.Enumeration convertDocumentRelationshipType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DocumentReference.DocumentRelationshipTypeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case REPLACES: - tgt.setValue(org.hl7.fhir.dstu2.model.DocumentReference.DocumentRelationshipType.REPLACES); - break; - case TRANSFORMS: - tgt.setValue(org.hl7.fhir.dstu2.model.DocumentReference.DocumentRelationshipType.TRANSFORMS); - break; - case SIGNS: - tgt.setValue(org.hl7.fhir.dstu2.model.DocumentReference.DocumentRelationshipType.SIGNS); - break; - case APPENDS: - tgt.setValue(org.hl7.fhir.dstu2.model.DocumentReference.DocumentRelationshipType.APPENDS); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.DocumentReference.DocumentRelationshipType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DocumentReference.DocumentRelationshipTypeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REPLACES: + tgt.setValue(DocumentReference.DocumentRelationshipType.REPLACES); + break; + case TRANSFORMS: + tgt.setValue(DocumentReference.DocumentRelationshipType.TRANSFORMS); + break; + case SIGNS: + tgt.setValue(DocumentReference.DocumentRelationshipType.SIGNS); + break; + case APPENDS: + tgt.setValue(DocumentReference.DocumentRelationshipType.APPENDS); + break; + default: + tgt.setValue(DocumentReference.DocumentRelationshipType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertDocumentRelationshipType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipTypeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case REPLACES: - tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType.REPLACES); - break; - case TRANSFORMS: - tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType.TRANSFORMS); - break; - case SIGNS: - tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType.SIGNS); - break; - case APPENDS: - tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType.APPENDS); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipTypeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REPLACES: + tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType.REPLACES); + break; + case TRANSFORMS: + tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType.TRANSFORMS); + break; + case SIGNS: + tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType.SIGNS); + break; + case APPENDS: + tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType.APPENDS); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertDocumentReferenceStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { @@ -301,23 +312,23 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatusEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CURRENT: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatus.CURRENT); - break; - case SUPERSEDED: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatus.SUPERSEDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatus.NULL); - break; - } - } + tgt.setValue(Enumerations.DocumentReferenceStatus.CURRENT); + break; + case SUPERSEDED: + tgt.setValue(Enumerations.DocumentReferenceStatus.SUPERSEDED); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.DocumentReferenceStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Enumerations.DocumentReferenceStatus.NULL); + break; + } +} return tgt; } @@ -326,23 +337,23 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatusEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CURRENT: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatus.CURRENT); - break; - case SUPERSEDED: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatus.SUPERSEDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatus.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatus.CURRENT); + break; + case SUPERSEDED: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatus.SUPERSEDED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatus.NULL); + break; + } +} return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Encounter10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Encounter10_30.java index ef931e9dd2..0b6d0009bc 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Encounter10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Encounter10_30.java @@ -6,6 +6,8 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Duration10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Identifier10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Period10_30; +import org.hl7.fhir.dstu3.model.Encounter; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; public class Encounter10_30 { @@ -222,53 +224,61 @@ public static org.hl7.fhir.dstu2.model.Encounter.EncounterLocationComponent conv } static public org.hl7.fhir.dstu3.model.Enumeration convertEncounterLocationStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Encounter.EncounterLocationStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterLocationStatus.PLANNED); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterLocationStatus.ACTIVE); - break; - case RESERVED: - tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterLocationStatus.RESERVED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterLocationStatus.COMPLETED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterLocationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Encounter.EncounterLocationStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(Encounter.EncounterLocationStatus.PLANNED); + break; + case ACTIVE: + tgt.setValue(Encounter.EncounterLocationStatus.ACTIVE); + break; + case RESERVED: + tgt.setValue(Encounter.EncounterLocationStatus.RESERVED); + break; + case COMPLETED: + tgt.setValue(Encounter.EncounterLocationStatus.COMPLETED); + break; + default: + tgt.setValue(Encounter.EncounterLocationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertEncounterLocationStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Encounter.EncounterLocationStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterLocationStatus.PLANNED); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterLocationStatus.ACTIVE); - break; - case RESERVED: - tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterLocationStatus.RESERVED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterLocationStatus.COMPLETED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterLocationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Encounter.EncounterLocationStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterLocationStatus.PLANNED); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterLocationStatus.ACTIVE); + break; + case RESERVED: + tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterLocationStatus.RESERVED); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterLocationStatus.COMPLETED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterLocationStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2.model.Encounter.EncounterParticipantComponent convertEncounterParticipantComponent(org.hl7.fhir.dstu3.model.Encounter.EncounterParticipantComponent src) throws FHIRException { @@ -300,64 +310,72 @@ public static org.hl7.fhir.dstu3.model.Encounter.EncounterParticipantComponent c } static public org.hl7.fhir.dstu2.model.Enumeration convertEncounterState(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Encounter.EncounterStateEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterState.PLANNED); - break; - case ARRIVED: - tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterState.ARRIVED); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterState.INPROGRESS); - break; - case ONLEAVE: - tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterState.ONLEAVE); - break; - case FINISHED: - tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterState.FINISHED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterState.CANCELLED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterState.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Encounter.EncounterStateEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterState.PLANNED); + break; + case ARRIVED: + tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterState.ARRIVED); + break; + case INPROGRESS: + tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterState.INPROGRESS); + break; + case ONLEAVE: + tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterState.ONLEAVE); + break; + case FINISHED: + tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterState.FINISHED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterState.CANCELLED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterState.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertEncounterState(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Encounter.EncounterStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterStatus.PLANNED); - break; - case ARRIVED: - tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterStatus.ARRIVED); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterStatus.INPROGRESS); - break; - case ONLEAVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterStatus.ONLEAVE); - break; - case FINISHED: - tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterStatus.FINISHED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterStatus.CANCELLED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Encounter.EncounterStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(Encounter.EncounterStatus.PLANNED); + break; + case ARRIVED: + tgt.setValue(Encounter.EncounterStatus.ARRIVED); + break; + case INPROGRESS: + tgt.setValue(Encounter.EncounterStatus.INPROGRESS); + break; + case ONLEAVE: + tgt.setValue(Encounter.EncounterStatus.ONLEAVE); + break; + case FINISHED: + tgt.setValue(Encounter.EncounterStatus.FINISHED); + break; + case CANCELLED: + tgt.setValue(Encounter.EncounterStatus.CANCELLED); + break; + default: + tgt.setValue(Encounter.EncounterStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Enumerations10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Enumerations10_30.java index 940a86f4c8..3a8b3acba5 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Enumerations10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Enumerations10_30.java @@ -1,6 +1,7 @@ package org.hl7.fhir.convertors.conv10_30.resources10_30; import org.hl7.fhir.convertors.context.ConversionContext10_30; +import org.hl7.fhir.dstu3.model.Enumerations; import org.hl7.fhir.exceptions.FHIRException; public class Enumerations10_30 { @@ -9,23 +10,23 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Enumerations.PublicationStatusEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case DRAFT: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.ACTIVE); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.RETIRED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.NULL); - break; - } - } + tgt.setValue(Enumerations.PublicationStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(Enumerations.PublicationStatus.ACTIVE); + break; + case RETIRED: + tgt.setValue(Enumerations.PublicationStatus.RETIRED); + break; + default: + tgt.setValue(Enumerations.PublicationStatus.NULL); + break; + } +} return tgt; } @@ -34,23 +35,23 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatusEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case DRAFT: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatus.ACTIVE); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatus.RETIRED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatus.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatus.ACTIVE); + break; + case RETIRED: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatus.RETIRED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatus.NULL); + break; + } +} return tgt; } @@ -59,26 +60,26 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGenderEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case MALE: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender.MALE); - break; - case FEMALE: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender.FEMALE); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender.OTHER); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender.NULL); - break; - } - } + tgt.setValue(Enumerations.AdministrativeGender.MALE); + break; + case FEMALE: + tgt.setValue(Enumerations.AdministrativeGender.FEMALE); + break; + case OTHER: + tgt.setValue(Enumerations.AdministrativeGender.OTHER); + break; + case UNKNOWN: + tgt.setValue(Enumerations.AdministrativeGender.UNKNOWN); + break; + default: + tgt.setValue(Enumerations.AdministrativeGender.NULL); + break; + } +} return tgt; } @@ -87,26 +88,26 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGenderEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case MALE: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender.MALE); - break; - case FEMALE: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender.FEMALE); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender.OTHER); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender.MALE); + break; + case FEMALE: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender.FEMALE); + break; + case OTHER: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender.OTHER); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/EpisodeOfCare10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/EpisodeOfCare10_30.java index f820cc292a..ed0c3df313 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/EpisodeOfCare10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/EpisodeOfCare10_30.java @@ -5,6 +5,8 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.CodeableConcept10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Identifier10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Period10_30; +import org.hl7.fhir.dstu2.model.Enumeration; +import org.hl7.fhir.dstu2.model.EpisodeOfCare; import org.hl7.fhir.exceptions.FHIRException; public class EpisodeOfCare10_30 { @@ -62,65 +64,73 @@ public static org.hl7.fhir.dstu2.model.EpisodeOfCare convertEpisodeOfCare(org.hl } static public org.hl7.fhir.dstu2.model.Enumeration convertEpisodeOfCareStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatus.PLANNED); - break; - case WAITLIST: - tgt.setValue(org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatus.WAITLIST); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatus.ONHOLD); - break; - case FINISHED: - tgt.setValue(org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatus.FINISHED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatus.CANCELLED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new EpisodeOfCare.EpisodeOfCareStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.PLANNED); + break; + case WAITLIST: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.WAITLIST); + break; + case ACTIVE: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.ONHOLD); + break; + case FINISHED: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.FINISHED); + break; + case CANCELLED: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.CANCELLED); + break; + default: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertEpisodeOfCareStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.PLANNED); - break; - case WAITLIST: - tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.WAITLIST); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.ONHOLD); - break; - case FINISHED: - tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.FINISHED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.CANCELLED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.PLANNED); + break; + case WAITLIST: + tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.WAITLIST); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.ONHOLD); + break; + case FINISHED: + tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.FINISHED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.CANCELLED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent convertEpisodeOfCareStatusHistoryComponent(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/FamilyMemberHistory10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/FamilyMemberHistory10_30.java index 533b126888..f0e562646c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/FamilyMemberHistory10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/FamilyMemberHistory10_30.java @@ -6,58 +6,68 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Identifier10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.DateTime10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.FamilyMemberHistory; import org.hl7.fhir.exceptions.FHIRException; public class FamilyMemberHistory10_30 { static public org.hl7.fhir.dstu3.model.Enumeration convertFamilyHistoryStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.FamilyMemberHistory.FamilyHistoryStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case PARTIAL: - tgt.setValue(org.hl7.fhir.dstu3.model.FamilyMemberHistory.FamilyHistoryStatus.PARTIAL); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.FamilyMemberHistory.FamilyHistoryStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.FamilyMemberHistory.FamilyHistoryStatus.ENTEREDINERROR); - break; - case HEALTHUNKNOWN: - tgt.setValue(org.hl7.fhir.dstu3.model.FamilyMemberHistory.FamilyHistoryStatus.HEALTHUNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.FamilyMemberHistory.FamilyHistoryStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new FamilyMemberHistory.FamilyHistoryStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PARTIAL: + tgt.setValue(FamilyMemberHistory.FamilyHistoryStatus.PARTIAL); + break; + case COMPLETED: + tgt.setValue(FamilyMemberHistory.FamilyHistoryStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(FamilyMemberHistory.FamilyHistoryStatus.ENTEREDINERROR); + break; + case HEALTHUNKNOWN: + tgt.setValue(FamilyMemberHistory.FamilyHistoryStatus.HEALTHUNKNOWN); + break; + default: + tgt.setValue(FamilyMemberHistory.FamilyHistoryStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertFamilyHistoryStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyHistoryStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case PARTIAL: - tgt.setValue(org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyHistoryStatus.PARTIAL); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyHistoryStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyHistoryStatus.ENTEREDINERROR); - break; - case HEALTHUNKNOWN: - tgt.setValue(org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyHistoryStatus.HEALTHUNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyHistoryStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyHistoryStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PARTIAL: + tgt.setValue(org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyHistoryStatus.PARTIAL); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyHistoryStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyHistoryStatus.ENTEREDINERROR); + break; + case HEALTHUNKNOWN: + tgt.setValue(org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyHistoryStatus.HEALTHUNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyHistoryStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.FamilyMemberHistory convertFamilyMemberHistory(org.hl7.fhir.dstu2.model.FamilyMemberHistory src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Flag10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Flag10_30.java index b224c23d25..62c04a02f3 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Flag10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Flag10_30.java @@ -5,6 +5,8 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.CodeableConcept10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Identifier10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Period10_30; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.Flag; import org.hl7.fhir.exceptions.FHIRException; public class Flag10_30 { @@ -58,46 +60,54 @@ public static org.hl7.fhir.dstu2.model.Flag convertFlag(org.hl7.fhir.dstu3.model } static public org.hl7.fhir.dstu3.model.Enumeration convertFlagStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Flag.FlagStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Flag.FlagStatus.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Flag.FlagStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Flag.FlagStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Flag.FlagStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Flag.FlagStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Flag.FlagStatus.ACTIVE); + break; + case INACTIVE: + tgt.setValue(Flag.FlagStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(Flag.FlagStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Flag.FlagStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertFlagStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Flag.FlagStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.Flag.FlagStatus.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.Flag.FlagStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.Flag.FlagStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Flag.FlagStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Flag.FlagStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu2.model.Flag.FlagStatus.ACTIVE); + break; + case INACTIVE: + tgt.setValue(org.hl7.fhir.dstu2.model.Flag.FlagStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu2.model.Flag.FlagStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Flag.FlagStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Group10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Group10_30.java index e3ce5089f5..d3b2bac011 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Group10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Group10_30.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Boolean10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.UnsignedInt10_30; +import org.hl7.fhir.dstu2.model.Enumeration; +import org.hl7.fhir.dstu2.model.Group; import org.hl7.fhir.exceptions.FHIRException; public class Group10_30 { @@ -121,64 +123,72 @@ public static org.hl7.fhir.dstu3.model.Group.GroupMemberComponent convertGroupMe } static public org.hl7.fhir.dstu2.model.Enumeration convertGroupType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Group.GroupTypeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case PERSON: - tgt.setValue(org.hl7.fhir.dstu2.model.Group.GroupType.PERSON); - break; - case ANIMAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Group.GroupType.ANIMAL); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.dstu2.model.Group.GroupType.PRACTITIONER); - break; - case DEVICE: - tgt.setValue(org.hl7.fhir.dstu2.model.Group.GroupType.DEVICE); - break; - case MEDICATION: - tgt.setValue(org.hl7.fhir.dstu2.model.Group.GroupType.MEDICATION); - break; - case SUBSTANCE: - tgt.setValue(org.hl7.fhir.dstu2.model.Group.GroupType.SUBSTANCE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Group.GroupType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Group.GroupTypeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PERSON: + tgt.setValue(Group.GroupType.PERSON); + break; + case ANIMAL: + tgt.setValue(Group.GroupType.ANIMAL); + break; + case PRACTITIONER: + tgt.setValue(Group.GroupType.PRACTITIONER); + break; + case DEVICE: + tgt.setValue(Group.GroupType.DEVICE); + break; + case MEDICATION: + tgt.setValue(Group.GroupType.MEDICATION); + break; + case SUBSTANCE: + tgt.setValue(Group.GroupType.SUBSTANCE); + break; + default: + tgt.setValue(Group.GroupType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertGroupType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Group.GroupTypeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case PERSON: - tgt.setValue(org.hl7.fhir.dstu3.model.Group.GroupType.PERSON); - break; - case ANIMAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Group.GroupType.ANIMAL); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.dstu3.model.Group.GroupType.PRACTITIONER); - break; - case DEVICE: - tgt.setValue(org.hl7.fhir.dstu3.model.Group.GroupType.DEVICE); - break; - case MEDICATION: - tgt.setValue(org.hl7.fhir.dstu3.model.Group.GroupType.MEDICATION); - break; - case SUBSTANCE: - tgt.setValue(org.hl7.fhir.dstu3.model.Group.GroupType.SUBSTANCE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Group.GroupType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Group.GroupTypeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PERSON: + tgt.setValue(org.hl7.fhir.dstu3.model.Group.GroupType.PERSON); + break; + case ANIMAL: + tgt.setValue(org.hl7.fhir.dstu3.model.Group.GroupType.ANIMAL); + break; + case PRACTITIONER: + tgt.setValue(org.hl7.fhir.dstu3.model.Group.GroupType.PRACTITIONER); + break; + case DEVICE: + tgt.setValue(org.hl7.fhir.dstu3.model.Group.GroupType.DEVICE); + break; + case MEDICATION: + tgt.setValue(org.hl7.fhir.dstu3.model.Group.GroupType.MEDICATION); + break; + case SUBSTANCE: + tgt.setValue(org.hl7.fhir.dstu3.model.Group.GroupType.SUBSTANCE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Group.GroupType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/HealthcareService10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/HealthcareService10_30.java index 06e0315e7d..4e6a4fff11 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/HealthcareService10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/HealthcareService10_30.java @@ -12,76 +12,86 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Boolean10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Time10_30; +import org.hl7.fhir.dstu2.model.Enumeration; +import org.hl7.fhir.dstu2.model.HealthcareService; import org.hl7.fhir.exceptions.FHIRException; public class HealthcareService10_30 { static public org.hl7.fhir.dstu2.model.Enumeration convertDaysOfWeek(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.HealthcareService.DaysOfWeekEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case MON: - tgt.setValue(org.hl7.fhir.dstu2.model.HealthcareService.DaysOfWeek.MON); - break; - case TUE: - tgt.setValue(org.hl7.fhir.dstu2.model.HealthcareService.DaysOfWeek.TUE); - break; - case WED: - tgt.setValue(org.hl7.fhir.dstu2.model.HealthcareService.DaysOfWeek.WED); - break; - case THU: - tgt.setValue(org.hl7.fhir.dstu2.model.HealthcareService.DaysOfWeek.THU); - break; - case FRI: - tgt.setValue(org.hl7.fhir.dstu2.model.HealthcareService.DaysOfWeek.FRI); - break; - case SAT: - tgt.setValue(org.hl7.fhir.dstu2.model.HealthcareService.DaysOfWeek.SAT); - break; - case SUN: - tgt.setValue(org.hl7.fhir.dstu2.model.HealthcareService.DaysOfWeek.SUN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.HealthcareService.DaysOfWeek.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new HealthcareService.DaysOfWeekEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MON: + tgt.setValue(HealthcareService.DaysOfWeek.MON); + break; + case TUE: + tgt.setValue(HealthcareService.DaysOfWeek.TUE); + break; + case WED: + tgt.setValue(HealthcareService.DaysOfWeek.WED); + break; + case THU: + tgt.setValue(HealthcareService.DaysOfWeek.THU); + break; + case FRI: + tgt.setValue(HealthcareService.DaysOfWeek.FRI); + break; + case SAT: + tgt.setValue(HealthcareService.DaysOfWeek.SAT); + break; + case SUN: + tgt.setValue(HealthcareService.DaysOfWeek.SUN); + break; + default: + tgt.setValue(HealthcareService.DaysOfWeek.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertDaysOfWeek(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeekEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case MON: - tgt.setValue(org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeek.MON); - break; - case TUE: - tgt.setValue(org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeek.TUE); - break; - case WED: - tgt.setValue(org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeek.WED); - break; - case THU: - tgt.setValue(org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeek.THU); - break; - case FRI: - tgt.setValue(org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeek.FRI); - break; - case SAT: - tgt.setValue(org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeek.SAT); - break; - case SUN: - tgt.setValue(org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeek.SUN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeek.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeekEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MON: + tgt.setValue(org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeek.MON); + break; + case TUE: + tgt.setValue(org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeek.TUE); + break; + case WED: + tgt.setValue(org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeek.WED); + break; + case THU: + tgt.setValue(org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeek.THU); + break; + case FRI: + tgt.setValue(org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeek.FRI); + break; + case SAT: + tgt.setValue(org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeek.SAT); + break; + case SUN: + tgt.setValue(org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeek.SUN); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeek.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2.model.HealthcareService convertHealthcareService(org.hl7.fhir.dstu3.model.HealthcareService src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/ImagingStudy10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/ImagingStudy10_30.java index 2e15d7a431..0f5ecdb11b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/ImagingStudy10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/ImagingStudy10_30.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Oid10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.UnsignedInt10_30; +import org.hl7.fhir.dstu2.model.Enumeration; +import org.hl7.fhir.dstu2.model.ImagingStudy; import org.hl7.fhir.exceptions.FHIRException; public class ImagingStudy10_30 { @@ -171,52 +173,60 @@ public static org.hl7.fhir.dstu2.model.ImagingStudy.ImagingStudySeriesInstanceCo } static public org.hl7.fhir.dstu2.model.Enumeration convertInstanceAvailability(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ImagingStudy.InstanceAvailabilityEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case ONLINE: - tgt.setValue(org.hl7.fhir.dstu2.model.ImagingStudy.InstanceAvailability.ONLINE); - break; - case OFFLINE: - tgt.setValue(org.hl7.fhir.dstu2.model.ImagingStudy.InstanceAvailability.OFFLINE); - break; - case NEARLINE: - tgt.setValue(org.hl7.fhir.dstu2.model.ImagingStudy.InstanceAvailability.NEARLINE); - break; - case UNAVAILABLE: - tgt.setValue(org.hl7.fhir.dstu2.model.ImagingStudy.InstanceAvailability.UNAVAILABLE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.ImagingStudy.InstanceAvailability.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ImagingStudy.InstanceAvailabilityEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ONLINE: + tgt.setValue(ImagingStudy.InstanceAvailability.ONLINE); + break; + case OFFLINE: + tgt.setValue(ImagingStudy.InstanceAvailability.OFFLINE); + break; + case NEARLINE: + tgt.setValue(ImagingStudy.InstanceAvailability.NEARLINE); + break; + case UNAVAILABLE: + tgt.setValue(ImagingStudy.InstanceAvailability.UNAVAILABLE); + break; + default: + tgt.setValue(ImagingStudy.InstanceAvailability.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertInstanceAvailability(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ImagingStudy.InstanceAvailabilityEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case ONLINE: - tgt.setValue(org.hl7.fhir.dstu3.model.ImagingStudy.InstanceAvailability.ONLINE); - break; - case OFFLINE: - tgt.setValue(org.hl7.fhir.dstu3.model.ImagingStudy.InstanceAvailability.OFFLINE); - break; - case NEARLINE: - tgt.setValue(org.hl7.fhir.dstu3.model.ImagingStudy.InstanceAvailability.NEARLINE); - break; - case UNAVAILABLE: - tgt.setValue(org.hl7.fhir.dstu3.model.ImagingStudy.InstanceAvailability.UNAVAILABLE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ImagingStudy.InstanceAvailability.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ImagingStudy.InstanceAvailabilityEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ONLINE: + tgt.setValue(org.hl7.fhir.dstu3.model.ImagingStudy.InstanceAvailability.ONLINE); + break; + case OFFLINE: + tgt.setValue(org.hl7.fhir.dstu3.model.ImagingStudy.InstanceAvailability.OFFLINE); + break; + case NEARLINE: + tgt.setValue(org.hl7.fhir.dstu3.model.ImagingStudy.InstanceAvailability.NEARLINE); + break; + case UNAVAILABLE: + tgt.setValue(org.hl7.fhir.dstu3.model.ImagingStudy.InstanceAvailability.UNAVAILABLE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.ImagingStudy.InstanceAvailability.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/ImplementationGuide10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/ImplementationGuide10_30.java index 9f2e2f0d3c..3f9b5d2519 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/ImplementationGuide10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/ImplementationGuide10_30.java @@ -11,120 +11,138 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Id10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Uri10_30; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.ImplementationGuide; import org.hl7.fhir.exceptions.FHIRException; public class ImplementationGuide10_30 { static public org.hl7.fhir.dstu3.model.Enumeration convertGuideDependencyType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ImplementationGuide.GuideDependencyTypeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case REFERENCE: - tgt.setValue(org.hl7.fhir.dstu3.model.ImplementationGuide.GuideDependencyType.REFERENCE); - break; - case INCLUSION: - tgt.setValue(org.hl7.fhir.dstu3.model.ImplementationGuide.GuideDependencyType.INCLUSION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ImplementationGuide.GuideDependencyType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ImplementationGuide.GuideDependencyTypeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REFERENCE: + tgt.setValue(ImplementationGuide.GuideDependencyType.REFERENCE); + break; + case INCLUSION: + tgt.setValue(ImplementationGuide.GuideDependencyType.INCLUSION); + break; + default: + tgt.setValue(ImplementationGuide.GuideDependencyType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertGuideDependencyType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ImplementationGuide.GuideDependencyTypeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case REFERENCE: - tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuideDependencyType.REFERENCE); - break; - case INCLUSION: - tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuideDependencyType.INCLUSION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuideDependencyType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ImplementationGuide.GuideDependencyTypeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REFERENCE: + tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuideDependencyType.REFERENCE); + break; + case INCLUSION: + tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuideDependencyType.INCLUSION); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuideDependencyType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertGuidePageKind(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ImplementationGuide.GuidePageKindEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case PAGE: - tgt.setValue(org.hl7.fhir.dstu3.model.ImplementationGuide.GuidePageKind.PAGE); - break; - case EXAMPLE: - tgt.setValue(org.hl7.fhir.dstu3.model.ImplementationGuide.GuidePageKind.EXAMPLE); - break; - case LIST: - tgt.setValue(org.hl7.fhir.dstu3.model.ImplementationGuide.GuidePageKind.LIST); - break; - case INCLUDE: - tgt.setValue(org.hl7.fhir.dstu3.model.ImplementationGuide.GuidePageKind.INCLUDE); - break; - case DIRECTORY: - tgt.setValue(org.hl7.fhir.dstu3.model.ImplementationGuide.GuidePageKind.DIRECTORY); - break; - case DICTIONARY: - tgt.setValue(org.hl7.fhir.dstu3.model.ImplementationGuide.GuidePageKind.DICTIONARY); - break; - case TOC: - tgt.setValue(org.hl7.fhir.dstu3.model.ImplementationGuide.GuidePageKind.TOC); - break; - case RESOURCE: - tgt.setValue(org.hl7.fhir.dstu3.model.ImplementationGuide.GuidePageKind.RESOURCE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ImplementationGuide.GuidePageKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ImplementationGuide.GuidePageKindEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PAGE: + tgt.setValue(ImplementationGuide.GuidePageKind.PAGE); + break; + case EXAMPLE: + tgt.setValue(ImplementationGuide.GuidePageKind.EXAMPLE); + break; + case LIST: + tgt.setValue(ImplementationGuide.GuidePageKind.LIST); + break; + case INCLUDE: + tgt.setValue(ImplementationGuide.GuidePageKind.INCLUDE); + break; + case DIRECTORY: + tgt.setValue(ImplementationGuide.GuidePageKind.DIRECTORY); + break; + case DICTIONARY: + tgt.setValue(ImplementationGuide.GuidePageKind.DICTIONARY); + break; + case TOC: + tgt.setValue(ImplementationGuide.GuidePageKind.TOC); + break; + case RESOURCE: + tgt.setValue(ImplementationGuide.GuidePageKind.RESOURCE); + break; + default: + tgt.setValue(ImplementationGuide.GuidePageKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertGuidePageKind(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKindEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case PAGE: - tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind.PAGE); - break; - case EXAMPLE: - tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind.EXAMPLE); - break; - case LIST: - tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind.LIST); - break; - case INCLUDE: - tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind.INCLUDE); - break; - case DIRECTORY: - tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind.DIRECTORY); - break; - case DICTIONARY: - tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind.DICTIONARY); - break; - case TOC: - tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind.TOC); - break; - case RESOURCE: - tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind.RESOURCE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKindEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PAGE: + tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind.PAGE); + break; + case EXAMPLE: + tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind.EXAMPLE); + break; + case LIST: + tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind.LIST); + break; + case INCLUDE: + tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind.INCLUDE); + break; + case DIRECTORY: + tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind.DIRECTORY); + break; + case DICTIONARY: + tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind.DICTIONARY); + break; + case TOC: + tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind.TOC); + break; + case RESOURCE: + tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind.RESOURCE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.ImplementationGuide convertImplementationGuide(org.hl7.fhir.dstu2.model.ImplementationGuide src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/List10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/List10_30.java index 41bfe17957..6c88526ef7 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/List10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/List10_30.java @@ -8,6 +8,9 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Boolean10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.DateTime10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; +import org.hl7.fhir.dstu2.model.List_; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.ListResource; import org.hl7.fhir.exceptions.FHIRException; public class List10_30 { @@ -106,91 +109,107 @@ public static org.hl7.fhir.dstu2.model.List_.ListEntryComponent convertListEntry } static public org.hl7.fhir.dstu3.model.Enumeration convertListMode(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ListResource.ListModeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case WORKING: - tgt.setValue(org.hl7.fhir.dstu3.model.ListResource.ListMode.WORKING); - break; - case SNAPSHOT: - tgt.setValue(org.hl7.fhir.dstu3.model.ListResource.ListMode.SNAPSHOT); - break; - case CHANGES: - tgt.setValue(org.hl7.fhir.dstu3.model.ListResource.ListMode.CHANGES); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ListResource.ListMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ListResource.ListModeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case WORKING: + tgt.setValue(ListResource.ListMode.WORKING); + break; + case SNAPSHOT: + tgt.setValue(ListResource.ListMode.SNAPSHOT); + break; + case CHANGES: + tgt.setValue(ListResource.ListMode.CHANGES); + break; + default: + tgt.setValue(ListResource.ListMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertListMode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.List_.ListModeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case WORKING: - tgt.setValue(org.hl7.fhir.dstu2.model.List_.ListMode.WORKING); - break; - case SNAPSHOT: - tgt.setValue(org.hl7.fhir.dstu2.model.List_.ListMode.SNAPSHOT); - break; - case CHANGES: - tgt.setValue(org.hl7.fhir.dstu2.model.List_.ListMode.CHANGES); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.List_.ListMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new List_.ListModeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case WORKING: + tgt.setValue(List_.ListMode.WORKING); + break; + case SNAPSHOT: + tgt.setValue(List_.ListMode.SNAPSHOT); + break; + case CHANGES: + tgt.setValue(List_.ListMode.CHANGES); + break; + default: + tgt.setValue(List_.ListMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertListStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.List_.ListStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case CURRENT: - tgt.setValue(org.hl7.fhir.dstu2.model.List_.ListStatus.CURRENT); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.dstu2.model.List_.ListStatus.RETIRED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.List_.ListStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.List_.ListStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new List_.ListStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CURRENT: + tgt.setValue(List_.ListStatus.CURRENT); + break; + case RETIRED: + tgt.setValue(List_.ListStatus.RETIRED); + break; + case ENTEREDINERROR: + tgt.setValue(List_.ListStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(List_.ListStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertListStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ListResource.ListStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case CURRENT: - tgt.setValue(org.hl7.fhir.dstu3.model.ListResource.ListStatus.CURRENT); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.dstu3.model.ListResource.ListStatus.RETIRED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.ListResource.ListStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ListResource.ListStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ListResource.ListStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CURRENT: + tgt.setValue(ListResource.ListStatus.CURRENT); + break; + case RETIRED: + tgt.setValue(ListResource.ListStatus.RETIRED); + break; + case ENTEREDINERROR: + tgt.setValue(ListResource.ListStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(ListResource.ListStatus.NULL); + break; + } + } + return tgt; } public static void copyBackboneElement(org.hl7.fhir.dstu2.model.BackboneElement src, org.hl7.fhir.dstu3.model.BackboneElement tgt) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Location10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Location10_30.java index 98fe30eccc..c709066cac 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Location10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Location10_30.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Identifier10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Decimal10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; +import org.hl7.fhir.dstu2.model.Enumeration; +import org.hl7.fhir.dstu2.model.Location; import org.hl7.fhir.exceptions.FHIRException; public class Location10_30 { @@ -77,41 +79,49 @@ public static org.hl7.fhir.dstu3.model.Location convertLocation(org.hl7.fhir.dst } static public org.hl7.fhir.dstu2.model.Enumeration convertLocationMode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Location.LocationModeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.dstu2.model.Location.LocationMode.INSTANCE); - break; - case KIND: - tgt.setValue(org.hl7.fhir.dstu2.model.Location.LocationMode.KIND); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Location.LocationMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Location.LocationModeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(Location.LocationMode.INSTANCE); + break; + case KIND: + tgt.setValue(Location.LocationMode.KIND); + break; + default: + tgt.setValue(Location.LocationMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertLocationMode(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Location.LocationModeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.dstu3.model.Location.LocationMode.INSTANCE); - break; - case KIND: - tgt.setValue(org.hl7.fhir.dstu3.model.Location.LocationMode.KIND); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Location.LocationMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Location.LocationModeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(org.hl7.fhir.dstu3.model.Location.LocationMode.INSTANCE); + break; + case KIND: + tgt.setValue(org.hl7.fhir.dstu3.model.Location.LocationMode.KIND); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Location.LocationMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.Location.LocationPositionComponent convertLocationPositionComponent(org.hl7.fhir.dstu2.model.Location.LocationPositionComponent src) throws FHIRException { @@ -143,46 +153,54 @@ public static org.hl7.fhir.dstu2.model.Location.LocationPositionComponent conver } static public org.hl7.fhir.dstu2.model.Enumeration convertLocationStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Location.LocationStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.Location.LocationStatus.ACTIVE); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.dstu2.model.Location.LocationStatus.SUSPENDED); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.Location.LocationStatus.INACTIVE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Location.LocationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Location.LocationStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Location.LocationStatus.ACTIVE); + break; + case SUSPENDED: + tgt.setValue(Location.LocationStatus.SUSPENDED); + break; + case INACTIVE: + tgt.setValue(Location.LocationStatus.INACTIVE); + break; + default: + tgt.setValue(Location.LocationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertLocationStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Location.LocationStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Location.LocationStatus.ACTIVE); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.dstu3.model.Location.LocationStatus.SUSPENDED); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Location.LocationStatus.INACTIVE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Location.LocationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Location.LocationStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu3.model.Location.LocationStatus.ACTIVE); + break; + case SUSPENDED: + tgt.setValue(org.hl7.fhir.dstu3.model.Location.LocationStatus.SUSPENDED); + break; + case INACTIVE: + tgt.setValue(org.hl7.fhir.dstu3.model.Location.LocationStatus.INACTIVE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Location.LocationStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Media10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Media10_30.java index dd76a60dfe..49008ee760 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Media10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Media10_30.java @@ -7,52 +7,62 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Identifier10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.PositiveInt10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.UnsignedInt10_30; +import org.hl7.fhir.dstu2.model.Enumeration; +import org.hl7.fhir.dstu2.model.Media; import org.hl7.fhir.exceptions.FHIRException; public class Media10_30 { static public org.hl7.fhir.dstu2.model.Enumeration convertDigitalMediaType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Media.DigitalMediaTypeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case PHOTO: - tgt.setValue(org.hl7.fhir.dstu2.model.Media.DigitalMediaType.PHOTO); - break; - case VIDEO: - tgt.setValue(org.hl7.fhir.dstu2.model.Media.DigitalMediaType.VIDEO); - break; - case AUDIO: - tgt.setValue(org.hl7.fhir.dstu2.model.Media.DigitalMediaType.AUDIO); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Media.DigitalMediaType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Media.DigitalMediaTypeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PHOTO: + tgt.setValue(Media.DigitalMediaType.PHOTO); + break; + case VIDEO: + tgt.setValue(Media.DigitalMediaType.VIDEO); + break; + case AUDIO: + tgt.setValue(Media.DigitalMediaType.AUDIO); + break; + default: + tgt.setValue(Media.DigitalMediaType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertDigitalMediaType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Media.DigitalMediaTypeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case PHOTO: - tgt.setValue(org.hl7.fhir.dstu3.model.Media.DigitalMediaType.PHOTO); - break; - case VIDEO: - tgt.setValue(org.hl7.fhir.dstu3.model.Media.DigitalMediaType.VIDEO); - break; - case AUDIO: - tgt.setValue(org.hl7.fhir.dstu3.model.Media.DigitalMediaType.AUDIO); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Media.DigitalMediaType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Media.DigitalMediaTypeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PHOTO: + tgt.setValue(org.hl7.fhir.dstu3.model.Media.DigitalMediaType.PHOTO); + break; + case VIDEO: + tgt.setValue(org.hl7.fhir.dstu3.model.Media.DigitalMediaType.VIDEO); + break; + case AUDIO: + tgt.setValue(org.hl7.fhir.dstu3.model.Media.DigitalMediaType.AUDIO); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Media.DigitalMediaType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2.model.Media convertMedia(org.hl7.fhir.dstu3.model.Media src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/MedicationDispense10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/MedicationDispense10_30.java index 3bc4c2159e..c84372a8cf 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/MedicationDispense10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/MedicationDispense10_30.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Timing10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.DateTime10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; +import org.hl7.fhir.dstu2.model.Enumeration; +import org.hl7.fhir.dstu2.model.MedicationDispense; import org.hl7.fhir.dstu3.model.Dosage; import org.hl7.fhir.exceptions.FHIRException; @@ -131,59 +133,67 @@ public static org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseDosa } static public org.hl7.fhir.dstu2.model.Enumeration convertMedicationDispenseStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatus.INPROGRESS); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatus.ONHOLD); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatus.ENTEREDINERROR); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatus.STOPPED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new MedicationDispense.MedicationDispenseStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(MedicationDispense.MedicationDispenseStatus.INPROGRESS); + break; + case ONHOLD: + tgt.setValue(MedicationDispense.MedicationDispenseStatus.ONHOLD); + break; + case COMPLETED: + tgt.setValue(MedicationDispense.MedicationDispenseStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(MedicationDispense.MedicationDispenseStatus.ENTEREDINERROR); + break; + case STOPPED: + tgt.setValue(MedicationDispense.MedicationDispenseStatus.STOPPED); + break; + default: + tgt.setValue(MedicationDispense.MedicationDispenseStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertMedicationDispenseStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatus.INPROGRESS); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatus.ONHOLD); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatus.ENTEREDINERROR); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatus.STOPPED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatus.INPROGRESS); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatus.ONHOLD); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatus.ENTEREDINERROR); + break; + case STOPPED: + tgt.setValue(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatus.STOPPED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseSubstitutionComponent convertMedicationDispenseSubstitutionComponent(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseSubstitutionComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/MedicationStatement10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/MedicationStatement10_30.java index 9e3aaaa3c4..e72bd5333c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/MedicationStatement10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/MedicationStatement10_30.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Timing10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.DateTime10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.MedicationStatement; import org.hl7.fhir.exceptions.FHIRException; public class MedicationStatement10_30 { @@ -120,52 +122,60 @@ public static org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementDo } static public org.hl7.fhir.dstu3.model.Enumeration convertMedicationStatementStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.MedicationStatement.MedicationStatementStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationStatement.MedicationStatementStatus.ACTIVE); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationStatement.MedicationStatementStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationStatement.MedicationStatementStatus.ENTEREDINERROR); - break; - case INTENDED: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationStatement.MedicationStatementStatus.INTENDED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationStatement.MedicationStatementStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new MedicationStatement.MedicationStatementStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(MedicationStatement.MedicationStatementStatus.ACTIVE); + break; + case COMPLETED: + tgt.setValue(MedicationStatement.MedicationStatementStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(MedicationStatement.MedicationStatementStatus.ENTEREDINERROR); + break; + case INTENDED: + tgt.setValue(MedicationStatement.MedicationStatementStatus.INTENDED); + break; + default: + tgt.setValue(MedicationStatement.MedicationStatementStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertMedicationStatementStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementStatus.ACTIVE); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementStatus.ENTEREDINERROR); - break; - case INTENDED: - tgt.setValue(org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementStatus.INTENDED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementStatus.ACTIVE); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementStatus.ENTEREDINERROR); + break; + case INTENDED: + tgt.setValue(org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementStatus.INTENDED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/MessageHeader10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/MessageHeader10_30.java index d2e0988d10..9b7a5f22ee 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/MessageHeader10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/MessageHeader10_30.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Instant10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Uri10_30; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.MessageHeader; import org.hl7.fhir.exceptions.FHIRException; public class MessageHeader10_30 { @@ -164,46 +166,54 @@ public static org.hl7.fhir.dstu2.model.MessageHeader.MessageSourceComponent conv } static public org.hl7.fhir.dstu3.model.Enumeration convertResponseType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.MessageHeader.ResponseTypeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case OK: - tgt.setValue(org.hl7.fhir.dstu3.model.MessageHeader.ResponseType.OK); - break; - case TRANSIENTERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.MessageHeader.ResponseType.TRANSIENTERROR); - break; - case FATALERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.MessageHeader.ResponseType.FATALERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.MessageHeader.ResponseType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new MessageHeader.ResponseTypeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OK: + tgt.setValue(MessageHeader.ResponseType.OK); + break; + case TRANSIENTERROR: + tgt.setValue(MessageHeader.ResponseType.TRANSIENTERROR); + break; + case FATALERROR: + tgt.setValue(MessageHeader.ResponseType.FATALERROR); + break; + default: + tgt.setValue(MessageHeader.ResponseType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertResponseType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.MessageHeader.ResponseTypeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case OK: - tgt.setValue(org.hl7.fhir.dstu2.model.MessageHeader.ResponseType.OK); - break; - case TRANSIENTERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.MessageHeader.ResponseType.TRANSIENTERROR); - break; - case FATALERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.MessageHeader.ResponseType.FATALERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.MessageHeader.ResponseType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.MessageHeader.ResponseTypeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OK: + tgt.setValue(org.hl7.fhir.dstu2.model.MessageHeader.ResponseType.OK); + break; + case TRANSIENTERROR: + tgt.setValue(org.hl7.fhir.dstu2.model.MessageHeader.ResponseType.TRANSIENTERROR); + break; + case FATALERROR: + tgt.setValue(org.hl7.fhir.dstu2.model.MessageHeader.ResponseType.FATALERROR); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.MessageHeader.ResponseType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/NamingSystem10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/NamingSystem10_30.java index ce0411f94e..2d44eae8d2 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/NamingSystem10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/NamingSystem10_30.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Boolean10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.DateTime10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; +import org.hl7.fhir.dstu2.model.Enumeration; +import org.hl7.fhir.dstu2.model.NamingSystem; import org.hl7.fhir.exceptions.FHIRException; public class NamingSystem10_30 { @@ -112,97 +114,113 @@ public static org.hl7.fhir.dstu3.model.ContactDetail convertNamingSystemContactC } static public org.hl7.fhir.dstu2.model.Enumeration convertNamingSystemIdentifierType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemIdentifierTypeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case OID: - tgt.setValue(org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemIdentifierType.OID); - break; - case UUID: - tgt.setValue(org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemIdentifierType.UUID); - break; - case URI: - tgt.setValue(org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemIdentifierType.URI); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemIdentifierType.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemIdentifierType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new NamingSystem.NamingSystemIdentifierTypeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OID: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.OID); + break; + case UUID: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.UUID); + break; + case URI: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.URI); + break; + case OTHER: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.OTHER); + break; + default: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertNamingSystemIdentifierType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierTypeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case OID: - tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierType.OID); - break; - case UUID: - tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierType.UUID); - break; - case URI: - tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierType.URI); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierType.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierTypeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OID: + tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierType.OID); + break; + case UUID: + tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierType.UUID); + break; + case URI: + tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierType.URI); + break; + case OTHER: + tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierType.OTHER); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertNamingSystemType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemTypeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case CODESYSTEM: - tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemType.CODESYSTEM); - break; - case IDENTIFIER: - tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemType.IDENTIFIER); - break; - case ROOT: - tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemType.ROOT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemTypeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CODESYSTEM: + tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemType.CODESYSTEM); + break; + case IDENTIFIER: + tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemType.IDENTIFIER); + break; + case ROOT: + tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemType.ROOT); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertNamingSystemType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemTypeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case CODESYSTEM: - tgt.setValue(org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemType.CODESYSTEM); - break; - case IDENTIFIER: - tgt.setValue(org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemType.IDENTIFIER); - break; - case ROOT: - tgt.setValue(org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemType.ROOT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new NamingSystem.NamingSystemTypeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CODESYSTEM: + tgt.setValue(NamingSystem.NamingSystemType.CODESYSTEM); + break; + case IDENTIFIER: + tgt.setValue(NamingSystem.NamingSystemType.IDENTIFIER); + break; + case ROOT: + tgt.setValue(NamingSystem.NamingSystemType.ROOT); + break; + default: + tgt.setValue(NamingSystem.NamingSystemType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemUniqueIdComponent convertNamingSystemUniqueIdComponent(org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemUniqueIdComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Observation10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Observation10_30.java index 052f1cce87..723f3bda47 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Observation10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Observation10_30.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.SimpleQuantity10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Instant10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.Observation; import org.hl7.fhir.exceptions.FHIRException; public class Observation10_30 { @@ -201,132 +203,148 @@ public static org.hl7.fhir.dstu3.model.Observation.ObservationRelatedComponent c } static public org.hl7.fhir.dstu3.model.Enumeration convertObservationRelationshipType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Observation.ObservationRelationshipTypeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case HASMEMBER: - tgt.setValue(org.hl7.fhir.dstu3.model.Observation.ObservationRelationshipType.HASMEMBER); - break; - case DERIVEDFROM: - tgt.setValue(org.hl7.fhir.dstu3.model.Observation.ObservationRelationshipType.DERIVEDFROM); - break; - case SEQUELTO: - tgt.setValue(org.hl7.fhir.dstu3.model.Observation.ObservationRelationshipType.SEQUELTO); - break; - case REPLACES: - tgt.setValue(org.hl7.fhir.dstu3.model.Observation.ObservationRelationshipType.REPLACES); - break; - case QUALIFIEDBY: - tgt.setValue(org.hl7.fhir.dstu3.model.Observation.ObservationRelationshipType.QUALIFIEDBY); - break; - case INTERFEREDBY: - tgt.setValue(org.hl7.fhir.dstu3.model.Observation.ObservationRelationshipType.INTERFEREDBY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Observation.ObservationRelationshipType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Observation.ObservationRelationshipTypeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case HASMEMBER: + tgt.setValue(Observation.ObservationRelationshipType.HASMEMBER); + break; + case DERIVEDFROM: + tgt.setValue(Observation.ObservationRelationshipType.DERIVEDFROM); + break; + case SEQUELTO: + tgt.setValue(Observation.ObservationRelationshipType.SEQUELTO); + break; + case REPLACES: + tgt.setValue(Observation.ObservationRelationshipType.REPLACES); + break; + case QUALIFIEDBY: + tgt.setValue(Observation.ObservationRelationshipType.QUALIFIEDBY); + break; + case INTERFEREDBY: + tgt.setValue(Observation.ObservationRelationshipType.INTERFEREDBY); + break; + default: + tgt.setValue(Observation.ObservationRelationshipType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertObservationRelationshipType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Observation.ObservationRelationshipTypeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case HASMEMBER: - tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationRelationshipType.HASMEMBER); - break; - case DERIVEDFROM: - tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationRelationshipType.DERIVEDFROM); - break; - case SEQUELTO: - tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationRelationshipType.SEQUELTO); - break; - case REPLACES: - tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationRelationshipType.REPLACES); - break; - case QUALIFIEDBY: - tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationRelationshipType.QUALIFIEDBY); - break; - case INTERFEREDBY: - tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationRelationshipType.INTERFEREDBY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationRelationshipType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Observation.ObservationRelationshipTypeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case HASMEMBER: + tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationRelationshipType.HASMEMBER); + break; + case DERIVEDFROM: + tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationRelationshipType.DERIVEDFROM); + break; + case SEQUELTO: + tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationRelationshipType.SEQUELTO); + break; + case REPLACES: + tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationRelationshipType.REPLACES); + break; + case QUALIFIEDBY: + tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationRelationshipType.QUALIFIEDBY); + break; + case INTERFEREDBY: + tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationRelationshipType.INTERFEREDBY); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationRelationshipType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertObservationStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Observation.ObservationStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationStatus.REGISTERED); - break; - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationStatus.AMENDED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Observation.ObservationStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationStatus.REGISTERED); + break; + case PRELIMINARY: + tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationStatus.FINAL); + break; + case AMENDED: + tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationStatus.AMENDED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertObservationStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Observation.ObservationStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.dstu3.model.Observation.ObservationStatus.REGISTERED); - break; - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.dstu3.model.Observation.ObservationStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Observation.ObservationStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.dstu3.model.Observation.ObservationStatus.AMENDED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu3.model.Observation.ObservationStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Observation.ObservationStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu3.model.Observation.ObservationStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Observation.ObservationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Observation.ObservationStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(Observation.ObservationStatus.REGISTERED); + break; + case PRELIMINARY: + tgt.setValue(Observation.ObservationStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(Observation.ObservationStatus.FINAL); + break; + case AMENDED: + tgt.setValue(Observation.ObservationStatus.AMENDED); + break; + case CANCELLED: + tgt.setValue(Observation.ObservationStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(Observation.ObservationStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Observation.ObservationStatus.UNKNOWN); + break; + default: + tgt.setValue(Observation.ObservationStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/OperationDefinition10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/OperationDefinition10_30.java index 2958365986..baab091386 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/OperationDefinition10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/OperationDefinition10_30.java @@ -10,6 +10,8 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Integer10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Uri10_30; +import org.hl7.fhir.dstu2.model.Enumeration; +import org.hl7.fhir.dstu2.model.OperationDefinition; import org.hl7.fhir.dstu3.model.Enumerations.SearchParamType; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.utilities.Utilities; @@ -217,78 +219,94 @@ public static org.hl7.fhir.dstu3.model.OperationDefinition.OperationDefinitionPa } static public org.hl7.fhir.dstu2.model.Enumeration convertOperationKind(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.OperationDefinition.OperationKindEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case OPERATION: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationDefinition.OperationKind.OPERATION); - break; - case QUERY: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationDefinition.OperationKind.QUERY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationDefinition.OperationKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new OperationDefinition.OperationKindEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OPERATION: + tgt.setValue(OperationDefinition.OperationKind.OPERATION); + break; + case QUERY: + tgt.setValue(OperationDefinition.OperationKind.QUERY); + break; + default: + tgt.setValue(OperationDefinition.OperationKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertOperationKind(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.OperationDefinition.OperationKindEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case OPERATION: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationDefinition.OperationKind.OPERATION); - break; - case QUERY: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationDefinition.OperationKind.QUERY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationDefinition.OperationKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.OperationDefinition.OperationKindEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OPERATION: + tgt.setValue(org.hl7.fhir.dstu3.model.OperationDefinition.OperationKind.OPERATION); + break; + case QUERY: + tgt.setValue(org.hl7.fhir.dstu3.model.OperationDefinition.OperationKind.QUERY); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.OperationDefinition.OperationKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertOperationParameterUse(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.OperationDefinition.OperationParameterUseEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case IN: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationDefinition.OperationParameterUse.IN); - break; - case OUT: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationDefinition.OperationParameterUse.OUT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationDefinition.OperationParameterUse.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new OperationDefinition.OperationParameterUseEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case IN: + tgt.setValue(OperationDefinition.OperationParameterUse.IN); + break; + case OUT: + tgt.setValue(OperationDefinition.OperationParameterUse.OUT); + break; + default: + tgt.setValue(OperationDefinition.OperationParameterUse.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertOperationParameterUse(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.OperationDefinition.OperationParameterUseEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case IN: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationDefinition.OperationParameterUse.IN); - break; - case OUT: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationDefinition.OperationParameterUse.OUT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationDefinition.OperationParameterUse.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.OperationDefinition.OperationParameterUseEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case IN: + tgt.setValue(org.hl7.fhir.dstu3.model.OperationDefinition.OperationParameterUse.IN); + break; + case OUT: + tgt.setValue(org.hl7.fhir.dstu3.model.OperationDefinition.OperationParameterUse.OUT); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.OperationDefinition.OperationParameterUse.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/OperationOutcome10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/OperationOutcome10_30.java index 1b2ff6aa81..90e8132f02 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/OperationOutcome10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/OperationOutcome10_30.java @@ -3,258 +3,276 @@ import org.hl7.fhir.convertors.context.ConversionContext10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.CodeableConcept10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.OperationOutcome; import org.hl7.fhir.exceptions.FHIRException; public class OperationOutcome10_30 { static public org.hl7.fhir.dstu3.model.Enumeration convertIssueSeverity(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverityEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case FATAL: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverity.FATAL); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverity.ERROR); - break; - case WARNING: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverity.WARNING); - break; - case INFORMATION: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverity.INFORMATION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverity.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new OperationOutcome.IssueSeverityEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FATAL: + tgt.setValue(OperationOutcome.IssueSeverity.FATAL); + break; + case ERROR: + tgt.setValue(OperationOutcome.IssueSeverity.ERROR); + break; + case WARNING: + tgt.setValue(OperationOutcome.IssueSeverity.WARNING); + break; + case INFORMATION: + tgt.setValue(OperationOutcome.IssueSeverity.INFORMATION); + break; + default: + tgt.setValue(OperationOutcome.IssueSeverity.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertIssueSeverity(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverityEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case FATAL: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverity.FATAL); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverity.ERROR); - break; - case WARNING: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverity.WARNING); - break; - case INFORMATION: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverity.INFORMATION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverity.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverityEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FATAL: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverity.FATAL); + break; + case ERROR: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverity.ERROR); + break; + case WARNING: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverity.WARNING); + break; + case INFORMATION: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverity.INFORMATION); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverity.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertIssueType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.OperationOutcome.IssueTypeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case INVALID: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.INVALID); - break; - case STRUCTURE: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.STRUCTURE); - break; - case REQUIRED: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.REQUIRED); - break; - case VALUE: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.VALUE); - break; - case INVARIANT: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.INVARIANT); - break; - case SECURITY: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.SECURITY); - break; - case LOGIN: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.LOGIN); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.UNKNOWN); - break; - case EXPIRED: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.EXPIRED); - break; - case FORBIDDEN: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.FORBIDDEN); - break; - case SUPPRESSED: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.SUPPRESSED); - break; - case PROCESSING: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.PROCESSING); - break; - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.NOTSUPPORTED); - break; - case DUPLICATE: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.DUPLICATE); - break; - case NOTFOUND: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.NOTFOUND); - break; - case TOOLONG: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.TOOLONG); - break; - case CODEINVALID: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.CODEINVALID); - break; - case EXTENSION: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.EXTENSION); - break; - case TOOCOSTLY: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.TOOCOSTLY); - break; - case BUSINESSRULE: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.BUSINESSRULE); - break; - case CONFLICT: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.CONFLICT); - break; - case INCOMPLETE: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.INCOMPLETE); - break; - case TRANSIENT: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.TRANSIENT); - break; - case LOCKERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.LOCKERROR); - break; - case NOSTORE: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.NOSTORE); - break; - case EXCEPTION: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.EXCEPTION); - break; - case TIMEOUT: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.TIMEOUT); - break; - case THROTTLED: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.THROTTLED); - break; - case INFORMATIONAL: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.INFORMATIONAL); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.OperationOutcome.IssueTypeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INVALID: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.INVALID); + break; + case STRUCTURE: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.STRUCTURE); + break; + case REQUIRED: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.REQUIRED); + break; + case VALUE: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.VALUE); + break; + case INVARIANT: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.INVARIANT); + break; + case SECURITY: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.SECURITY); + break; + case LOGIN: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.LOGIN); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.UNKNOWN); + break; + case EXPIRED: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.EXPIRED); + break; + case FORBIDDEN: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.FORBIDDEN); + break; + case SUPPRESSED: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.SUPPRESSED); + break; + case PROCESSING: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.PROCESSING); + break; + case NOTSUPPORTED: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.NOTSUPPORTED); + break; + case DUPLICATE: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.DUPLICATE); + break; + case NOTFOUND: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.NOTFOUND); + break; + case TOOLONG: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.TOOLONG); + break; + case CODEINVALID: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.CODEINVALID); + break; + case EXTENSION: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.EXTENSION); + break; + case TOOCOSTLY: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.TOOCOSTLY); + break; + case BUSINESSRULE: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.BUSINESSRULE); + break; + case CONFLICT: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.CONFLICT); + break; + case INCOMPLETE: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.INCOMPLETE); + break; + case TRANSIENT: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.TRANSIENT); + break; + case LOCKERROR: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.LOCKERROR); + break; + case NOSTORE: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.NOSTORE); + break; + case EXCEPTION: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.EXCEPTION); + break; + case TIMEOUT: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.TIMEOUT); + break; + case THROTTLED: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.THROTTLED); + break; + case INFORMATIONAL: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.INFORMATIONAL); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertIssueType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.OperationOutcome.IssueTypeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case INVALID: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.INVALID); - break; - case STRUCTURE: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.STRUCTURE); - break; - case REQUIRED: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.REQUIRED); - break; - case VALUE: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.VALUE); - break; - case INVARIANT: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.INVARIANT); - break; - case SECURITY: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.SECURITY); - break; - case LOGIN: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.LOGIN); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.UNKNOWN); - break; - case EXPIRED: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.EXPIRED); - break; - case FORBIDDEN: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.FORBIDDEN); - break; - case SUPPRESSED: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.SUPPRESSED); - break; - case PROCESSING: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.PROCESSING); - break; - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.NOTSUPPORTED); - break; - case DUPLICATE: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.DUPLICATE); - break; - case NOTFOUND: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.NOTFOUND); - break; - case TOOLONG: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.TOOLONG); - break; - case CODEINVALID: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.CODEINVALID); - break; - case EXTENSION: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.EXTENSION); - break; - case TOOCOSTLY: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.TOOCOSTLY); - break; - case BUSINESSRULE: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.BUSINESSRULE); - break; - case CONFLICT: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.CONFLICT); - break; - case INCOMPLETE: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.INCOMPLETE); - break; - case TRANSIENT: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.TRANSIENT); - break; - case LOCKERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.LOCKERROR); - break; - case NOSTORE: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.NOSTORE); - break; - case EXCEPTION: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.EXCEPTION); - break; - case TIMEOUT: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.TIMEOUT); - break; - case THROTTLED: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.THROTTLED); - break; - case INFORMATIONAL: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.INFORMATIONAL); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new OperationOutcome.IssueTypeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INVALID: + tgt.setValue(OperationOutcome.IssueType.INVALID); + break; + case STRUCTURE: + tgt.setValue(OperationOutcome.IssueType.STRUCTURE); + break; + case REQUIRED: + tgt.setValue(OperationOutcome.IssueType.REQUIRED); + break; + case VALUE: + tgt.setValue(OperationOutcome.IssueType.VALUE); + break; + case INVARIANT: + tgt.setValue(OperationOutcome.IssueType.INVARIANT); + break; + case SECURITY: + tgt.setValue(OperationOutcome.IssueType.SECURITY); + break; + case LOGIN: + tgt.setValue(OperationOutcome.IssueType.LOGIN); + break; + case UNKNOWN: + tgt.setValue(OperationOutcome.IssueType.UNKNOWN); + break; + case EXPIRED: + tgt.setValue(OperationOutcome.IssueType.EXPIRED); + break; + case FORBIDDEN: + tgt.setValue(OperationOutcome.IssueType.FORBIDDEN); + break; + case SUPPRESSED: + tgt.setValue(OperationOutcome.IssueType.SUPPRESSED); + break; + case PROCESSING: + tgt.setValue(OperationOutcome.IssueType.PROCESSING); + break; + case NOTSUPPORTED: + tgt.setValue(OperationOutcome.IssueType.NOTSUPPORTED); + break; + case DUPLICATE: + tgt.setValue(OperationOutcome.IssueType.DUPLICATE); + break; + case NOTFOUND: + tgt.setValue(OperationOutcome.IssueType.NOTFOUND); + break; + case TOOLONG: + tgt.setValue(OperationOutcome.IssueType.TOOLONG); + break; + case CODEINVALID: + tgt.setValue(OperationOutcome.IssueType.CODEINVALID); + break; + case EXTENSION: + tgt.setValue(OperationOutcome.IssueType.EXTENSION); + break; + case TOOCOSTLY: + tgt.setValue(OperationOutcome.IssueType.TOOCOSTLY); + break; + case BUSINESSRULE: + tgt.setValue(OperationOutcome.IssueType.BUSINESSRULE); + break; + case CONFLICT: + tgt.setValue(OperationOutcome.IssueType.CONFLICT); + break; + case INCOMPLETE: + tgt.setValue(OperationOutcome.IssueType.INCOMPLETE); + break; + case TRANSIENT: + tgt.setValue(OperationOutcome.IssueType.TRANSIENT); + break; + case LOCKERROR: + tgt.setValue(OperationOutcome.IssueType.LOCKERROR); + break; + case NOSTORE: + tgt.setValue(OperationOutcome.IssueType.NOSTORE); + break; + case EXCEPTION: + tgt.setValue(OperationOutcome.IssueType.EXCEPTION); + break; + case TIMEOUT: + tgt.setValue(OperationOutcome.IssueType.TIMEOUT); + break; + case THROTTLED: + tgt.setValue(OperationOutcome.IssueType.THROTTLED); + break; + case INFORMATIONAL: + tgt.setValue(OperationOutcome.IssueType.INFORMATIONAL); + break; + default: + tgt.setValue(OperationOutcome.IssueType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.OperationOutcome convertOperationOutcome(org.hl7.fhir.dstu2.model.OperationOutcome src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Patient10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Patient10_30.java index 832e8cd760..b0986d453f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Patient10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Patient10_30.java @@ -11,6 +11,8 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Period10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Boolean10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Date10_30; +import org.hl7.fhir.dstu2.model.Enumeration; +import org.hl7.fhir.dstu2.model.Patient; import org.hl7.fhir.exceptions.FHIRException; public class Patient10_30 { @@ -88,50 +90,58 @@ public static org.hl7.fhir.dstu2.model.Patient.ContactComponent convertContactCo } static public org.hl7.fhir.dstu2.model.Enumeration convertLinkType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Patient.LinkTypeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case REPLACEDBY: - tgt.setValue(org.hl7.fhir.dstu2.model.Patient.LinkType.REPLACE); - break; - case REPLACES: - tgt.setValue(org.hl7.fhir.dstu2.model.Patient.LinkType.REPLACE); - break; - case REFER: - tgt.setValue(org.hl7.fhir.dstu2.model.Patient.LinkType.REFER); - break; - case SEEALSO: - tgt.setValue(org.hl7.fhir.dstu2.model.Patient.LinkType.SEEALSO); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Patient.LinkType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Patient.LinkTypeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REPLACEDBY: + tgt.setValue(Patient.LinkType.REPLACE); + break; + case REPLACES: + tgt.setValue(Patient.LinkType.REPLACE); + break; + case REFER: + tgt.setValue(Patient.LinkType.REFER); + break; + case SEEALSO: + tgt.setValue(Patient.LinkType.SEEALSO); + break; + default: + tgt.setValue(Patient.LinkType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertLinkType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Patient.LinkTypeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case REPLACE: - tgt.setValue(org.hl7.fhir.dstu3.model.Patient.LinkType.REPLACEDBY); - break; - case REFER: - tgt.setValue(org.hl7.fhir.dstu3.model.Patient.LinkType.REFER); - break; - case SEEALSO: - tgt.setValue(org.hl7.fhir.dstu3.model.Patient.LinkType.SEEALSO); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Patient.LinkType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Patient.LinkTypeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REPLACE: + tgt.setValue(org.hl7.fhir.dstu3.model.Patient.LinkType.REPLACEDBY); + break; + case REFER: + tgt.setValue(org.hl7.fhir.dstu3.model.Patient.LinkType.REFER); + break; + case SEEALSO: + tgt.setValue(org.hl7.fhir.dstu3.model.Patient.LinkType.SEEALSO); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Patient.LinkType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.Patient convertPatient(org.hl7.fhir.dstu2.model.Patient src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Person10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Person10_30.java index c2f7e22a9d..2a4c15a64b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Person10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Person10_30.java @@ -9,58 +9,68 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Identifier10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Boolean10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Date10_30; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.Person; import org.hl7.fhir.exceptions.FHIRException; public class Person10_30 { static public org.hl7.fhir.dstu3.model.Enumeration convertIdentityAssuranceLevel(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Person.IdentityAssuranceLevelEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case LEVEL1: - tgt.setValue(org.hl7.fhir.dstu3.model.Person.IdentityAssuranceLevel.LEVEL1); - break; - case LEVEL2: - tgt.setValue(org.hl7.fhir.dstu3.model.Person.IdentityAssuranceLevel.LEVEL2); - break; - case LEVEL3: - tgt.setValue(org.hl7.fhir.dstu3.model.Person.IdentityAssuranceLevel.LEVEL3); - break; - case LEVEL4: - tgt.setValue(org.hl7.fhir.dstu3.model.Person.IdentityAssuranceLevel.LEVEL4); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Person.IdentityAssuranceLevel.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Person.IdentityAssuranceLevelEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case LEVEL1: + tgt.setValue(Person.IdentityAssuranceLevel.LEVEL1); + break; + case LEVEL2: + tgt.setValue(Person.IdentityAssuranceLevel.LEVEL2); + break; + case LEVEL3: + tgt.setValue(Person.IdentityAssuranceLevel.LEVEL3); + break; + case LEVEL4: + tgt.setValue(Person.IdentityAssuranceLevel.LEVEL4); + break; + default: + tgt.setValue(Person.IdentityAssuranceLevel.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertIdentityAssuranceLevel(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Person.IdentityAssuranceLevelEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case LEVEL1: - tgt.setValue(org.hl7.fhir.dstu2.model.Person.IdentityAssuranceLevel.LEVEL1); - break; - case LEVEL2: - tgt.setValue(org.hl7.fhir.dstu2.model.Person.IdentityAssuranceLevel.LEVEL2); - break; - case LEVEL3: - tgt.setValue(org.hl7.fhir.dstu2.model.Person.IdentityAssuranceLevel.LEVEL3); - break; - case LEVEL4: - tgt.setValue(org.hl7.fhir.dstu2.model.Person.IdentityAssuranceLevel.LEVEL4); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Person.IdentityAssuranceLevel.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Person.IdentityAssuranceLevelEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case LEVEL1: + tgt.setValue(org.hl7.fhir.dstu2.model.Person.IdentityAssuranceLevel.LEVEL1); + break; + case LEVEL2: + tgt.setValue(org.hl7.fhir.dstu2.model.Person.IdentityAssuranceLevel.LEVEL2); + break; + case LEVEL3: + tgt.setValue(org.hl7.fhir.dstu2.model.Person.IdentityAssuranceLevel.LEVEL3); + break; + case LEVEL4: + tgt.setValue(org.hl7.fhir.dstu2.model.Person.IdentityAssuranceLevel.LEVEL4); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Person.IdentityAssuranceLevel.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.Person convertPerson(org.hl7.fhir.dstu2.model.Person src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Procedure10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Procedure10_30.java index decb9e25f4..4a3a5936d9 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Procedure10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Procedure10_30.java @@ -6,6 +6,8 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.CodeableConcept10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Identifier10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Boolean10_30; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.Procedure; import org.hl7.fhir.exceptions.FHIRException; public class Procedure10_30 { @@ -155,52 +157,60 @@ public static org.hl7.fhir.dstu3.model.Procedure.ProcedurePerformerComponent con } static public org.hl7.fhir.dstu3.model.Enumeration convertProcedureStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Procedure.ProcedureStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu3.model.Procedure.ProcedureStatus.INPROGRESS); - break; - case ABORTED: - tgt.setValue(org.hl7.fhir.dstu3.model.Procedure.ProcedureStatus.ABORTED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.Procedure.ProcedureStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Procedure.ProcedureStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Procedure.ProcedureStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Procedure.ProcedureStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(Procedure.ProcedureStatus.INPROGRESS); + break; + case ABORTED: + tgt.setValue(Procedure.ProcedureStatus.ABORTED); + break; + case COMPLETED: + tgt.setValue(Procedure.ProcedureStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(Procedure.ProcedureStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Procedure.ProcedureStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertProcedureStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Procedure.ProcedureStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu2.model.Procedure.ProcedureStatus.INPROGRESS); - break; - case ABORTED: - tgt.setValue(org.hl7.fhir.dstu2.model.Procedure.ProcedureStatus.ABORTED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu2.model.Procedure.ProcedureStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.Procedure.ProcedureStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Procedure.ProcedureStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Procedure.ProcedureStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(org.hl7.fhir.dstu2.model.Procedure.ProcedureStatus.INPROGRESS); + break; + case ABORTED: + tgt.setValue(org.hl7.fhir.dstu2.model.Procedure.ProcedureStatus.ABORTED); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.dstu2.model.Procedure.ProcedureStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu2.model.Procedure.ProcedureStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Procedure.ProcedureStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/ProcedureRequest10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/ProcedureRequest10_30.java index 683320b3f2..0cd1287c1f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/ProcedureRequest10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/ProcedureRequest10_30.java @@ -5,6 +5,8 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.CodeableConcept10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Identifier10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.DateTime10_30; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.ProcedureRequest; import org.hl7.fhir.exceptions.FHIRException; public class ProcedureRequest10_30 { @@ -74,120 +76,136 @@ public static org.hl7.fhir.dstu2.model.ProcedureRequest convertProcedureRequest( } static public org.hl7.fhir.dstu3.model.Enumeration convertProcedureRequestPriority(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestPriorityEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestPriority.URGENT); - break; - case STAT: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestPriority.STAT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestPriority.ASAP); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ProcedureRequest.ProcedureRequestPriorityEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(ProcedureRequest.ProcedureRequestPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(ProcedureRequest.ProcedureRequestPriority.URGENT); + break; + case STAT: + tgt.setValue(ProcedureRequest.ProcedureRequestPriority.STAT); + break; + case ASAP: + tgt.setValue(ProcedureRequest.ProcedureRequestPriority.ASAP); + break; + default: + tgt.setValue(ProcedureRequest.ProcedureRequestPriority.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertProcedureRequestPriority(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ProcedureRequest.ProcedureRequestPriorityEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.dstu2.model.ProcedureRequest.ProcedureRequestPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.dstu2.model.ProcedureRequest.ProcedureRequestPriority.URGENT); - break; - case STAT: - tgt.setValue(org.hl7.fhir.dstu2.model.ProcedureRequest.ProcedureRequestPriority.STAT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.dstu2.model.ProcedureRequest.ProcedureRequestPriority.ASAP); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.ProcedureRequest.ProcedureRequestPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ProcedureRequest.ProcedureRequestPriorityEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(org.hl7.fhir.dstu2.model.ProcedureRequest.ProcedureRequestPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(org.hl7.fhir.dstu2.model.ProcedureRequest.ProcedureRequestPriority.URGENT); + break; + case STAT: + tgt.setValue(org.hl7.fhir.dstu2.model.ProcedureRequest.ProcedureRequestPriority.STAT); + break; + case ASAP: + tgt.setValue(org.hl7.fhir.dstu2.model.ProcedureRequest.ProcedureRequestPriority.ASAP); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.ProcedureRequest.ProcedureRequestPriority.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertProcedureRequestStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ProcedureRequest.ProcedureRequestStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.dstu2.model.ProcedureRequest.ProcedureRequestStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.ProcedureRequest.ProcedureRequestStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu2.model.ProcedureRequest.ProcedureRequestStatus.COMPLETED); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.dstu2.model.ProcedureRequest.ProcedureRequestStatus.SUSPENDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.ProcedureRequest.ProcedureRequestStatus.ABORTED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.ProcedureRequest.ProcedureRequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ProcedureRequest.ProcedureRequestStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(org.hl7.fhir.dstu2.model.ProcedureRequest.ProcedureRequestStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu2.model.ProcedureRequest.ProcedureRequestStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.dstu2.model.ProcedureRequest.ProcedureRequestStatus.COMPLETED); + break; + case SUSPENDED: + tgt.setValue(org.hl7.fhir.dstu2.model.ProcedureRequest.ProcedureRequestStatus.SUSPENDED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu2.model.ProcedureRequest.ProcedureRequestStatus.ABORTED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.ProcedureRequest.ProcedureRequestStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertProcedureRequestStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSED: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestStatus.DRAFT); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestStatus.DRAFT); - break; - case REQUESTED: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestStatus.ACTIVE); - break; - case RECEIVED: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestStatus.ACTIVE); - break; - case ACCEPTED: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestStatus.ACTIVE); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestStatus.ACTIVE); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestStatus.COMPLETED); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestStatus.SUSPENDED); - break; - case ABORTED: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ProcedureRequest.ProcedureRequestStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSED: + tgt.setValue(ProcedureRequest.ProcedureRequestStatus.DRAFT); + break; + case DRAFT: + tgt.setValue(ProcedureRequest.ProcedureRequestStatus.DRAFT); + break; + case REQUESTED: + tgt.setValue(ProcedureRequest.ProcedureRequestStatus.ACTIVE); + break; + case RECEIVED: + tgt.setValue(ProcedureRequest.ProcedureRequestStatus.ACTIVE); + break; + case ACCEPTED: + tgt.setValue(ProcedureRequest.ProcedureRequestStatus.ACTIVE); + break; + case INPROGRESS: + tgt.setValue(ProcedureRequest.ProcedureRequestStatus.ACTIVE); + break; + case COMPLETED: + tgt.setValue(ProcedureRequest.ProcedureRequestStatus.COMPLETED); + break; + case SUSPENDED: + tgt.setValue(ProcedureRequest.ProcedureRequestStatus.SUSPENDED); + break; + case ABORTED: + tgt.setValue(ProcedureRequest.ProcedureRequestStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(ProcedureRequest.ProcedureRequestStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/ProcessRequest10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/ProcessRequest10_30.java index 65e6beb3a0..664815d1df 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/ProcessRequest10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/ProcessRequest10_30.java @@ -2,6 +2,7 @@ import org.hl7.fhir.convertors.context.ConversionContext10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Integer10_30; +import org.hl7.fhir.dstu3.model.ProcessRequest; import org.hl7.fhir.exceptions.FHIRException; public class ProcessRequest10_30 { @@ -28,26 +29,26 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ProcessRequest.ActionListEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.ProcessRequest.ActionList.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CANCEL: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcessRequest.ActionList.CANCEL); - break; - case POLL: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcessRequest.ActionList.POLL); - break; - case REPROCESS: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcessRequest.ActionList.REPROCESS); - break; - case STATUS: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcessRequest.ActionList.STATUS); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcessRequest.ActionList.NULL); - break; - } - } + tgt.setValue(ProcessRequest.ActionList.CANCEL); + break; + case POLL: + tgt.setValue(ProcessRequest.ActionList.POLL); + break; + case REPROCESS: + tgt.setValue(ProcessRequest.ActionList.REPROCESS); + break; + case STATUS: + tgt.setValue(ProcessRequest.ActionList.STATUS); + break; + default: + tgt.setValue(ProcessRequest.ActionList.NULL); + break; + } +} return tgt; } @@ -56,26 +57,26 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ProcessRequest.ActionListEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.ProcessRequest.ActionList.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CANCEL: - tgt.setValue(org.hl7.fhir.dstu2.model.ProcessRequest.ActionList.CANCEL); - break; - case POLL: - tgt.setValue(org.hl7.fhir.dstu2.model.ProcessRequest.ActionList.POLL); - break; - case REPROCESS: - tgt.setValue(org.hl7.fhir.dstu2.model.ProcessRequest.ActionList.REPROCESS); - break; - case STATUS: - tgt.setValue(org.hl7.fhir.dstu2.model.ProcessRequest.ActionList.STATUS); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.ProcessRequest.ActionList.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.ProcessRequest.ActionList.CANCEL); + break; + case POLL: + tgt.setValue(org.hl7.fhir.dstu2.model.ProcessRequest.ActionList.POLL); + break; + case REPROCESS: + tgt.setValue(org.hl7.fhir.dstu2.model.ProcessRequest.ActionList.REPROCESS); + break; + case STATUS: + tgt.setValue(org.hl7.fhir.dstu2.model.ProcessRequest.ActionList.STATUS); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.ProcessRequest.ActionList.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Provenance10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Provenance10_30.java index 0f5a28dada..cbaa4f041e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Provenance10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Provenance10_30.java @@ -6,6 +6,8 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Period10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Signature10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Instant10_30; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.Provenance; import org.hl7.fhir.exceptions.FHIRException; public class Provenance10_30 { @@ -109,52 +111,60 @@ public static org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityComponent conv } static public org.hl7.fhir.dstu3.model.Enumeration convertProvenanceEntityRole(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityRoleEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case DERIVATION: - tgt.setValue(org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityRole.DERIVATION); - break; - case REVISION: - tgt.setValue(org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityRole.REVISION); - break; - case QUOTATION: - tgt.setValue(org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityRole.QUOTATION); - break; - case SOURCE: - tgt.setValue(org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityRole.SOURCE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityRole.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Provenance.ProvenanceEntityRoleEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DERIVATION: + tgt.setValue(Provenance.ProvenanceEntityRole.DERIVATION); + break; + case REVISION: + tgt.setValue(Provenance.ProvenanceEntityRole.REVISION); + break; + case QUOTATION: + tgt.setValue(Provenance.ProvenanceEntityRole.QUOTATION); + break; + case SOURCE: + tgt.setValue(Provenance.ProvenanceEntityRole.SOURCE); + break; + default: + tgt.setValue(Provenance.ProvenanceEntityRole.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertProvenanceEntityRole(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Provenance.ProvenanceEntityRoleEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case DERIVATION: - tgt.setValue(org.hl7.fhir.dstu2.model.Provenance.ProvenanceEntityRole.DERIVATION); - break; - case REVISION: - tgt.setValue(org.hl7.fhir.dstu2.model.Provenance.ProvenanceEntityRole.REVISION); - break; - case QUOTATION: - tgt.setValue(org.hl7.fhir.dstu2.model.Provenance.ProvenanceEntityRole.QUOTATION); - break; - case SOURCE: - tgt.setValue(org.hl7.fhir.dstu2.model.Provenance.ProvenanceEntityRole.SOURCE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Provenance.ProvenanceEntityRole.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Provenance.ProvenanceEntityRoleEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DERIVATION: + tgt.setValue(org.hl7.fhir.dstu2.model.Provenance.ProvenanceEntityRole.DERIVATION); + break; + case REVISION: + tgt.setValue(org.hl7.fhir.dstu2.model.Provenance.ProvenanceEntityRole.REVISION); + break; + case QUOTATION: + tgt.setValue(org.hl7.fhir.dstu2.model.Provenance.ProvenanceEntityRole.QUOTATION); + break; + case SOURCE: + tgt.setValue(org.hl7.fhir.dstu2.model.Provenance.ProvenanceEntityRole.SOURCE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Provenance.ProvenanceEntityRole.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Questionnaire10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Questionnaire10_30.java index 0bfbb16862..f3ea8e7570 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Questionnaire10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Questionnaire10_30.java @@ -8,7 +8,10 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Boolean10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.DateTime10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; +import org.hl7.fhir.dstu2.model.Enumeration; +import org.hl7.fhir.dstu2.model.Questionnaire; import org.hl7.fhir.dstu3.model.ContactDetail; +import org.hl7.fhir.dstu3.model.Enumerations; import org.hl7.fhir.exceptions.FHIRException; public class Questionnaire10_30 { @@ -124,58 +127,62 @@ public static org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemComponent } static public org.hl7.fhir.dstu2.model.Enumeration convertQuestionnaireItemType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Questionnaire.AnswerFormatEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case BOOLEAN: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.AnswerFormat.BOOLEAN); - break; - case DECIMAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.AnswerFormat.DECIMAL); - break; - case INTEGER: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.AnswerFormat.INTEGER); - break; - case DATE: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.AnswerFormat.DATE); - break; - case DATETIME: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.AnswerFormat.DATETIME); - break; - case TIME: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.AnswerFormat.TIME); - break; - case STRING: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.AnswerFormat.STRING); - break; - case TEXT: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.AnswerFormat.TEXT); - break; - case URL: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.AnswerFormat.URL); - break; - case CHOICE: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.AnswerFormat.CHOICE); - break; - case OPENCHOICE: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.AnswerFormat.OPENCHOICE); - break; - case ATTACHMENT: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.AnswerFormat.ATTACHMENT); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.AnswerFormat.REFERENCE); - break; - case QUANTITY: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.AnswerFormat.QUANTITY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.AnswerFormat.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Questionnaire.AnswerFormatEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case BOOLEAN: + tgt.setValue(Questionnaire.AnswerFormat.BOOLEAN); + break; + case DECIMAL: + tgt.setValue(Questionnaire.AnswerFormat.DECIMAL); + break; + case INTEGER: + tgt.setValue(Questionnaire.AnswerFormat.INTEGER); + break; + case DATE: + tgt.setValue(Questionnaire.AnswerFormat.DATE); + break; + case DATETIME: + tgt.setValue(Questionnaire.AnswerFormat.DATETIME); + break; + case TIME: + tgt.setValue(Questionnaire.AnswerFormat.TIME); + break; + case STRING: + tgt.setValue(Questionnaire.AnswerFormat.STRING); + break; + case TEXT: + tgt.setValue(Questionnaire.AnswerFormat.TEXT); + break; + case URL: + tgt.setValue(Questionnaire.AnswerFormat.URL); + break; + case CHOICE: + tgt.setValue(Questionnaire.AnswerFormat.CHOICE); + break; + case OPENCHOICE: + tgt.setValue(Questionnaire.AnswerFormat.OPENCHOICE); + break; + case ATTACHMENT: + tgt.setValue(Questionnaire.AnswerFormat.ATTACHMENT); + break; + case REFERENCE: + tgt.setValue(Questionnaire.AnswerFormat.REFERENCE); + break; + case QUANTITY: + tgt.setValue(Questionnaire.AnswerFormat.QUANTITY); + break; + default: + tgt.setValue(Questionnaire.AnswerFormat.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemComponent convertQuestionnaireQuestionComponent(org.hl7.fhir.dstu2.model.Questionnaire.QuestionComponent src) throws FHIRException { @@ -233,104 +240,116 @@ public static org.hl7.fhir.dstu2.model.Questionnaire.QuestionComponent convertQu } static public org.hl7.fhir.dstu3.model.Enumeration convertQuestionnaireQuestionType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemTypeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case BOOLEAN: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.BOOLEAN); - break; - case DECIMAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.DECIMAL); - break; - case INTEGER: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.INTEGER); - break; - case DATE: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.DATE); - break; - case DATETIME: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.DATETIME); - break; - case INSTANT: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.DATETIME); - break; - case TIME: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.TIME); - break; - case STRING: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.STRING); - break; - case TEXT: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.TEXT); - break; - case URL: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.URL); - break; - case CHOICE: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.CHOICE); - break; - case OPENCHOICE: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.OPENCHOICE); - break; - case ATTACHMENT: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.ATTACHMENT); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.REFERENCE); - break; - case QUANTITY: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.QUANTITY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemTypeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case BOOLEAN: + tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.BOOLEAN); + break; + case DECIMAL: + tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.DECIMAL); + break; + case INTEGER: + tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.INTEGER); + break; + case DATE: + tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.DATE); + break; + case DATETIME: + tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.DATETIME); + break; + case INSTANT: + tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.DATETIME); + break; + case TIME: + tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.TIME); + break; + case STRING: + tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.STRING); + break; + case TEXT: + tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.TEXT); + break; + case URL: + tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.URL); + break; + case CHOICE: + tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.CHOICE); + break; + case OPENCHOICE: + tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.OPENCHOICE); + break; + case ATTACHMENT: + tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.ATTACHMENT); + break; + case REFERENCE: + tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.REFERENCE); + break; + case QUANTITY: + tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.QUANTITY); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertQuestionnaireStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Questionnaire.QuestionnaireStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.QuestionnaireStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.QuestionnaireStatus.PUBLISHED); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.QuestionnaireStatus.RETIRED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.QuestionnaireStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Questionnaire.QuestionnaireStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(Questionnaire.QuestionnaireStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(Questionnaire.QuestionnaireStatus.PUBLISHED); + break; + case RETIRED: + tgt.setValue(Questionnaire.QuestionnaireStatus.RETIRED); + break; + default: + tgt.setValue(Questionnaire.QuestionnaireStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertQuestionnaireStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Enumerations.PublicationStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.DRAFT); - break; - case PUBLISHED: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.ACTIVE); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.RETIRED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new Enumerations.PublicationStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(Enumerations.PublicationStatus.DRAFT); + break; + case PUBLISHED: + tgt.setValue(Enumerations.PublicationStatus.ACTIVE); + break; + case RETIRED: + tgt.setValue(Enumerations.PublicationStatus.RETIRED); + break; + default: + tgt.setValue(Enumerations.PublicationStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/QuestionnaireResponse10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/QuestionnaireResponse10_30.java index da448e322f..e8df3415ba 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/QuestionnaireResponse10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/QuestionnaireResponse10_30.java @@ -5,6 +5,8 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Identifier10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.DateTime10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; +import org.hl7.fhir.dstu2.model.Enumeration; +import org.hl7.fhir.dstu2.model.QuestionnaireResponse; import org.hl7.fhir.exceptions.FHIRException; public class QuestionnaireResponse10_30 { @@ -152,46 +154,54 @@ public static org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireRespon } static public org.hl7.fhir.dstu2.model.Enumeration convertQuestionnaireResponseStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionnaireResponseStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED); + break; + case AMENDED: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED); + break; + default: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertQuestionnaireResponseStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED); + break; + case AMENDED: + tgt.setValue(org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/ReferralRequest10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/ReferralRequest10_30.java index a6711800e4..6cb36a5370 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/ReferralRequest10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/ReferralRequest10_30.java @@ -7,6 +7,8 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Period10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; import org.hl7.fhir.dstu2.model.CodeableConcept; +import org.hl7.fhir.dstu2.model.Enumeration; +import org.hl7.fhir.dstu2.model.ReferralRequest; import org.hl7.fhir.dstu3.model.ReferralRequest.ReferralPriority; import org.hl7.fhir.exceptions.FHIRException; @@ -114,64 +116,72 @@ public static org.hl7.fhir.dstu3.model.ReferralRequest convertReferralRequest(or } static public org.hl7.fhir.dstu2.model.Enumeration convertReferralStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ReferralRequest.ReferralStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.dstu2.model.ReferralRequest.ReferralStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.ReferralRequest.ReferralStatus.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu2.model.ReferralRequest.ReferralStatus.CANCELLED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu2.model.ReferralRequest.ReferralStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.ReferralRequest.ReferralStatus.REJECTED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.ReferralRequest.ReferralStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ReferralRequest.ReferralStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(ReferralRequest.ReferralStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(ReferralRequest.ReferralStatus.ACTIVE); + break; + case CANCELLED: + tgt.setValue(ReferralRequest.ReferralStatus.CANCELLED); + break; + case COMPLETED: + tgt.setValue(ReferralRequest.ReferralStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(ReferralRequest.ReferralStatus.REJECTED); + break; + default: + tgt.setValue(ReferralRequest.ReferralStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertReferralStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ReferralRequest.ReferralRequestStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.dstu3.model.ReferralRequest.ReferralRequestStatus.DRAFT); - break; - case REQUESTED: - tgt.setValue(org.hl7.fhir.dstu3.model.ReferralRequest.ReferralRequestStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.ReferralRequest.ReferralRequestStatus.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu3.model.ReferralRequest.ReferralRequestStatus.CANCELLED); - break; - case ACCEPTED: - tgt.setValue(org.hl7.fhir.dstu3.model.ReferralRequest.ReferralRequestStatus.ACTIVE); - break; - case REJECTED: - tgt.setValue(org.hl7.fhir.dstu3.model.ReferralRequest.ReferralRequestStatus.ENTEREDINERROR); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.ReferralRequest.ReferralRequestStatus.COMPLETED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ReferralRequest.ReferralRequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ReferralRequest.ReferralRequestStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(org.hl7.fhir.dstu3.model.ReferralRequest.ReferralRequestStatus.DRAFT); + break; + case REQUESTED: + tgt.setValue(org.hl7.fhir.dstu3.model.ReferralRequest.ReferralRequestStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu3.model.ReferralRequest.ReferralRequestStatus.ACTIVE); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.dstu3.model.ReferralRequest.ReferralRequestStatus.CANCELLED); + break; + case ACCEPTED: + tgt.setValue(org.hl7.fhir.dstu3.model.ReferralRequest.ReferralRequestStatus.ACTIVE); + break; + case REJECTED: + tgt.setValue(org.hl7.fhir.dstu3.model.ReferralRequest.ReferralRequestStatus.ENTEREDINERROR); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.dstu3.model.ReferralRequest.ReferralRequestStatus.COMPLETED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.ReferralRequest.ReferralRequestStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/SearchParameter10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/SearchParameter10_30.java index f43a2df190..bab41e92ea 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/SearchParameter10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/SearchParameter10_30.java @@ -7,7 +7,10 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.DateTime10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Uri10_30; +import org.hl7.fhir.dstu2.model.Enumerations; import org.hl7.fhir.dstu2.utils.ToolingExtensions; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.SearchParameter; import org.hl7.fhir.exceptions.FHIRException; public class SearchParameter10_30 { @@ -137,31 +140,35 @@ static public org.hl7.fhir.dstu2.model.SearchParameter.XPathUsageType convertXPa } static public org.hl7.fhir.dstu3.model.Enumeration convertXPathUsageType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageTypeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case NORMAL: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageType.NORMAL); - break; - case PHONETIC: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageType.PHONETIC); - break; - case NEARBY: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageType.NEARBY); - break; - case DISTANCE: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageType.DISTANCE); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageType.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new SearchParameter.XPathUsageTypeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NORMAL: + tgt.setValue(SearchParameter.XPathUsageType.NORMAL); + break; + case PHONETIC: + tgt.setValue(SearchParameter.XPathUsageType.PHONETIC); + break; + case NEARBY: + tgt.setValue(SearchParameter.XPathUsageType.NEARBY); + break; + case DISTANCE: + tgt.setValue(SearchParameter.XPathUsageType.DISTANCE); + break; + case OTHER: + tgt.setValue(SearchParameter.XPathUsageType.OTHER); + break; + default: + tgt.setValue(SearchParameter.XPathUsageType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertSearchParamType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { @@ -200,38 +207,38 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Enumerations.SearchParamTypeEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case NUMBER: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.NUMBER); - break; - case DATE: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.DATE); - break; - case STRING: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.STRING); - break; - case TOKEN: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.TOKEN); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.REFERENCE); - break; - case COMPOSITE: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.COMPOSITE); - break; - case QUANTITY: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.QUANTITY); - break; - case URI: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.URI); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.NULL); - break; - } - } + tgt.setValue(Enumerations.SearchParamType.NUMBER); + break; + case DATE: + tgt.setValue(Enumerations.SearchParamType.DATE); + break; + case STRING: + tgt.setValue(Enumerations.SearchParamType.STRING); + break; + case TOKEN: + tgt.setValue(Enumerations.SearchParamType.TOKEN); + break; + case REFERENCE: + tgt.setValue(Enumerations.SearchParamType.REFERENCE); + break; + case COMPOSITE: + tgt.setValue(Enumerations.SearchParamType.COMPOSITE); + break; + case QUANTITY: + tgt.setValue(Enumerations.SearchParamType.QUANTITY); + break; + case URI: + tgt.setValue(Enumerations.SearchParamType.URI); + break; + default: + tgt.setValue(Enumerations.SearchParamType.NULL); + break; + } +} return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Slot10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Slot10_30.java index bd531a2e12..c43dc3c5ad 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Slot10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Slot10_30.java @@ -7,6 +7,7 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Boolean10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Instant10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; +import org.hl7.fhir.dstu3.model.Slot; import org.hl7.fhir.exceptions.FHIRException; public class Slot10_30 { @@ -60,26 +61,26 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Slot.SlotStatusEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Slot.SlotStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case BUSY: - tgt.setValue(org.hl7.fhir.dstu3.model.Slot.SlotStatus.BUSY); - break; - case FREE: - tgt.setValue(org.hl7.fhir.dstu3.model.Slot.SlotStatus.FREE); - break; - case BUSYUNAVAILABLE: - tgt.setValue(org.hl7.fhir.dstu3.model.Slot.SlotStatus.BUSYUNAVAILABLE); - break; - case BUSYTENTATIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Slot.SlotStatus.BUSYTENTATIVE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Slot.SlotStatus.NULL); - break; - } - } + tgt.setValue(Slot.SlotStatus.BUSY); + break; + case FREE: + tgt.setValue(Slot.SlotStatus.FREE); + break; + case BUSYUNAVAILABLE: + tgt.setValue(Slot.SlotStatus.BUSYUNAVAILABLE); + break; + case BUSYTENTATIVE: + tgt.setValue(Slot.SlotStatus.BUSYTENTATIVE); + break; + default: + tgt.setValue(Slot.SlotStatus.NULL); + break; + } +} return tgt; } @@ -88,26 +89,26 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Slot.SlotStatusEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.Slot.SlotStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case BUSY: - tgt.setValue(org.hl7.fhir.dstu2.model.Slot.SlotStatus.BUSY); - break; - case FREE: - tgt.setValue(org.hl7.fhir.dstu2.model.Slot.SlotStatus.FREE); - break; - case BUSYUNAVAILABLE: - tgt.setValue(org.hl7.fhir.dstu2.model.Slot.SlotStatus.BUSYUNAVAILABLE); - break; - case BUSYTENTATIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.Slot.SlotStatus.BUSYTENTATIVE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Slot.SlotStatus.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.Slot.SlotStatus.BUSY); + break; + case FREE: + tgt.setValue(org.hl7.fhir.dstu2.model.Slot.SlotStatus.FREE); + break; + case BUSYUNAVAILABLE: + tgt.setValue(org.hl7.fhir.dstu2.model.Slot.SlotStatus.BUSYUNAVAILABLE); + break; + case BUSYTENTATIVE: + tgt.setValue(org.hl7.fhir.dstu2.model.Slot.SlotStatus.BUSYTENTATIVE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Slot.SlotStatus.NULL); + break; + } +} return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/StructureDefinition10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/StructureDefinition10_30.java index 9c528d0155..f7c7dd7167 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/StructureDefinition10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/StructureDefinition10_30.java @@ -16,6 +16,8 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Id10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Uri10_30; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.StructureDefinition; import org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKind; import org.hl7.fhir.dstu3.model.StructureDefinition.TypeDerivationRule; import org.hl7.fhir.exceptions.FHIRException; @@ -24,47 +26,55 @@ public class StructureDefinition10_30 { static public org.hl7.fhir.dstu3.model.Enumeration convertExtensionContext(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContextEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case RESOURCE: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContext.RESOURCE); - break; - case DATATYPE: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContext.DATATYPE); - break; - case EXTENSION: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContext.EXTENSION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContext.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureDefinition.ExtensionContextEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case RESOURCE: + tgt.setValue(StructureDefinition.ExtensionContext.RESOURCE); + break; + case DATATYPE: + tgt.setValue(StructureDefinition.ExtensionContext.DATATYPE); + break; + case EXTENSION: + tgt.setValue(StructureDefinition.ExtensionContext.EXTENSION); + break; + default: + tgt.setValue(StructureDefinition.ExtensionContext.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertExtensionContext(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.StructureDefinition.ExtensionContextEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case RESOURCE: - tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.ExtensionContext.RESOURCE); - break; - case DATATYPE: - tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.ExtensionContext.DATATYPE); - break; - case EXTENSION: - tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.ExtensionContext.EXTENSION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.ExtensionContext.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.StructureDefinition.ExtensionContextEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case RESOURCE: + tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.ExtensionContext.RESOURCE); + break; + case DATATYPE: + tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.ExtensionContext.DATATYPE); + break; + case EXTENSION: + tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.ExtensionContext.EXTENSION); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.ExtensionContext.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2.model.StructureDefinition convertStructureDefinition(org.hl7.fhir.dstu3.model.StructureDefinition src) throws FHIRException { @@ -256,55 +266,63 @@ public static org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionDi } static public org.hl7.fhir.dstu2.model.Enumeration convertStructureDefinitionKind(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionKindEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case PRIMITIVETYPE: - tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionKind.DATATYPE); - break; - case COMPLEXTYPE: - tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionKind.DATATYPE); - break; - case RESOURCE: - tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionKind.RESOURCE); - break; - case LOGICAL: - tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionKind.LOGICAL); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionKindEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRIMITIVETYPE: + tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionKind.DATATYPE); + break; + case COMPLEXTYPE: + tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionKind.DATATYPE); + break; + case RESOURCE: + tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionKind.RESOURCE); + break; + case LOGICAL: + tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionKind.LOGICAL); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionKind.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.Enumeration convertStructureDefinitionKind(org.hl7.fhir.dstu2.model.Enumeration src, String dtName) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKindEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case DATATYPE: - if (Utilities.existsInList(dtName, "boolean", "integer", "decimal", "base64Binary", "instant", - "string", "uri", "date", "dateTime", "time", "code", "oid", "uuid", "id", "unsignedInt", - "positiveInt", "markdown", "xhtml", "url", "canonical")) - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKind.PRIMITIVETYPE); - else - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKind.COMPLEXTYPE); - break; - case RESOURCE: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKind.RESOURCE); - break; - case LOGICAL: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKind.LOGICAL); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureDefinition.StructureDefinitionKindEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DATATYPE: + if (Utilities.existsInList(dtName, "boolean", "integer", "decimal", "base64Binary", "instant", + "string", "uri", "date", "dateTime", "time", "code", "oid", "uuid", "id", "unsignedInt", + "positiveInt", "markdown", "xhtml", "url", "canonical")) + tgt.setValue(StructureDefinitionKind.PRIMITIVETYPE); + else + tgt.setValue(StructureDefinitionKind.COMPLEXTYPE); + break; + case RESOURCE: + tgt.setValue(StructureDefinitionKind.RESOURCE); + break; + case LOGICAL: + tgt.setValue(StructureDefinitionKind.LOGICAL); + break; + default: + tgt.setValue(StructureDefinitionKind.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionMappingComponent convertStructureDefinitionMappingComponent(org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionMappingComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Subscription10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Subscription10_30.java index 88dfba6cb1..79855c95ba 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Subscription10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Subscription10_30.java @@ -6,6 +6,8 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Instant10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Uri10_30; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.Subscription; import org.hl7.fhir.exceptions.FHIRException; public class Subscription10_30 { @@ -88,108 +90,124 @@ public static org.hl7.fhir.dstu3.model.Subscription.SubscriptionChannelComponent } static public org.hl7.fhir.dstu3.model.Enumeration convertSubscriptionChannelType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Subscription.SubscriptionChannelTypeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case RESTHOOK: - tgt.setValue(org.hl7.fhir.dstu3.model.Subscription.SubscriptionChannelType.RESTHOOK); - break; - case WEBSOCKET: - tgt.setValue(org.hl7.fhir.dstu3.model.Subscription.SubscriptionChannelType.WEBSOCKET); - break; - case EMAIL: - tgt.setValue(org.hl7.fhir.dstu3.model.Subscription.SubscriptionChannelType.EMAIL); - break; - case SMS: - tgt.setValue(org.hl7.fhir.dstu3.model.Subscription.SubscriptionChannelType.SMS); - break; - case MESSAGE: - tgt.setValue(org.hl7.fhir.dstu3.model.Subscription.SubscriptionChannelType.MESSAGE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Subscription.SubscriptionChannelType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Subscription.SubscriptionChannelTypeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case RESTHOOK: + tgt.setValue(Subscription.SubscriptionChannelType.RESTHOOK); + break; + case WEBSOCKET: + tgt.setValue(Subscription.SubscriptionChannelType.WEBSOCKET); + break; + case EMAIL: + tgt.setValue(Subscription.SubscriptionChannelType.EMAIL); + break; + case SMS: + tgt.setValue(Subscription.SubscriptionChannelType.SMS); + break; + case MESSAGE: + tgt.setValue(Subscription.SubscriptionChannelType.MESSAGE); + break; + default: + tgt.setValue(Subscription.SubscriptionChannelType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertSubscriptionChannelType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelTypeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case RESTHOOK: - tgt.setValue(org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType.RESTHOOK); - break; - case WEBSOCKET: - tgt.setValue(org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType.WEBSOCKET); - break; - case EMAIL: - tgt.setValue(org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType.EMAIL); - break; - case SMS: - tgt.setValue(org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType.SMS); - break; - case MESSAGE: - tgt.setValue(org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType.MESSAGE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelTypeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case RESTHOOK: + tgt.setValue(org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType.RESTHOOK); + break; + case WEBSOCKET: + tgt.setValue(org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType.WEBSOCKET); + break; + case EMAIL: + tgt.setValue(org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType.EMAIL); + break; + case SMS: + tgt.setValue(org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType.SMS); + break; + case MESSAGE: + tgt.setValue(org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType.MESSAGE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertSubscriptionStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Subscription.SubscriptionStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case REQUESTED: - tgt.setValue(org.hl7.fhir.dstu3.model.Subscription.SubscriptionStatus.REQUESTED); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Subscription.SubscriptionStatus.ACTIVE); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Subscription.SubscriptionStatus.ERROR); - break; - case OFF: - tgt.setValue(org.hl7.fhir.dstu3.model.Subscription.SubscriptionStatus.OFF); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Subscription.SubscriptionStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Subscription.SubscriptionStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REQUESTED: + tgt.setValue(Subscription.SubscriptionStatus.REQUESTED); + break; + case ACTIVE: + tgt.setValue(Subscription.SubscriptionStatus.ACTIVE); + break; + case ERROR: + tgt.setValue(Subscription.SubscriptionStatus.ERROR); + break; + case OFF: + tgt.setValue(Subscription.SubscriptionStatus.OFF); + break; + default: + tgt.setValue(Subscription.SubscriptionStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertSubscriptionStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Subscription.SubscriptionStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case REQUESTED: - tgt.setValue(org.hl7.fhir.dstu2.model.Subscription.SubscriptionStatus.REQUESTED); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.Subscription.SubscriptionStatus.ACTIVE); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.Subscription.SubscriptionStatus.ERROR); - break; - case OFF: - tgt.setValue(org.hl7.fhir.dstu2.model.Subscription.SubscriptionStatus.OFF); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Subscription.SubscriptionStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Subscription.SubscriptionStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REQUESTED: + tgt.setValue(org.hl7.fhir.dstu2.model.Subscription.SubscriptionStatus.REQUESTED); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu2.model.Subscription.SubscriptionStatus.ACTIVE); + break; + case ERROR: + tgt.setValue(org.hl7.fhir.dstu2.model.Subscription.SubscriptionStatus.ERROR); + break; + case OFF: + tgt.setValue(org.hl7.fhir.dstu2.model.Subscription.SubscriptionStatus.OFF); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Subscription.SubscriptionStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/SupplyDelivery10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/SupplyDelivery10_30.java index 0e5d0f66ef..ee7aa3d7cf 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/SupplyDelivery10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/SupplyDelivery10_30.java @@ -4,6 +4,8 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.CodeableConcept10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Identifier10_30; +import org.hl7.fhir.dstu2.model.Enumeration; +import org.hl7.fhir.dstu2.model.SupplyDelivery; import org.hl7.fhir.exceptions.FHIRException; public class SupplyDelivery10_30 { @@ -51,46 +53,54 @@ public static org.hl7.fhir.dstu2.model.SupplyDelivery convertSupplyDelivery(org. } static public org.hl7.fhir.dstu2.model.Enumeration convertSupplyDeliveryStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.SupplyDelivery.SupplyDeliveryStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu2.model.SupplyDelivery.SupplyDeliveryStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu2.model.SupplyDelivery.SupplyDeliveryStatus.COMPLETED); - break; - case ABANDONED: - tgt.setValue(org.hl7.fhir.dstu2.model.SupplyDelivery.SupplyDeliveryStatus.ABANDONED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.SupplyDelivery.SupplyDeliveryStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new SupplyDelivery.SupplyDeliveryStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(SupplyDelivery.SupplyDeliveryStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(SupplyDelivery.SupplyDeliveryStatus.COMPLETED); + break; + case ABANDONED: + tgt.setValue(SupplyDelivery.SupplyDeliveryStatus.ABANDONED); + break; + default: + tgt.setValue(SupplyDelivery.SupplyDeliveryStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertSupplyDeliveryStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.SupplyDelivery.SupplyDeliveryStatusEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu3.model.SupplyDelivery.SupplyDeliveryStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.SupplyDelivery.SupplyDeliveryStatus.COMPLETED); - break; - case ABANDONED: - tgt.setValue(org.hl7.fhir.dstu3.model.SupplyDelivery.SupplyDeliveryStatus.ABANDONED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.SupplyDelivery.SupplyDeliveryStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.SupplyDelivery.SupplyDeliveryStatusEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(org.hl7.fhir.dstu3.model.SupplyDelivery.SupplyDeliveryStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.dstu3.model.SupplyDelivery.SupplyDeliveryStatus.COMPLETED); + break; + case ABANDONED: + tgt.setValue(org.hl7.fhir.dstu3.model.SupplyDelivery.SupplyDeliveryStatus.ABANDONED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.SupplyDelivery.SupplyDeliveryStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/SupplyRequest10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/SupplyRequest10_30.java index 8539cdb99e..1471e1c1e3 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/SupplyRequest10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/SupplyRequest10_30.java @@ -1,6 +1,7 @@ package org.hl7.fhir.convertors.conv10_30.resources10_30; import org.hl7.fhir.convertors.context.ConversionContext10_30; +import org.hl7.fhir.dstu3.model.SupplyRequest; import org.hl7.fhir.exceptions.FHIRException; public class SupplyRequest10_30 { @@ -25,26 +26,26 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.SupplyRequest.SupplyRequestStatusEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.SupplyRequest.SupplyRequestStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case REQUESTED: - tgt.setValue(org.hl7.fhir.dstu3.model.SupplyRequest.SupplyRequestStatus.ACTIVE); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.SupplyRequest.SupplyRequestStatus.COMPLETED); - break; - case FAILED: - tgt.setValue(org.hl7.fhir.dstu3.model.SupplyRequest.SupplyRequestStatus.CANCELLED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu3.model.SupplyRequest.SupplyRequestStatus.CANCELLED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.SupplyRequest.SupplyRequestStatus.NULL); - break; - } - } + tgt.setValue(SupplyRequest.SupplyRequestStatus.ACTIVE); + break; + case COMPLETED: + tgt.setValue(SupplyRequest.SupplyRequestStatus.COMPLETED); + break; + case FAILED: + tgt.setValue(SupplyRequest.SupplyRequestStatus.CANCELLED); + break; + case CANCELLED: + tgt.setValue(SupplyRequest.SupplyRequestStatus.CANCELLED); + break; + default: + tgt.setValue(SupplyRequest.SupplyRequestStatus.NULL); + break; + } +} return tgt; } @@ -53,23 +54,23 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.SupplyRequest.SupplyRequestStatusEnumFactory()); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.SupplyRequest.SupplyRequestStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.SupplyRequest.SupplyRequestStatus.REQUESTED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu2.model.SupplyRequest.SupplyRequestStatus.COMPLETED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu2.model.SupplyRequest.SupplyRequestStatus.CANCELLED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.SupplyRequest.SupplyRequestStatus.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.SupplyRequest.SupplyRequestStatus.REQUESTED); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.dstu2.model.SupplyRequest.SupplyRequestStatus.COMPLETED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.dstu2.model.SupplyRequest.SupplyRequestStatus.CANCELLED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.SupplyRequest.SupplyRequestStatus.NULL); + break; + } +} return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/TestScript10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/TestScript10_30.java index 6fd5c5c7ab..bf9146e010 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/TestScript10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/TestScript10_30.java @@ -14,268 +14,302 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Integer10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Uri10_30; +import org.hl7.fhir.dstu2.model.Enumeration; +import org.hl7.fhir.dstu2.model.TestScript; import org.hl7.fhir.exceptions.FHIRException; public class TestScript10_30 { static public org.hl7.fhir.dstu2.model.Enumeration convertAssertionDirectionType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.TestScript.AssertionDirectionTypeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case RESPONSE: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionDirectionType.RESPONSE); - break; - case REQUEST: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionDirectionType.REQUEST); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionDirectionType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new TestScript.AssertionDirectionTypeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case RESPONSE: + tgt.setValue(TestScript.AssertionDirectionType.RESPONSE); + break; + case REQUEST: + tgt.setValue(TestScript.AssertionDirectionType.REQUEST); + break; + default: + tgt.setValue(TestScript.AssertionDirectionType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertAssertionDirectionType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionTypeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case RESPONSE: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType.RESPONSE); - break; - case REQUEST: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType.REQUEST); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionTypeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case RESPONSE: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType.RESPONSE); + break; + case REQUEST: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType.REQUEST); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertAssertionOperatorType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorTypeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case EQUALS: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.EQUALS); - break; - case NOTEQUALS: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTEQUALS); - break; - case IN: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTIN); - break; - case GREATERTHAN: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.GREATERTHAN); - break; - case LESSTHAN: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.LESSTHAN); - break; - case EMPTY: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.EMPTY); - break; - case NOTEMPTY: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTEMPTY); - break; - case CONTAINS: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.CONTAINS); - break; - case NOTCONTAINS: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTCONTAINS); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorTypeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUALS: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.EQUALS); + break; + case NOTEQUALS: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTEQUALS); + break; + case IN: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.IN); + break; + case NOTIN: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTIN); + break; + case GREATERTHAN: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.GREATERTHAN); + break; + case LESSTHAN: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.LESSTHAN); + break; + case EMPTY: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.EMPTY); + break; + case NOTEMPTY: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTEMPTY); + break; + case CONTAINS: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.CONTAINS); + break; + case NOTCONTAINS: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTCONTAINS); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertAssertionOperatorType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorTypeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case EQUALS: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.EQUALS); - break; - case NOTEQUALS: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.NOTEQUALS); - break; - case IN: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.NOTIN); - break; - case GREATERTHAN: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.GREATERTHAN); - break; - case LESSTHAN: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.LESSTHAN); - break; - case EMPTY: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.EMPTY); - break; - case NOTEMPTY: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.NOTEMPTY); - break; - case CONTAINS: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.CONTAINS); - break; - case NOTCONTAINS: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.NOTCONTAINS); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new TestScript.AssertionOperatorTypeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUALS: + tgt.setValue(TestScript.AssertionOperatorType.EQUALS); + break; + case NOTEQUALS: + tgt.setValue(TestScript.AssertionOperatorType.NOTEQUALS); + break; + case IN: + tgt.setValue(TestScript.AssertionOperatorType.IN); + break; + case NOTIN: + tgt.setValue(TestScript.AssertionOperatorType.NOTIN); + break; + case GREATERTHAN: + tgt.setValue(TestScript.AssertionOperatorType.GREATERTHAN); + break; + case LESSTHAN: + tgt.setValue(TestScript.AssertionOperatorType.LESSTHAN); + break; + case EMPTY: + tgt.setValue(TestScript.AssertionOperatorType.EMPTY); + break; + case NOTEMPTY: + tgt.setValue(TestScript.AssertionOperatorType.NOTEMPTY); + break; + case CONTAINS: + tgt.setValue(TestScript.AssertionOperatorType.CONTAINS); + break; + case NOTCONTAINS: + tgt.setValue(TestScript.AssertionOperatorType.NOTCONTAINS); + break; + default: + tgt.setValue(TestScript.AssertionOperatorType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertAssertionResponseTypes(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypesEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case OKAY: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.OKAY); - break; - case CREATED: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.CREATED); - break; - case NOCONTENT: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.NOCONTENT); - break; - case NOTMODIFIED: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.NOTMODIFIED); - break; - case BAD: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.BAD); - break; - case FORBIDDEN: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.FORBIDDEN); - break; - case NOTFOUND: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.NOTFOUND); - break; - case METHODNOTALLOWED: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.METHODNOTALLOWED); - break; - case CONFLICT: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.CONFLICT); - break; - case GONE: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.GONE); - break; - case PRECONDITIONFAILED: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.PRECONDITIONFAILED); - break; - case UNPROCESSABLE: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.UNPROCESSABLE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new TestScript.AssertionResponseTypesEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OKAY: + tgt.setValue(TestScript.AssertionResponseTypes.OKAY); + break; + case CREATED: + tgt.setValue(TestScript.AssertionResponseTypes.CREATED); + break; + case NOCONTENT: + tgt.setValue(TestScript.AssertionResponseTypes.NOCONTENT); + break; + case NOTMODIFIED: + tgt.setValue(TestScript.AssertionResponseTypes.NOTMODIFIED); + break; + case BAD: + tgt.setValue(TestScript.AssertionResponseTypes.BAD); + break; + case FORBIDDEN: + tgt.setValue(TestScript.AssertionResponseTypes.FORBIDDEN); + break; + case NOTFOUND: + tgt.setValue(TestScript.AssertionResponseTypes.NOTFOUND); + break; + case METHODNOTALLOWED: + tgt.setValue(TestScript.AssertionResponseTypes.METHODNOTALLOWED); + break; + case CONFLICT: + tgt.setValue(TestScript.AssertionResponseTypes.CONFLICT); + break; + case GONE: + tgt.setValue(TestScript.AssertionResponseTypes.GONE); + break; + case PRECONDITIONFAILED: + tgt.setValue(TestScript.AssertionResponseTypes.PRECONDITIONFAILED); + break; + case UNPROCESSABLE: + tgt.setValue(TestScript.AssertionResponseTypes.UNPROCESSABLE); + break; + default: + tgt.setValue(TestScript.AssertionResponseTypes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertAssertionResponseTypes(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypesEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case OKAY: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.OKAY); - break; - case CREATED: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.CREATED); - break; - case NOCONTENT: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NOCONTENT); - break; - case NOTMODIFIED: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NOTMODIFIED); - break; - case BAD: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.BAD); - break; - case FORBIDDEN: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.FORBIDDEN); - break; - case NOTFOUND: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NOTFOUND); - break; - case METHODNOTALLOWED: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.METHODNOTALLOWED); - break; - case CONFLICT: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.CONFLICT); - break; - case GONE: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.GONE); - break; - case PRECONDITIONFAILED: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.PRECONDITIONFAILED); - break; - case UNPROCESSABLE: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.UNPROCESSABLE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypesEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OKAY: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.OKAY); + break; + case CREATED: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.CREATED); + break; + case NOCONTENT: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NOCONTENT); + break; + case NOTMODIFIED: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NOTMODIFIED); + break; + case BAD: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.BAD); + break; + case FORBIDDEN: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.FORBIDDEN); + break; + case NOTFOUND: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NOTFOUND); + break; + case METHODNOTALLOWED: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.METHODNOTALLOWED); + break; + case CONFLICT: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.CONFLICT); + break; + case GONE: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.GONE); + break; + case PRECONDITIONFAILED: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.PRECONDITIONFAILED); + break; + case UNPROCESSABLE: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.UNPROCESSABLE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertContentType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.TestScript.ContentTypeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case XML: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.ContentType.XML); - break; - case JSON: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.ContentType.JSON); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.ContentType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new TestScript.ContentTypeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case XML: + tgt.setValue(TestScript.ContentType.XML); + break; + case JSON: + tgt.setValue(TestScript.ContentType.JSON); + break; + default: + tgt.setValue(TestScript.ContentType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertContentType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestScript.ContentTypeEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case XML: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.ContentType.XML); - break; - case JSON: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.ContentType.JSON); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.ContentType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestScript.ContentTypeEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case XML: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.ContentType.XML); + break; + case JSON: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.ContentType.JSON); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.ContentType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.TestScript.SetupActionAssertComponent convertSetupActionAssertComponent(org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionAssertComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/ValueSet10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/ValueSet10_30.java index 937e14c919..cda82f9032 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/ValueSet10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/ValueSet10_30.java @@ -19,6 +19,7 @@ import org.hl7.fhir.dstu3.model.CodeSystem; import org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemContentMode; import org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.dstu3.terminologies.CodeSystemUtilities; import org.hl7.fhir.exceptions.FHIRException; @@ -141,65 +142,73 @@ public static org.hl7.fhir.dstu2.model.ValueSet.ConceptSetFilterComponent conver } static public org.hl7.fhir.dstu3.model.Enumeration convertFilterOperator(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ValueSet.FilterOperatorEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case EQUAL: - tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.EQUAL); - break; - case ISA: - tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.ISA); - break; - case ISNOTA: - tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.ISNOTA); - break; - case REGEX: - tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.REGEX); - break; - case IN: - tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.NOTIN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new org.hl7.fhir.dstu3.model.ValueSet.FilterOperatorEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUAL: + tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.EQUAL); + break; + case ISA: + tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.ISA); + break; + case ISNOTA: + tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.ISNOTA); + break; + case REGEX: + tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.REGEX); + break; + case IN: + tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.IN); + break; + case NOTIN: + tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.NOTIN); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertFilterOperator(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ValueSet.FilterOperatorEnumFactory()); - ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); - switch (src.getValue()) { - case EQUAL: - tgt.setValue(org.hl7.fhir.dstu2.model.ValueSet.FilterOperator.EQUAL); - break; - case ISA: - tgt.setValue(org.hl7.fhir.dstu2.model.ValueSet.FilterOperator.ISA); - break; - case ISNOTA: - tgt.setValue(org.hl7.fhir.dstu2.model.ValueSet.FilterOperator.ISNOTA); - break; - case REGEX: - tgt.setValue(org.hl7.fhir.dstu2.model.ValueSet.FilterOperator.REGEX); - break; - case IN: - tgt.setValue(org.hl7.fhir.dstu2.model.ValueSet.FilterOperator.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.dstu2.model.ValueSet.FilterOperator.NOTIN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.ValueSet.FilterOperator.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new ValueSet.FilterOperatorEnumFactory()); + ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUAL: + tgt.setValue(ValueSet.FilterOperator.EQUAL); + break; + case ISA: + tgt.setValue(ValueSet.FilterOperator.ISA); + break; + case ISNOTA: + tgt.setValue(ValueSet.FilterOperator.ISNOTA); + break; + case REGEX: + tgt.setValue(ValueSet.FilterOperator.REGEX); + break; + case IN: + tgt.setValue(ValueSet.FilterOperator.IN); + break; + case NOTIN: + tgt.setValue(ValueSet.FilterOperator.NOTIN); + break; + default: + tgt.setValue(ValueSet.FilterOperator.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.ValueSet convertValueSet(org.hl7.fhir.dstu2.model.ValueSet src, BaseAdvisor_10_30 advisor) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/datatypes10_40/ElementDefinition10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/datatypes10_40/ElementDefinition10_40.java index 8e3b4990bc..3e7d4ae2cc 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/datatypes10_40/ElementDefinition10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/datatypes10_40/ElementDefinition10_40.java @@ -16,6 +16,7 @@ import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4.conformance.ProfileUtilities; import org.hl7.fhir.r4.model.ElementDefinition; +import org.hl7.fhir.r4.model.Enumerations; import org.hl7.fhir.utilities.Utilities; public class ElementDefinition10_40 { @@ -134,17 +135,17 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ElementDefinition.PropertyRepresentationEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.PropertyRepresentation.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case XMLATTR: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.PropertyRepresentation.XMLATTR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.PropertyRepresentation.NULL); - break; - } - } + tgt.setValue(ElementDefinition.PropertyRepresentation.XMLATTR); + break; + default: + tgt.setValue(ElementDefinition.PropertyRepresentation.NULL); + break; + } +} return tgt; } @@ -153,17 +154,17 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ElementDefinition.PropertyRepresentationEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.PropertyRepresentation.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case XMLATTR: - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.PropertyRepresentation.XMLATTR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.PropertyRepresentation.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.PropertyRepresentation.XMLATTR); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.PropertyRepresentation.NULL); + break; + } +} return tgt; } @@ -215,23 +216,23 @@ static public org.hl7.fhir.r4.model.Enumeration org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new ElementDefinition.SlicingRulesEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(ElementDefinition.SlicingRules.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CLOSED: - tgt.setValue(ElementDefinition.SlicingRules.CLOSED); - break; - case OPEN: - tgt.setValue(ElementDefinition.SlicingRules.OPEN); - break; - case OPENATEND: - tgt.setValue(ElementDefinition.SlicingRules.OPENATEND); - break; - default: - tgt.setValue(ElementDefinition.SlicingRules.NULL); - break; - } - } + tgt.setValue(ElementDefinition.SlicingRules.CLOSED); + break; + case OPEN: + tgt.setValue(ElementDefinition.SlicingRules.OPEN); + break; + case OPENATEND: + tgt.setValue(ElementDefinition.SlicingRules.OPENATEND); + break; + default: + tgt.setValue(ElementDefinition.SlicingRules.NULL); + break; + } +} return tgt; } @@ -240,23 +241,23 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRulesEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CLOSED: - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules.CLOSED); - break; - case OPEN: - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules.OPEN); - break; - case OPENATEND: - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules.OPENATEND); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules.CLOSED); + break; + case OPEN: + tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules.OPEN); + break; + case OPENATEND: + tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules.OPENATEND); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules.NULL); + break; + } +} return tgt; } @@ -325,23 +326,23 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new ElementDefinition.AggregationModeEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(ElementDefinition.AggregationMode.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CONTAINED: - tgt.setValue(ElementDefinition.AggregationMode.CONTAINED); - break; - case REFERENCED: - tgt.setValue(ElementDefinition.AggregationMode.REFERENCED); - break; - case BUNDLED: - tgt.setValue(ElementDefinition.AggregationMode.BUNDLED); - break; - default: - tgt.setValue(ElementDefinition.AggregationMode.NULL); - break; - } - } + tgt.setValue(ElementDefinition.AggregationMode.CONTAINED); + break; + case REFERENCED: + tgt.setValue(ElementDefinition.AggregationMode.REFERENCED); + break; + case BUNDLED: + tgt.setValue(ElementDefinition.AggregationMode.BUNDLED); + break; + default: + tgt.setValue(ElementDefinition.AggregationMode.NULL); + break; + } +} return tgt; } @@ -350,23 +351,23 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ElementDefinition.AggregationModeEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CONTAINED: - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode.CONTAINED); - break; - case REFERENCED: - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode.REFERENCED); - break; - case BUNDLED: - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode.BUNDLED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode.CONTAINED); + break; + case REFERENCED: + tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode.REFERENCED); + break; + case BUNDLED: + tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode.BUNDLED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode.NULL); + break; + } +} return tgt; } @@ -404,20 +405,20 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new ElementDefinition.ConstraintSeverityEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(ElementDefinition.ConstraintSeverity.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case ERROR: - tgt.setValue(ElementDefinition.ConstraintSeverity.ERROR); - break; - case WARNING: - tgt.setValue(ElementDefinition.ConstraintSeverity.WARNING); - break; - default: - tgt.setValue(ElementDefinition.ConstraintSeverity.NULL); - break; - } - } + tgt.setValue(ElementDefinition.ConstraintSeverity.ERROR); + break; + case WARNING: + tgt.setValue(ElementDefinition.ConstraintSeverity.WARNING); + break; + default: + tgt.setValue(ElementDefinition.ConstraintSeverity.NULL); + break; + } +} return tgt; } @@ -426,20 +427,20 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ElementDefinition.ConstraintSeverityEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.ConstraintSeverity.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case ERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.ConstraintSeverity.ERROR); - break; - case WARNING: - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.ConstraintSeverity.WARNING); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.ConstraintSeverity.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.ConstraintSeverity.ERROR); + break; + case WARNING: + tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.ConstraintSeverity.WARNING); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.ConstraintSeverity.NULL); + break; + } +} return tgt; } @@ -478,26 +479,26 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.BindingStrengthEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.BindingStrength.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case REQUIRED: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.BindingStrength.REQUIRED); - break; - case EXTENSIBLE: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.BindingStrength.EXTENSIBLE); - break; - case PREFERRED: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.BindingStrength.PREFERRED); - break; - case EXAMPLE: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.BindingStrength.EXAMPLE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.BindingStrength.NULL); - break; - } - } + tgt.setValue(Enumerations.BindingStrength.REQUIRED); + break; + case EXTENSIBLE: + tgt.setValue(Enumerations.BindingStrength.EXTENSIBLE); + break; + case PREFERRED: + tgt.setValue(Enumerations.BindingStrength.PREFERRED); + break; + case EXAMPLE: + tgt.setValue(Enumerations.BindingStrength.EXAMPLE); + break; + default: + tgt.setValue(Enumerations.BindingStrength.NULL); + break; + } +} return tgt; } @@ -506,26 +507,26 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Enumerations.BindingStrengthEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case REQUIRED: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.REQUIRED); - break; - case EXTENSIBLE: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.EXTENSIBLE); - break; - case PREFERRED: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.PREFERRED); - break; - case EXAMPLE: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.EXAMPLE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.REQUIRED); + break; + case EXTENSIBLE: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.EXTENSIBLE); + break; + case PREFERRED: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.PREFERRED); + break; + case EXAMPLE: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.EXAMPLE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.NULL); + break; + } +} return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/datatypes10_40/Narrative10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/datatypes10_40/Narrative10_40.java index 3ac26bfc42..664abe853b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/datatypes10_40/Narrative10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/datatypes10_40/Narrative10_40.java @@ -2,6 +2,7 @@ import org.hl7.fhir.convertors.context.ConversionContext10_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Narrative; public class Narrative10_40 { public static org.hl7.fhir.r4.model.Narrative convertNarrative(org.hl7.fhir.dstu2.model.Narrative src) throws FHIRException { @@ -27,26 +28,26 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Narrative.NarrativeStatusEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Narrative.NarrativeStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case GENERATED: - tgt.setValue(org.hl7.fhir.r4.model.Narrative.NarrativeStatus.GENERATED); - break; - case EXTENSIONS: - tgt.setValue(org.hl7.fhir.r4.model.Narrative.NarrativeStatus.EXTENSIONS); - break; - case ADDITIONAL: - tgt.setValue(org.hl7.fhir.r4.model.Narrative.NarrativeStatus.ADDITIONAL); - break; - case EMPTY: - tgt.setValue(org.hl7.fhir.r4.model.Narrative.NarrativeStatus.EMPTY); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Narrative.NarrativeStatus.NULL); - break; - } - } + tgt.setValue(Narrative.NarrativeStatus.GENERATED); + break; + case EXTENSIONS: + tgt.setValue(Narrative.NarrativeStatus.EXTENSIONS); + break; + case ADDITIONAL: + tgt.setValue(Narrative.NarrativeStatus.ADDITIONAL); + break; + case EMPTY: + tgt.setValue(Narrative.NarrativeStatus.EMPTY); + break; + default: + tgt.setValue(Narrative.NarrativeStatus.NULL); + break; + } +} return tgt; } @@ -55,26 +56,26 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Narrative.NarrativeStatusEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case GENERATED: - tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.GENERATED); - break; - case EXTENSIONS: - tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.EXTENSIONS); - break; - case ADDITIONAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.ADDITIONAL); - break; - case EMPTY: - tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.EMPTY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.GENERATED); + break; + case EXTENSIONS: + tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.EXTENSIONS); + break; + case ADDITIONAL: + tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.ADDITIONAL); + break; + case EMPTY: + tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.EMPTY); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/datatypes10_40/complextypes10_40/Address10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/datatypes10_40/complextypes10_40/Address10_40.java index 4458239e82..87b7d5fb0b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/datatypes10_40/complextypes10_40/Address10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/datatypes10_40/complextypes10_40/Address10_40.java @@ -3,6 +3,7 @@ import org.hl7.fhir.convertors.context.ConversionContext10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.String10_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Address; public class Address10_40 { public static org.hl7.fhir.r4.model.Address convertAddress(org.hl7.fhir.dstu2.model.Address src) throws FHIRException { @@ -44,26 +45,26 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Address.AddressUseEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HOME: - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressUse.HOME); - break; - case WORK: - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressUse.WORK); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressUse.OLD); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressUse.NULL); - break; - } - } + tgt.setValue(Address.AddressUse.HOME); + break; + case WORK: + tgt.setValue(Address.AddressUse.WORK); + break; + case TEMP: + tgt.setValue(Address.AddressUse.TEMP); + break; + case OLD: + tgt.setValue(Address.AddressUse.OLD); + break; + default: + tgt.setValue(Address.AddressUse.NULL); + break; + } +} return tgt; } @@ -72,26 +73,26 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Address.AddressUseEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HOME: - tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.HOME); - break; - case WORK: - tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.WORK); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.OLD); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.HOME); + break; + case WORK: + tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.WORK); + break; + case TEMP: + tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.TEMP); + break; + case OLD: + tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.OLD); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.NULL); + break; + } +} return tgt; } @@ -100,23 +101,23 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Address.AddressTypeEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case POSTAL: - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressType.POSTAL); - break; - case PHYSICAL: - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressType.PHYSICAL); - break; - case BOTH: - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressType.BOTH); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressType.NULL); - break; - } - } + tgt.setValue(Address.AddressType.POSTAL); + break; + case PHYSICAL: + tgt.setValue(Address.AddressType.PHYSICAL); + break; + case BOTH: + tgt.setValue(Address.AddressType.BOTH); + break; + default: + tgt.setValue(Address.AddressType.NULL); + break; + } +} return tgt; } @@ -125,23 +126,23 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Address.AddressTypeEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case POSTAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressType.POSTAL); - break; - case PHYSICAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressType.PHYSICAL); - break; - case BOTH: - tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressType.BOTH); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressType.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressType.POSTAL); + break; + case PHYSICAL: + tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressType.PHYSICAL); + break; + case BOTH: + tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressType.BOTH); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressType.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/datatypes10_40/complextypes10_40/ContactPoint10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/datatypes10_40/complextypes10_40/ContactPoint10_40.java index 2883ef303b..322234b12e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/datatypes10_40/complextypes10_40/ContactPoint10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/datatypes10_40/complextypes10_40/ContactPoint10_40.java @@ -4,6 +4,7 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.PositiveInt10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.String10_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.ContactPoint; public class ContactPoint10_40 { public static org.hl7.fhir.r4.model.ContactPoint convertContactPoint(org.hl7.fhir.dstu2.model.ContactPoint src) throws FHIRException { @@ -35,29 +36,29 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ContactPoint.ContactPointSystemEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case PHONE: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem.PHONE); - break; - case FAX: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem.FAX); - break; - case EMAIL: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem.EMAIL); - break; - case PAGER: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem.PAGER); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem.NULL); - break; - } - } + tgt.setValue(ContactPoint.ContactPointSystem.PHONE); + break; + case FAX: + tgt.setValue(ContactPoint.ContactPointSystem.FAX); + break; + case EMAIL: + tgt.setValue(ContactPoint.ContactPointSystem.EMAIL); + break; + case PAGER: + tgt.setValue(ContactPoint.ContactPointSystem.PAGER); + break; + case OTHER: + tgt.setValue(ContactPoint.ContactPointSystem.OTHER); + break; + default: + tgt.setValue(ContactPoint.ContactPointSystem.NULL); + break; + } +} return tgt; } @@ -66,32 +67,32 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystemEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case PHONE: - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.PHONE); - break; - case FAX: - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.FAX); - break; - case EMAIL: - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.EMAIL); - break; - case PAGER: - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.PAGER); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.OTHER); - break; - case URL: - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.PHONE); + break; + case FAX: + tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.FAX); + break; + case EMAIL: + tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.EMAIL); + break; + case PAGER: + tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.PAGER); + break; + case OTHER: + tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.OTHER); + break; + case URL: + tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.OTHER); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.NULL); + break; + } +} return tgt; } @@ -100,29 +101,29 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ContactPoint.ContactPointUseEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HOME: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointUse.HOME); - break; - case WORK: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointUse.WORK); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointUse.OLD); - break; - case MOBILE: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointUse.MOBILE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointUse.NULL); - break; - } - } + tgt.setValue(ContactPoint.ContactPointUse.HOME); + break; + case WORK: + tgt.setValue(ContactPoint.ContactPointUse.WORK); + break; + case TEMP: + tgt.setValue(ContactPoint.ContactPointUse.TEMP); + break; + case OLD: + tgt.setValue(ContactPoint.ContactPointUse.OLD); + break; + case MOBILE: + tgt.setValue(ContactPoint.ContactPointUse.MOBILE); + break; + default: + tgt.setValue(ContactPoint.ContactPointUse.NULL); + break; + } +} return tgt; } @@ -131,29 +132,29 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUseEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HOME: - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.HOME); - break; - case WORK: - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.WORK); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.OLD); - break; - case MOBILE: - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.MOBILE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.HOME); + break; + case WORK: + tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.WORK); + break; + case TEMP: + tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.TEMP); + break; + case OLD: + tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.OLD); + break; + case MOBILE: + tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.MOBILE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/datatypes10_40/complextypes10_40/HumanName10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/datatypes10_40/complextypes10_40/HumanName10_40.java index 80508d9a5a..a5b9128007 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/datatypes10_40/complextypes10_40/HumanName10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/datatypes10_40/complextypes10_40/HumanName10_40.java @@ -3,6 +3,7 @@ import org.hl7.fhir.convertors.context.ConversionContext10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.String10_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.HumanName; public class HumanName10_40 { public static org.hl7.fhir.r4.model.HumanName convertHumanName(org.hl7.fhir.dstu2.model.HumanName src) throws FHIRException { @@ -38,35 +39,35 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.HumanName.NameUseEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case USUAL: - tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.USUAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.OFFICIAL); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.TEMP); - break; - case NICKNAME: - tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.NICKNAME); - break; - case ANONYMOUS: - tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.ANONYMOUS); - break; - case OLD: - tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.OLD); - break; - case MAIDEN: - tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.MAIDEN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.NULL); - break; - } - } + tgt.setValue(HumanName.NameUse.USUAL); + break; + case OFFICIAL: + tgt.setValue(HumanName.NameUse.OFFICIAL); + break; + case TEMP: + tgt.setValue(HumanName.NameUse.TEMP); + break; + case NICKNAME: + tgt.setValue(HumanName.NameUse.NICKNAME); + break; + case ANONYMOUS: + tgt.setValue(HumanName.NameUse.ANONYMOUS); + break; + case OLD: + tgt.setValue(HumanName.NameUse.OLD); + break; + case MAIDEN: + tgt.setValue(HumanName.NameUse.MAIDEN); + break; + default: + tgt.setValue(HumanName.NameUse.NULL); + break; + } +} return tgt; } @@ -75,35 +76,35 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.HumanName.NameUseEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case USUAL: - tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.USUAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.OFFICIAL); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.TEMP); - break; - case NICKNAME: - tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.NICKNAME); - break; - case ANONYMOUS: - tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.ANONYMOUS); - break; - case OLD: - tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.OLD); - break; - case MAIDEN: - tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.MAIDEN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.USUAL); + break; + case OFFICIAL: + tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.OFFICIAL); + break; + case TEMP: + tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.TEMP); + break; + case NICKNAME: + tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.NICKNAME); + break; + case ANONYMOUS: + tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.ANONYMOUS); + break; + case OLD: + tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.OLD); + break; + case MAIDEN: + tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.MAIDEN); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/datatypes10_40/complextypes10_40/Identifier10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/datatypes10_40/complextypes10_40/Identifier10_40.java index 603d051163..786e9d015a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/datatypes10_40/complextypes10_40/Identifier10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/datatypes10_40/complextypes10_40/Identifier10_40.java @@ -5,6 +5,7 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.String10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Uri10_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Identifier; public class Identifier10_40 { public static org.hl7.fhir.r4.model.Identifier convertIdentifier(org.hl7.fhir.dstu2.model.Identifier src) throws FHIRException { @@ -38,26 +39,26 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Identifier.IdentifierUseEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Identifier.IdentifierUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case USUAL: - tgt.setValue(org.hl7.fhir.r4.model.Identifier.IdentifierUse.USUAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.r4.model.Identifier.IdentifierUse.OFFICIAL); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.r4.model.Identifier.IdentifierUse.TEMP); - break; - case SECONDARY: - tgt.setValue(org.hl7.fhir.r4.model.Identifier.IdentifierUse.SECONDARY); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Identifier.IdentifierUse.NULL); - break; - } - } + tgt.setValue(Identifier.IdentifierUse.USUAL); + break; + case OFFICIAL: + tgt.setValue(Identifier.IdentifierUse.OFFICIAL); + break; + case TEMP: + tgt.setValue(Identifier.IdentifierUse.TEMP); + break; + case SECONDARY: + tgt.setValue(Identifier.IdentifierUse.SECONDARY); + break; + default: + tgt.setValue(Identifier.IdentifierUse.NULL); + break; + } +} return tgt; } @@ -66,26 +67,26 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Identifier.IdentifierUseEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case USUAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.USUAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.OFFICIAL); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.TEMP); - break; - case SECONDARY: - tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.SECONDARY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.USUAL); + break; + case OFFICIAL: + tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.OFFICIAL); + break; + case TEMP: + tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.TEMP); + break; + case SECONDARY: + tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.SECONDARY); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/datatypes10_40/complextypes10_40/Quantity10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/datatypes10_40/complextypes10_40/Quantity10_40.java index 0d4d19f342..4dcd51f846 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/datatypes10_40/complextypes10_40/Quantity10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/datatypes10_40/complextypes10_40/Quantity10_40.java @@ -6,6 +6,7 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.String10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Uri10_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Quantity; public class Quantity10_40 { public static org.hl7.fhir.r4.model.Quantity convertQuantity(org.hl7.fhir.dstu2.model.Quantity src) throws FHIRException { @@ -37,26 +38,26 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Quantity.QuantityComparatorEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Quantity.QuantityComparator.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case LESS_THAN: - tgt.setValue(org.hl7.fhir.r4.model.Quantity.QuantityComparator.LESS_THAN); - break; - case LESS_OR_EQUAL: - tgt.setValue(org.hl7.fhir.r4.model.Quantity.QuantityComparator.LESS_OR_EQUAL); - break; - case GREATER_OR_EQUAL: - tgt.setValue(org.hl7.fhir.r4.model.Quantity.QuantityComparator.GREATER_OR_EQUAL); - break; - case GREATER_THAN: - tgt.setValue(org.hl7.fhir.r4.model.Quantity.QuantityComparator.GREATER_THAN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Quantity.QuantityComparator.NULL); - break; - } - } + tgt.setValue(Quantity.QuantityComparator.LESS_THAN); + break; + case LESS_OR_EQUAL: + tgt.setValue(Quantity.QuantityComparator.LESS_OR_EQUAL); + break; + case GREATER_OR_EQUAL: + tgt.setValue(Quantity.QuantityComparator.GREATER_OR_EQUAL); + break; + case GREATER_THAN: + tgt.setValue(Quantity.QuantityComparator.GREATER_THAN); + break; + default: + tgt.setValue(Quantity.QuantityComparator.NULL); + break; + } +} return tgt; } @@ -65,26 +66,26 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Quantity.QuantityComparatorEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.Quantity.QuantityComparator.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case LESS_THAN: - tgt.setValue(org.hl7.fhir.dstu2.model.Quantity.QuantityComparator.LESS_THAN); - break; - case LESS_OR_EQUAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Quantity.QuantityComparator.LESS_OR_EQUAL); - break; - case GREATER_OR_EQUAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Quantity.QuantityComparator.GREATER_OR_EQUAL); - break; - case GREATER_THAN: - tgt.setValue(org.hl7.fhir.dstu2.model.Quantity.QuantityComparator.GREATER_THAN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Quantity.QuantityComparator.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.Quantity.QuantityComparator.LESS_THAN); + break; + case LESS_OR_EQUAL: + tgt.setValue(org.hl7.fhir.dstu2.model.Quantity.QuantityComparator.LESS_OR_EQUAL); + break; + case GREATER_OR_EQUAL: + tgt.setValue(org.hl7.fhir.dstu2.model.Quantity.QuantityComparator.GREATER_OR_EQUAL); + break; + case GREATER_THAN: + tgt.setValue(org.hl7.fhir.dstu2.model.Quantity.QuantityComparator.GREATER_THAN); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Quantity.QuantityComparator.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/datatypes10_40/complextypes10_40/Timing10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/datatypes10_40/complextypes10_40/Timing10_40.java index e27e5346cc..27b64717fb 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/datatypes10_40/complextypes10_40/Timing10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/datatypes10_40/complextypes10_40/Timing10_40.java @@ -5,6 +5,7 @@ import org.hl7.fhir.convertors.context.ConversionContext10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Decimal10_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Timing; public class Timing10_40 { public static org.hl7.fhir.r4.model.Timing convertTiming(org.hl7.fhir.dstu2.model.Timing src) throws FHIRException { @@ -72,35 +73,35 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Timing.UnitsOfTimeEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case S: - tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.S); - break; - case MIN: - tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.MIN); - break; - case H: - tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.H); - break; - case D: - tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.D); - break; - case WK: - tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.WK); - break; - case MO: - tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.MO); - break; - case A: - tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.A); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.NULL); - break; - } - } + tgt.setValue(Timing.UnitsOfTime.S); + break; + case MIN: + tgt.setValue(Timing.UnitsOfTime.MIN); + break; + case H: + tgt.setValue(Timing.UnitsOfTime.H); + break; + case D: + tgt.setValue(Timing.UnitsOfTime.D); + break; + case WK: + tgt.setValue(Timing.UnitsOfTime.WK); + break; + case MO: + tgt.setValue(Timing.UnitsOfTime.MO); + break; + case A: + tgt.setValue(Timing.UnitsOfTime.A); + break; + default: + tgt.setValue(Timing.UnitsOfTime.NULL); + break; + } +} return tgt; } @@ -109,35 +110,35 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Timing.UnitsOfTimeEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case S: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.S); - break; - case MIN: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.MIN); - break; - case H: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.H); - break; - case D: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.D); - break; - case WK: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.WK); - break; - case MO: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.MO); - break; - case A: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.A); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.S); + break; + case MIN: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.MIN); + break; + case H: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.H); + break; + case D: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.D); + break; + case WK: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.WK); + break; + case MO: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.MO); + break; + case A: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.A); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.NULL); + break; + } +} return tgt; } @@ -146,56 +147,56 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Timing.EventTimingEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HS: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.HS); - break; - case WAKE: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.WAKE); - break; - case C: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.C); - break; - case CM: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.CM); - break; - case CD: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.CD); - break; - case CV: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.CV); - break; - case AC: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.AC); - break; - case ACM: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.ACM); - break; - case ACD: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.ACD); - break; - case ACV: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.ACV); - break; - case PC: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.PC); - break; - case PCM: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.PCM); - break; - case PCD: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.PCD); - break; - case PCV: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.PCV); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.NULL); - break; - } - } + tgt.setValue(Timing.EventTiming.HS); + break; + case WAKE: + tgt.setValue(Timing.EventTiming.WAKE); + break; + case C: + tgt.setValue(Timing.EventTiming.C); + break; + case CM: + tgt.setValue(Timing.EventTiming.CM); + break; + case CD: + tgt.setValue(Timing.EventTiming.CD); + break; + case CV: + tgt.setValue(Timing.EventTiming.CV); + break; + case AC: + tgt.setValue(Timing.EventTiming.AC); + break; + case ACM: + tgt.setValue(Timing.EventTiming.ACM); + break; + case ACD: + tgt.setValue(Timing.EventTiming.ACD); + break; + case ACV: + tgt.setValue(Timing.EventTiming.ACV); + break; + case PC: + tgt.setValue(Timing.EventTiming.PC); + break; + case PCM: + tgt.setValue(Timing.EventTiming.PCM); + break; + case PCD: + tgt.setValue(Timing.EventTiming.PCD); + break; + case PCV: + tgt.setValue(Timing.EventTiming.PCV); + break; + default: + tgt.setValue(Timing.EventTiming.NULL); + break; + } +} return tgt; } @@ -204,56 +205,56 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Timing.EventTimingEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HS: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.HS); - break; - case WAKE: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.WAKE); - break; - case C: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.C); - break; - case CM: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.CM); - break; - case CD: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.CD); - break; - case CV: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.CV); - break; - case AC: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.AC); - break; - case ACM: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.ACM); - break; - case ACD: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.ACD); - break; - case ACV: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.ACV); - break; - case PC: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.PC); - break; - case PCM: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.PCM); - break; - case PCD: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.PCD); - break; - case PCV: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.PCV); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.HS); + break; + case WAKE: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.WAKE); + break; + case C: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.C); + break; + case CM: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.CM); + break; + case CD: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.CD); + break; + case CV: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.CV); + break; + case AC: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.AC); + break; + case ACM: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.ACM); + break; + case ACD: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.ACD); + break; + case ACV: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.ACV); + break; + case PC: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.PC); + break; + case PCM: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.PCM); + break; + case PCD: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.PCD); + break; + case PCV: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.PCV); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Appointment10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Appointment10_40.java index 2520d68970..2641e31149 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Appointment10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Appointment10_40.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.PositiveInt10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.String10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.UnsignedInt10_40; +import org.hl7.fhir.dstu2.model.Appointment; +import org.hl7.fhir.dstu2.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; public class Appointment10_40 { @@ -103,164 +105,188 @@ public static org.hl7.fhir.dstu2.model.Appointment.AppointmentParticipantCompone } static public org.hl7.fhir.dstu2.model.Enumeration convertAppointmentStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Appointment.AppointmentStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSED: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.PROPOSED); - break; - case PENDING: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.PENDING); - break; - case BOOKED: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.BOOKED); - break; - case ARRIVED: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.ARRIVED); - break; - case FULFILLED: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.FULFILLED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.CANCELLED); - break; - case NOSHOW: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.NOSHOW); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Appointment.AppointmentStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSED: + tgt.setValue(Appointment.AppointmentStatus.PROPOSED); + break; + case PENDING: + tgt.setValue(Appointment.AppointmentStatus.PENDING); + break; + case BOOKED: + tgt.setValue(Appointment.AppointmentStatus.BOOKED); + break; + case ARRIVED: + tgt.setValue(Appointment.AppointmentStatus.ARRIVED); + break; + case FULFILLED: + tgt.setValue(Appointment.AppointmentStatus.FULFILLED); + break; + case CANCELLED: + tgt.setValue(Appointment.AppointmentStatus.CANCELLED); + break; + case NOSHOW: + tgt.setValue(Appointment.AppointmentStatus.NOSHOW); + break; + default: + tgt.setValue(Appointment.AppointmentStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertAppointmentStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Appointment.AppointmentStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSED: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.PROPOSED); - break; - case PENDING: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.PENDING); - break; - case BOOKED: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.BOOKED); - break; - case ARRIVED: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.ARRIVED); - break; - case FULFILLED: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.FULFILLED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.CANCELLED); - break; - case NOSHOW: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.NOSHOW); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Appointment.AppointmentStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSED: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.PROPOSED); + break; + case PENDING: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.PENDING); + break; + case BOOKED: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.BOOKED); + break; + case ARRIVED: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.ARRIVED); + break; + case FULFILLED: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.FULFILLED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.CANCELLED); + break; + case NOSHOW: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.NOSHOW); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertParticipantRequired(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Appointment.ParticipantRequiredEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case REQUIRED: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipantRequired.REQUIRED); - break; - case OPTIONAL: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipantRequired.OPTIONAL); - break; - case INFORMATIONONLY: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipantRequired.INFORMATIONONLY); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipantRequired.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Appointment.ParticipantRequiredEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REQUIRED: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipantRequired.REQUIRED); + break; + case OPTIONAL: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipantRequired.OPTIONAL); + break; + case INFORMATIONONLY: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipantRequired.INFORMATIONONLY); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipantRequired.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertParticipantRequired(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Appointment.ParticipantRequiredEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case REQUIRED: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipantRequired.REQUIRED); - break; - case OPTIONAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipantRequired.OPTIONAL); - break; - case INFORMATIONONLY: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipantRequired.INFORMATIONONLY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipantRequired.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Appointment.ParticipantRequiredEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REQUIRED: + tgt.setValue(Appointment.ParticipantRequired.REQUIRED); + break; + case OPTIONAL: + tgt.setValue(Appointment.ParticipantRequired.OPTIONAL); + break; + case INFORMATIONONLY: + tgt.setValue(Appointment.ParticipantRequired.INFORMATIONONLY); + break; + default: + tgt.setValue(Appointment.ParticipantRequired.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertParticipationStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Appointment.ParticipationStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACCEPTED: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipationStatus.ACCEPTED); - break; - case DECLINED: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipationStatus.DECLINED); - break; - case TENTATIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipationStatus.TENTATIVE); - break; - case NEEDSACTION: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipationStatus.NEEDSACTION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Appointment.ParticipationStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACCEPTED: + tgt.setValue(Appointment.ParticipationStatus.ACCEPTED); + break; + case DECLINED: + tgt.setValue(Appointment.ParticipationStatus.DECLINED); + break; + case TENTATIVE: + tgt.setValue(Appointment.ParticipationStatus.TENTATIVE); + break; + case NEEDSACTION: + tgt.setValue(Appointment.ParticipationStatus.NEEDSACTION); + break; + default: + tgt.setValue(Appointment.ParticipationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertParticipationStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Appointment.ParticipationStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACCEPTED: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipationStatus.ACCEPTED); - break; - case DECLINED: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipationStatus.DECLINED); - break; - case TENTATIVE: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipationStatus.TENTATIVE); - break; - case NEEDSACTION: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipationStatus.NEEDSACTION); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Appointment.ParticipationStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACCEPTED: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipationStatus.ACCEPTED); + break; + case DECLINED: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipationStatus.DECLINED); + break; + case TENTATIVE: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipationStatus.TENTATIVE); + break; + case NEEDSACTION: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipationStatus.NEEDSACTION); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipationStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/AppointmentResponse10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/AppointmentResponse10_40.java index c620d29908..0ede3bc55a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/AppointmentResponse10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/AppointmentResponse10_40.java @@ -6,6 +6,8 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.Identifier10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Instant10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.String10_40; +import org.hl7.fhir.dstu2.model.AppointmentResponse; +import org.hl7.fhir.dstu2.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; public class AppointmentResponse10_40 { @@ -59,58 +61,66 @@ public static org.hl7.fhir.dstu2.model.AppointmentResponse convertAppointmentRes } static public org.hl7.fhir.dstu2.model.Enumeration convertParticipantStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACCEPTED: - tgt.setValue(org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus.ACCEPTED); - break; - case DECLINED: - tgt.setValue(org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus.DECLINED); - break; - case TENTATIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus.TENTATIVE); - break; - case NEEDSACTION: - tgt.setValue(org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus.NEEDSACTION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new AppointmentResponse.ParticipantStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACCEPTED: + tgt.setValue(AppointmentResponse.ParticipantStatus.ACCEPTED); + break; + case DECLINED: + tgt.setValue(AppointmentResponse.ParticipantStatus.DECLINED); + break; + case TENTATIVE: + tgt.setValue(AppointmentResponse.ParticipantStatus.TENTATIVE); + break; + case NEEDSACTION: + tgt.setValue(AppointmentResponse.ParticipantStatus.NEEDSACTION); + break; + default: + tgt.setValue(AppointmentResponse.ParticipantStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertParticipantStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACCEPTED: - tgt.setValue(org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.ACCEPTED); - break; - case DECLINED: - tgt.setValue(org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.DECLINED); - break; - case TENTATIVE: - tgt.setValue(org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.TENTATIVE); - break; - case INPROCESS: - tgt.setValue(org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.ACCEPTED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.ACCEPTED); - break; - case NEEDSACTION: - tgt.setValue(org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.NEEDSACTION); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACCEPTED: + tgt.setValue(org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.ACCEPTED); + break; + case DECLINED: + tgt.setValue(org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.DECLINED); + break; + case TENTATIVE: + tgt.setValue(org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.TENTATIVE); + break; + case INPROCESS: + tgt.setValue(org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.ACCEPTED); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.ACCEPTED); + break; + case NEEDSACTION: + tgt.setValue(org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.NEEDSACTION); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/AuditEvent10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/AuditEvent10_40.java index 7433e9592c..5cbce08376 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/AuditEvent10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/AuditEvent10_40.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Base64Binary10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Boolean10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.String10_40; +import org.hl7.fhir.dstu2.model.AuditEvent; +import org.hl7.fhir.dstu2.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; public class AuditEvent10_40 { @@ -62,59 +64,67 @@ public static org.hl7.fhir.dstu2.model.AuditEvent convertAuditEvent(org.hl7.fhir } static public org.hl7.fhir.dstu2.model.Enumeration convertAuditEventAction(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventActionEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case C: - tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.C); - break; - case R: - tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.R); - break; - case U: - tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.U); - break; - case D: - tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.D); - break; - case E: - tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.E); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new AuditEvent.AuditEventActionEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case C: + tgt.setValue(AuditEvent.AuditEventAction.C); + break; + case R: + tgt.setValue(AuditEvent.AuditEventAction.R); + break; + case U: + tgt.setValue(AuditEvent.AuditEventAction.U); + break; + case D: + tgt.setValue(AuditEvent.AuditEventAction.D); + break; + case E: + tgt.setValue(AuditEvent.AuditEventAction.E); + break; + default: + tgt.setValue(AuditEvent.AuditEventAction.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertAuditEventAction(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.AuditEvent.AuditEventActionEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case C: - tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.C); - break; - case R: - tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.R); - break; - case U: - tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.U); - break; - case D: - tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.D); - break; - case E: - tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.E); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.AuditEvent.AuditEventActionEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case C: + tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.C); + break; + case R: + tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.R); + break; + case U: + tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.U); + break; + case D: + tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.D); + break; + case E: + tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.E); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentComponent convertAuditEventAgentComponent(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantComponent src) throws FHIRException { @@ -284,109 +294,125 @@ public static org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityDetailComponent c } static public org.hl7.fhir.r4.model.Enumeration convertAuditEventOutcome(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.AuditEvent.AuditEventOutcomeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case _0: - tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventOutcome._0); - break; - case _4: - tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventOutcome._4); - break; - case _8: - tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventOutcome._8); - break; - case _12: - tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventOutcome._12); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventOutcome.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.AuditEvent.AuditEventOutcomeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case _0: + tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventOutcome._0); + break; + case _4: + tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventOutcome._4); + break; + case _8: + tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventOutcome._8); + break; + case _12: + tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventOutcome._12); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventOutcome.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertAuditEventOutcome(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventOutcomeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case _0: - tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventOutcome._0); - break; - case _4: - tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventOutcome._4); - break; - case _8: - tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventOutcome._8); - break; - case _12: - tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventOutcome._12); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventOutcome.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new AuditEvent.AuditEventOutcomeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case _0: + tgt.setValue(AuditEvent.AuditEventOutcome._0); + break; + case _4: + tgt.setValue(AuditEvent.AuditEventOutcome._4); + break; + case _8: + tgt.setValue(AuditEvent.AuditEventOutcome._8); + break; + case _12: + tgt.setValue(AuditEvent.AuditEventOutcome._12); + break; + default: + tgt.setValue(AuditEvent.AuditEventOutcome.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertAuditEventParticipantNetworkType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkTypeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case _1: - tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkType._1); - break; - case _2: - tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkType._2); - break; - case _3: - tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkType._3); - break; - case _4: - tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkType._4); - break; - case _5: - tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkType._5); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new AuditEvent.AuditEventParticipantNetworkTypeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case _1: + tgt.setValue(AuditEvent.AuditEventParticipantNetworkType._1); + break; + case _2: + tgt.setValue(AuditEvent.AuditEventParticipantNetworkType._2); + break; + case _3: + tgt.setValue(AuditEvent.AuditEventParticipantNetworkType._3); + break; + case _4: + tgt.setValue(AuditEvent.AuditEventParticipantNetworkType._4); + break; + case _5: + tgt.setValue(AuditEvent.AuditEventParticipantNetworkType._5); + break; + default: + tgt.setValue(AuditEvent.AuditEventParticipantNetworkType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertAuditEventParticipantNetworkType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkTypeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case _1: - tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType._1); - break; - case _2: - tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType._2); - break; - case _3: - tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType._3); - break; - case _4: - tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType._4); - break; - case _5: - tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType._5); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkTypeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case _1: + tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType._1); + break; + case _2: + tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType._2); + break; + case _3: + tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType._3); + break; + case _4: + tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType._4); + break; + case _5: + tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType._5); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r4.model.AuditEvent.AuditEventSourceComponent convertAuditEventSourceComponent(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventSourceComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Bundle10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Bundle10_40.java index 2db22f354e..93b2dd977f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Bundle10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Bundle10_40.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.String10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.UnsignedInt10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Uri10_40; +import org.hl7.fhir.dstu2.model.Bundle; +import org.hl7.fhir.dstu2.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.utilities.FhirPublication; @@ -218,176 +220,200 @@ public static org.hl7.fhir.dstu2.model.Bundle.BundleLinkComponent convertBundleL } static public org.hl7.fhir.dstu2.model.Enumeration convertBundleType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Bundle.BundleTypeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case DOCUMENT: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.DOCUMENT); - break; - case MESSAGE: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.MESSAGE); - break; - case TRANSACTION: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.TRANSACTION); - break; - case TRANSACTIONRESPONSE: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.TRANSACTIONRESPONSE); - break; - case BATCH: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.BATCH); - break; - case BATCHRESPONSE: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.BATCHRESPONSE); - break; - case HISTORY: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.HISTORY); - break; - case SEARCHSET: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.SEARCHSET); - break; - case COLLECTION: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.COLLECTION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Bundle.BundleTypeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DOCUMENT: + tgt.setValue(Bundle.BundleType.DOCUMENT); + break; + case MESSAGE: + tgt.setValue(Bundle.BundleType.MESSAGE); + break; + case TRANSACTION: + tgt.setValue(Bundle.BundleType.TRANSACTION); + break; + case TRANSACTIONRESPONSE: + tgt.setValue(Bundle.BundleType.TRANSACTIONRESPONSE); + break; + case BATCH: + tgt.setValue(Bundle.BundleType.BATCH); + break; + case BATCHRESPONSE: + tgt.setValue(Bundle.BundleType.BATCHRESPONSE); + break; + case HISTORY: + tgt.setValue(Bundle.BundleType.HISTORY); + break; + case SEARCHSET: + tgt.setValue(Bundle.BundleType.SEARCHSET); + break; + case COLLECTION: + tgt.setValue(Bundle.BundleType.COLLECTION); + break; + default: + tgt.setValue(Bundle.BundleType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertBundleType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Bundle.BundleTypeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case DOCUMENT: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.DOCUMENT); - break; - case MESSAGE: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.MESSAGE); - break; - case TRANSACTION: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.TRANSACTION); - break; - case TRANSACTIONRESPONSE: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.TRANSACTIONRESPONSE); - break; - case BATCH: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.BATCH); - break; - case BATCHRESPONSE: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.BATCHRESPONSE); - break; - case HISTORY: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.HISTORY); - break; - case SEARCHSET: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.SEARCHSET); - break; - case COLLECTION: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.COLLECTION); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Bundle.BundleTypeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DOCUMENT: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.DOCUMENT); + break; + case MESSAGE: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.MESSAGE); + break; + case TRANSACTION: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.TRANSACTION); + break; + case TRANSACTIONRESPONSE: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.TRANSACTIONRESPONSE); + break; + case BATCH: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.BATCH); + break; + case BATCHRESPONSE: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.BATCHRESPONSE); + break; + case HISTORY: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.HISTORY); + break; + case SEARCHSET: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.SEARCHSET); + break; + case COLLECTION: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.COLLECTION); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertHTTPVerb(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Bundle.HTTPVerbEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case GET: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.HTTPVerb.GET); - break; - case POST: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.HTTPVerb.POST); - break; - case PUT: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.HTTPVerb.PUT); - break; - case DELETE: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.HTTPVerb.DELETE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.HTTPVerb.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Bundle.HTTPVerbEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case GET: + tgt.setValue(Bundle.HTTPVerb.GET); + break; + case POST: + tgt.setValue(Bundle.HTTPVerb.POST); + break; + case PUT: + tgt.setValue(Bundle.HTTPVerb.PUT); + break; + case DELETE: + tgt.setValue(Bundle.HTTPVerb.DELETE); + break; + default: + tgt.setValue(Bundle.HTTPVerb.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertHTTPVerb(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Bundle.HTTPVerbEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case GET: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.GET); - break; - case POST: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.POST); - break; - case PUT: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.PUT); - break; - case DELETE: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.DELETE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Bundle.HTTPVerbEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case GET: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.GET); + break; + case POST: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.POST); + break; + case PUT: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.PUT); + break; + case DELETE: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.DELETE); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertSearchEntryMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Bundle.SearchEntryModeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case MATCH: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.SearchEntryMode.MATCH); - break; - case INCLUDE: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.SearchEntryMode.INCLUDE); - break; - case OUTCOME: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.SearchEntryMode.OUTCOME); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.SearchEntryMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Bundle.SearchEntryModeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MATCH: + tgt.setValue(Bundle.SearchEntryMode.MATCH); + break; + case INCLUDE: + tgt.setValue(Bundle.SearchEntryMode.INCLUDE); + break; + case OUTCOME: + tgt.setValue(Bundle.SearchEntryMode.OUTCOME); + break; + default: + tgt.setValue(Bundle.SearchEntryMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertSearchEntryMode(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Bundle.SearchEntryModeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case MATCH: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.SearchEntryMode.MATCH); - break; - case INCLUDE: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.SearchEntryMode.INCLUDE); - break; - case OUTCOME: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.SearchEntryMode.OUTCOME); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.SearchEntryMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Bundle.SearchEntryModeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MATCH: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.SearchEntryMode.MATCH); + break; + case INCLUDE: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.SearchEntryMode.INCLUDE); + break; + case OUTCOME: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.SearchEntryMode.OUTCOME); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.SearchEntryMode.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/CarePlan10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/CarePlan10_40.java index fff63356a4..9f833cf946 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/CarePlan10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/CarePlan10_40.java @@ -10,6 +10,8 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Boolean10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.String10_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.CarePlan; +import org.hl7.fhir.r4.model.Enumeration; public class CarePlan10_40 { @@ -167,117 +169,133 @@ public static org.hl7.fhir.r4.model.CarePlan.CarePlanActivityDetailComponent con } static public org.hl7.fhir.r4.model.Enumeration convertCarePlanActivityStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case NOTSTARTED: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.NOTSTARTED); - break; - case SCHEDULED: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.SCHEDULED); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.INPROGRESS); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.ONHOLD); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.COMPLETED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.CANCELLED); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CarePlan.CarePlanActivityStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTSTARTED: + tgt.setValue(CarePlan.CarePlanActivityStatus.NOTSTARTED); + break; + case SCHEDULED: + tgt.setValue(CarePlan.CarePlanActivityStatus.SCHEDULED); + break; + case INPROGRESS: + tgt.setValue(CarePlan.CarePlanActivityStatus.INPROGRESS); + break; + case ONHOLD: + tgt.setValue(CarePlan.CarePlanActivityStatus.ONHOLD); + break; + case COMPLETED: + tgt.setValue(CarePlan.CarePlanActivityStatus.COMPLETED); + break; + case CANCELLED: + tgt.setValue(CarePlan.CarePlanActivityStatus.CANCELLED); + break; + default: + tgt.setValue(CarePlan.CarePlanActivityStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertCarePlanActivityStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case NOTSTARTED: - tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatus.NOTSTARTED); - break; - case SCHEDULED: - tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatus.SCHEDULED); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatus.INPROGRESS); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatus.ONHOLD); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatus.COMPLETED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatus.CANCELLED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTSTARTED: + tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatus.NOTSTARTED); + break; + case SCHEDULED: + tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatus.SCHEDULED); + break; + case INPROGRESS: + tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatus.INPROGRESS); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatus.ONHOLD); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatus.COMPLETED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatus.CANCELLED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertCarePlanStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CarePlan.CarePlanStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSED: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.DRAFT); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.ACTIVE); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.COMPLETED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.REVOKED); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CarePlan.CarePlanStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSED: + tgt.setValue(CarePlan.CarePlanStatus.DRAFT); + break; + case DRAFT: + tgt.setValue(CarePlan.CarePlanStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(CarePlan.CarePlanStatus.ACTIVE); + break; + case COMPLETED: + tgt.setValue(CarePlan.CarePlanStatus.COMPLETED); + break; + case CANCELLED: + tgt.setValue(CarePlan.CarePlanStatus.REVOKED); + break; + default: + tgt.setValue(CarePlan.CarePlanStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertCarePlanStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatus.ACTIVE); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatus.COMPLETED); - break; - case REVOKED: - tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatus.CANCELLED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatus.ACTIVE); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatus.COMPLETED); + break; + case REVOKED: + tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatus.CANCELLED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Communication10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Communication10_40.java index 4dd8472905..98cb6cfbc4 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Communication10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Communication10_40.java @@ -5,6 +5,8 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.CodeableConcept10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.Identifier10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.DateTime10_40; +import org.hl7.fhir.dstu2.model.Communication; +import org.hl7.fhir.dstu2.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; public class Communication10_40 { @@ -93,58 +95,66 @@ public static org.hl7.fhir.r4.model.Communication.CommunicationPayloadComponent } static public org.hl7.fhir.dstu2.model.Enumeration convertCommunicationStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Communication.CommunicationStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu2.model.Communication.CommunicationStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu2.model.Communication.CommunicationStatus.COMPLETED); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.dstu2.model.Communication.CommunicationStatus.SUSPENDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.Communication.CommunicationStatus.REJECTED); - break; - case NOTDONE: - tgt.setValue(org.hl7.fhir.dstu2.model.Communication.CommunicationStatus.FAILED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Communication.CommunicationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Communication.CommunicationStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(Communication.CommunicationStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(Communication.CommunicationStatus.COMPLETED); + break; + case ONHOLD: + tgt.setValue(Communication.CommunicationStatus.SUSPENDED); + break; + case ENTEREDINERROR: + tgt.setValue(Communication.CommunicationStatus.REJECTED); + break; + case NOTDONE: + tgt.setValue(Communication.CommunicationStatus.FAILED); + break; + default: + tgt.setValue(Communication.CommunicationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertCommunicationStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Communication.CommunicationStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationStatus.COMPLETED); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationStatus.ONHOLD); - break; - case REJECTED: - tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationStatus.ENTEREDINERROR); - break; - case FAILED: - tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationStatus.NOTDONE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Communication.CommunicationStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationStatus.COMPLETED); + break; + case SUSPENDED: + tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationStatus.ONHOLD); + break; + case REJECTED: + tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationStatus.ENTEREDINERROR); + break; + case FAILED: + tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationStatus.NOTDONE); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/CommunicationRequest10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/CommunicationRequest10_40.java index 02dd9226c4..1aa148cb14 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/CommunicationRequest10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/CommunicationRequest10_40.java @@ -6,6 +6,8 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.Identifier10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.DateTime10_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.CommunicationRequest; +import org.hl7.fhir.r4.model.Enumeration; public class CommunicationRequest10_40 { @@ -101,71 +103,79 @@ public static org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequest } static public org.hl7.fhir.r4.model.Enumeration convertCommunicationRequestStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSED: - tgt.setValue(org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.DRAFT); - break; - case PLANNED: - tgt.setValue(org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.ACTIVE); - break; - case REQUESTED: - tgt.setValue(org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.ACTIVE); - break; - case RECEIVED: - tgt.setValue(org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.ACTIVE); - break; - case ACCEPTED: - tgt.setValue(org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.ACTIVE); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.ACTIVE); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.COMPLETED); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.ONHOLD); - break; - case REJECTED: - tgt.setValue(org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CommunicationRequest.CommunicationRequestStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSED: + tgt.setValue(CommunicationRequest.CommunicationRequestStatus.DRAFT); + break; + case PLANNED: + tgt.setValue(CommunicationRequest.CommunicationRequestStatus.ACTIVE); + break; + case REQUESTED: + tgt.setValue(CommunicationRequest.CommunicationRequestStatus.ACTIVE); + break; + case RECEIVED: + tgt.setValue(CommunicationRequest.CommunicationRequestStatus.ACTIVE); + break; + case ACCEPTED: + tgt.setValue(CommunicationRequest.CommunicationRequestStatus.ACTIVE); + break; + case INPROGRESS: + tgt.setValue(CommunicationRequest.CommunicationRequestStatus.ACTIVE); + break; + case COMPLETED: + tgt.setValue(CommunicationRequest.CommunicationRequestStatus.COMPLETED); + break; + case SUSPENDED: + tgt.setValue(CommunicationRequest.CommunicationRequestStatus.ONHOLD); + break; + case REJECTED: + tgt.setValue(CommunicationRequest.CommunicationRequestStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(CommunicationRequest.CommunicationRequestStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertCommunicationRequestStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.PROPOSED); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.COMPLETED); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.SUSPENDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.REJECTED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.PROPOSED); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.COMPLETED); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.SUSPENDED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.REJECTED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.CodeableConcept convertPriorityCode(org.hl7.fhir.r4.model.CommunicationRequest.CommunicationPriority priority) { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Composition10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Composition10_40.java index ddf889063f..9042a665c1 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Composition10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Composition10_40.java @@ -11,6 +11,8 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.DateTime10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.String10_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Composition; +import org.hl7.fhir.r4.model.Enumeration; public class Composition10_40 { @@ -88,53 +90,61 @@ public static org.hl7.fhir.r4.model.Composition convertComposition(org.hl7.fhir. } static public org.hl7.fhir.r4.model.Enumeration convertCompositionAttestationMode(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Composition.CompositionAttestationModeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case PERSONAL: - tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionAttestationMode.PERSONAL); - break; - case PROFESSIONAL: - tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionAttestationMode.PROFESSIONAL); - break; - case LEGAL: - tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionAttestationMode.LEGAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionAttestationMode.OFFICIAL); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionAttestationMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Composition.CompositionAttestationModeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PERSONAL: + tgt.setValue(Composition.CompositionAttestationMode.PERSONAL); + break; + case PROFESSIONAL: + tgt.setValue(Composition.CompositionAttestationMode.PROFESSIONAL); + break; + case LEGAL: + tgt.setValue(Composition.CompositionAttestationMode.LEGAL); + break; + case OFFICIAL: + tgt.setValue(Composition.CompositionAttestationMode.OFFICIAL); + break; + default: + tgt.setValue(Composition.CompositionAttestationMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertCompositionAttestationMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Composition.CompositionAttestationModeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case PERSONAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode.PERSONAL); - break; - case PROFESSIONAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode.PROFESSIONAL); - break; - case LEGAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode.LEGAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode.OFFICIAL); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Composition.CompositionAttestationModeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PERSONAL: + tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode.PERSONAL); + break; + case PROFESSIONAL: + tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode.PROFESSIONAL); + break; + case LEGAL: + tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode.LEGAL); + break; + case OFFICIAL: + tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode.OFFICIAL); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2.model.Composition.CompositionAttesterComponent convertCompositionAttesterComponent(org.hl7.fhir.r4.model.Composition.CompositionAttesterComponent src) throws FHIRException { @@ -192,53 +202,61 @@ public static org.hl7.fhir.r4.model.Composition.CompositionEventComponent conver } static public org.hl7.fhir.r4.model.Enumeration convertCompositionStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Composition.CompositionStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionStatus.AMENDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Composition.CompositionStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRELIMINARY: + tgt.setValue(Composition.CompositionStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(Composition.CompositionStatus.FINAL); + break; + case AMENDED: + tgt.setValue(Composition.CompositionStatus.AMENDED); + break; + case ENTEREDINERROR: + tgt.setValue(Composition.CompositionStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Composition.CompositionStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertCompositionStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Composition.CompositionStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionStatus.AMENDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Composition.CompositionStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRELIMINARY: + tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionStatus.FINAL); + break; + case AMENDED: + tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionStatus.AMENDED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r4.model.Composition.SectionComponent convertSectionComponent(org.hl7.fhir.dstu2.model.Composition.SectionComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/ConceptMap10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/ConceptMap10_40.java index ac1aa40cb9..9a0dcc8b02 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/ConceptMap10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/ConceptMap10_40.java @@ -15,6 +15,8 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.DateTime10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.String10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Uri10_40; +import org.hl7.fhir.dstu2.model.Enumeration; +import org.hl7.fhir.dstu2.model.Enumerations; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4.model.CanonicalType; import org.hl7.fhir.r4.model.ConceptMap; @@ -141,83 +143,91 @@ public static org.hl7.fhir.r4.model.ContactDetail convertConceptMapContactCompon } static public org.hl7.fhir.dstu2.model.Enumeration convertConceptMapEquivalence(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalenceEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case EQUIVALENT: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.EQUIVALENT); - break; - case EQUAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.EQUAL); - break; - case WIDER: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.WIDER); - break; - case SUBSUMES: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.SUBSUMES); - break; - case NARROWER: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.NARROWER); - break; - case SPECIALIZES: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.SPECIALIZES); - break; - case INEXACT: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.INEXACT); - break; - case UNMATCHED: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.UNMATCHED); - break; - case DISJOINT: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.DISJOINT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ConceptMapEquivalenceEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUIVALENT: + tgt.setValue(Enumerations.ConceptMapEquivalence.EQUIVALENT); + break; + case EQUAL: + tgt.setValue(Enumerations.ConceptMapEquivalence.EQUAL); + break; + case WIDER: + tgt.setValue(Enumerations.ConceptMapEquivalence.WIDER); + break; + case SUBSUMES: + tgt.setValue(Enumerations.ConceptMapEquivalence.SUBSUMES); + break; + case NARROWER: + tgt.setValue(Enumerations.ConceptMapEquivalence.NARROWER); + break; + case SPECIALIZES: + tgt.setValue(Enumerations.ConceptMapEquivalence.SPECIALIZES); + break; + case INEXACT: + tgt.setValue(Enumerations.ConceptMapEquivalence.INEXACT); + break; + case UNMATCHED: + tgt.setValue(Enumerations.ConceptMapEquivalence.UNMATCHED); + break; + case DISJOINT: + tgt.setValue(Enumerations.ConceptMapEquivalence.DISJOINT); + break; + default: + tgt.setValue(Enumerations.ConceptMapEquivalence.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertConceptMapEquivalence(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalenceEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case EQUIVALENT: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.EQUIVALENT); - break; - case EQUAL: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.EQUAL); - break; - case WIDER: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.WIDER); - break; - case SUBSUMES: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.SUBSUMES); - break; - case NARROWER: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.NARROWER); - break; - case SPECIALIZES: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.SPECIALIZES); - break; - case INEXACT: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.INEXACT); - break; - case UNMATCHED: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.UNMATCHED); - break; - case DISJOINT: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.DISJOINT); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalenceEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUIVALENT: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.EQUIVALENT); + break; + case EQUAL: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.EQUAL); + break; + case WIDER: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.WIDER); + break; + case SUBSUMES: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.SUBSUMES); + break; + case NARROWER: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.NARROWER); + break; + case SPECIALIZES: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.SPECIALIZES); + break; + case INEXACT: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.INEXACT); + break; + case UNMATCHED: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.UNMATCHED); + break; + case DISJOINT: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.DISJOINT); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent convertOtherElementComponent(org.hl7.fhir.dstu2.model.ConceptMap.OtherElementComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Conformance10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Conformance10_40.java index 1f244df696..440f2ace51 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Conformance10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Conformance10_40.java @@ -14,7 +14,10 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.String10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.UnsignedInt10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Uri10_40; +import org.hl7.fhir.dstu2.model.Conformance; +import org.hl7.fhir.dstu2.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.CapabilityStatement; import org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestComponent; import org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceComponent; import org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction; @@ -27,47 +30,55 @@ public class Conformance10_40 { ACCEPT_UNKNOWN_EXTENSION_URL }; static public org.hl7.fhir.dstu2.model.Enumeration convertConditionalDeleteStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Conformance.ConditionalDeleteStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ConditionalDeleteStatus.NOTSUPPORTED); - break; - case SINGLE: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ConditionalDeleteStatus.SINGLE); - break; - case MULTIPLE: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ConditionalDeleteStatus.MULTIPLE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ConditionalDeleteStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Conformance.ConditionalDeleteStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTSUPPORTED: + tgt.setValue(Conformance.ConditionalDeleteStatus.NOTSUPPORTED); + break; + case SINGLE: + tgt.setValue(Conformance.ConditionalDeleteStatus.SINGLE); + break; + case MULTIPLE: + tgt.setValue(Conformance.ConditionalDeleteStatus.MULTIPLE); + break; + default: + tgt.setValue(Conformance.ConditionalDeleteStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertConditionalDeleteStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus.NOTSUPPORTED); - break; - case SINGLE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus.SINGLE); - break; - case MULTIPLE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus.MULTIPLE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new CapabilityStatement.ConditionalDeleteStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTSUPPORTED: + tgt.setValue(CapabilityStatement.ConditionalDeleteStatus.NOTSUPPORTED); + break; + case SINGLE: + tgt.setValue(CapabilityStatement.ConditionalDeleteStatus.SINGLE); + break; + case MULTIPLE: + tgt.setValue(CapabilityStatement.ConditionalDeleteStatus.MULTIPLE); + break; + default: + tgt.setValue(CapabilityStatement.ConditionalDeleteStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2.model.Conformance convertConformance(org.hl7.fhir.r4.model.CapabilityStatement src, BaseAdvisor_10_40 advisor) throws FHIRException { @@ -568,85 +579,101 @@ public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementSoftw } static public org.hl7.fhir.dstu2.model.Enumeration convertConformanceStatementKind(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Conformance.ConformanceStatementKindEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ConformanceStatementKind.INSTANCE); - break; - case CAPABILITY: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ConformanceStatementKind.CAPABILITY); - break; - case REQUIREMENTS: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ConformanceStatementKind.REQUIREMENTS); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ConformanceStatementKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Conformance.ConformanceStatementKindEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(Conformance.ConformanceStatementKind.INSTANCE); + break; + case CAPABILITY: + tgt.setValue(Conformance.ConformanceStatementKind.CAPABILITY); + break; + case REQUIREMENTS: + tgt.setValue(Conformance.ConformanceStatementKind.REQUIREMENTS); + break; + default: + tgt.setValue(Conformance.ConformanceStatementKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertConformanceStatementKind(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKindEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind.INSTANCE); - break; - case CAPABILITY: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind.CAPABILITY); - break; - case REQUIREMENTS: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind.REQUIREMENTS); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new CapabilityStatement.CapabilityStatementKindEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(CapabilityStatement.CapabilityStatementKind.INSTANCE); + break; + case CAPABILITY: + tgt.setValue(CapabilityStatement.CapabilityStatementKind.CAPABILITY); + break; + case REQUIREMENTS: + tgt.setValue(CapabilityStatement.CapabilityStatementKind.REQUIREMENTS); + break; + default: + tgt.setValue(CapabilityStatement.CapabilityStatementKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertDocumentMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Conformance.DocumentModeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case PRODUCER: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.DocumentMode.PRODUCER); - break; - case CONSUMER: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.DocumentMode.CONSUMER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.DocumentMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Conformance.DocumentModeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRODUCER: + tgt.setValue(Conformance.DocumentMode.PRODUCER); + break; + case CONSUMER: + tgt.setValue(Conformance.DocumentMode.CONSUMER); + break; + default: + tgt.setValue(Conformance.DocumentMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertDocumentMode(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.DocumentModeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case PRODUCER: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.DocumentMode.PRODUCER); - break; - case CONSUMER: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.DocumentMode.CONSUMER); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.DocumentMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new CapabilityStatement.DocumentModeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRODUCER: + tgt.setValue(CapabilityStatement.DocumentMode.PRODUCER); + break; + case CONSUMER: + tgt.setValue(CapabilityStatement.DocumentMode.CONSUMER); + break; + default: + tgt.setValue(CapabilityStatement.DocumentMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r4.model.CapabilityStatement.ResourceInteractionComponent convertResourceInteractionComponent(org.hl7.fhir.dstu2.model.Conformance.ResourceInteractionComponent src) throws FHIRException { @@ -674,85 +701,101 @@ public static org.hl7.fhir.dstu2.model.Conformance.ResourceInteractionComponent } static public org.hl7.fhir.r4.model.Enumeration convertResourceVersionPolicy(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicyEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case NOVERSION: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy.NOVERSION); - break; - case VERSIONED: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy.VERSIONED); - break; - case VERSIONEDUPDATE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy.VERSIONEDUPDATE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new CapabilityStatement.ResourceVersionPolicyEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOVERSION: + tgt.setValue(CapabilityStatement.ResourceVersionPolicy.NOVERSION); + break; + case VERSIONED: + tgt.setValue(CapabilityStatement.ResourceVersionPolicy.VERSIONED); + break; + case VERSIONEDUPDATE: + tgt.setValue(CapabilityStatement.ResourceVersionPolicy.VERSIONEDUPDATE); + break; + default: + tgt.setValue(CapabilityStatement.ResourceVersionPolicy.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertResourceVersionPolicy(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Conformance.ResourceVersionPolicyEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case NOVERSION: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ResourceVersionPolicy.NOVERSION); - break; - case VERSIONED: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ResourceVersionPolicy.VERSIONED); - break; - case VERSIONEDUPDATE: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ResourceVersionPolicy.VERSIONEDUPDATE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ResourceVersionPolicy.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Conformance.ResourceVersionPolicyEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOVERSION: + tgt.setValue(Conformance.ResourceVersionPolicy.NOVERSION); + break; + case VERSIONED: + tgt.setValue(Conformance.ResourceVersionPolicy.VERSIONED); + break; + case VERSIONEDUPDATE: + tgt.setValue(Conformance.ResourceVersionPolicy.VERSIONEDUPDATE); + break; + default: + tgt.setValue(Conformance.ResourceVersionPolicy.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertRestfulConformanceMode(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityModeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case CLIENT: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityMode.CLIENT); - break; - case SERVER: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityMode.SERVER); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new CapabilityStatement.RestfulCapabilityModeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CLIENT: + tgt.setValue(CapabilityStatement.RestfulCapabilityMode.CLIENT); + break; + case SERVER: + tgt.setValue(CapabilityStatement.RestfulCapabilityMode.SERVER); + break; + default: + tgt.setValue(CapabilityStatement.RestfulCapabilityMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertRestfulConformanceMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Conformance.RestfulConformanceModeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case CLIENT: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.RestfulConformanceMode.CLIENT); - break; - case SERVER: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.RestfulConformanceMode.SERVER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.RestfulConformanceMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Conformance.RestfulConformanceModeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CLIENT: + tgt.setValue(Conformance.RestfulConformanceMode.CLIENT); + break; + case SERVER: + tgt.setValue(Conformance.RestfulConformanceMode.SERVER); + break; + default: + tgt.setValue(Conformance.RestfulConformanceMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2.model.Conformance.SystemInteractionComponent convertSystemInteractionComponent(org.hl7.fhir.r4.model.CapabilityStatement.SystemInteractionComponent src) throws FHIRException { @@ -780,121 +823,137 @@ public static org.hl7.fhir.r4.model.CapabilityStatement.SystemInteractionCompone } static public org.hl7.fhir.dstu2.model.Enumeration convertSystemRestfulInteraction(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Conformance.SystemRestfulInteractionEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case TRANSACTION: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.SystemRestfulInteraction.TRANSACTION); - break; - case SEARCHSYSTEM: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.SystemRestfulInteraction.SEARCHSYSTEM); - break; - case HISTORYSYSTEM: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.SystemRestfulInteraction.HISTORYSYSTEM); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.SystemRestfulInteraction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Conformance.SystemRestfulInteractionEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case TRANSACTION: + tgt.setValue(Conformance.SystemRestfulInteraction.TRANSACTION); + break; + case SEARCHSYSTEM: + tgt.setValue(Conformance.SystemRestfulInteraction.SEARCHSYSTEM); + break; + case HISTORYSYSTEM: + tgt.setValue(Conformance.SystemRestfulInteraction.HISTORYSYSTEM); + break; + default: + tgt.setValue(Conformance.SystemRestfulInteraction.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertSystemRestfulInteraction(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteractionEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case TRANSACTION: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.TRANSACTION); - break; - case SEARCHSYSTEM: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.SEARCHSYSTEM); - break; - case HISTORYSYSTEM: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.HISTORYSYSTEM); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new CapabilityStatement.SystemRestfulInteractionEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case TRANSACTION: + tgt.setValue(SystemRestfulInteraction.TRANSACTION); + break; + case SEARCHSYSTEM: + tgt.setValue(SystemRestfulInteraction.SEARCHSYSTEM); + break; + case HISTORYSYSTEM: + tgt.setValue(SystemRestfulInteraction.HISTORYSYSTEM); + break; + default: + tgt.setValue(SystemRestfulInteraction.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertTypeRestfulInteraction(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Conformance.TypeRestfulInteractionEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case READ: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.TypeRestfulInteraction.READ); - break; - case VREAD: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.TypeRestfulInteraction.VREAD); - break; - case UPDATE: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.TypeRestfulInteraction.UPDATE); - break; - case DELETE: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.TypeRestfulInteraction.DELETE); - break; - case HISTORYINSTANCE: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.TypeRestfulInteraction.HISTORYINSTANCE); - break; - case HISTORYTYPE: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.TypeRestfulInteraction.HISTORYTYPE); - break; - case CREATE: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.TypeRestfulInteraction.CREATE); - break; - case SEARCHTYPE: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.TypeRestfulInteraction.SEARCHTYPE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.TypeRestfulInteraction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Conformance.TypeRestfulInteractionEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case READ: + tgt.setValue(Conformance.TypeRestfulInteraction.READ); + break; + case VREAD: + tgt.setValue(Conformance.TypeRestfulInteraction.VREAD); + break; + case UPDATE: + tgt.setValue(Conformance.TypeRestfulInteraction.UPDATE); + break; + case DELETE: + tgt.setValue(Conformance.TypeRestfulInteraction.DELETE); + break; + case HISTORYINSTANCE: + tgt.setValue(Conformance.TypeRestfulInteraction.HISTORYINSTANCE); + break; + case HISTORYTYPE: + tgt.setValue(Conformance.TypeRestfulInteraction.HISTORYTYPE); + break; + case CREATE: + tgt.setValue(Conformance.TypeRestfulInteraction.CREATE); + break; + case SEARCHTYPE: + tgt.setValue(Conformance.TypeRestfulInteraction.SEARCHTYPE); + break; + default: + tgt.setValue(Conformance.TypeRestfulInteraction.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertTypeRestfulInteraction(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteractionEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case READ: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.READ); - break; - case VREAD: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.VREAD); - break; - case UPDATE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.UPDATE); - break; - case DELETE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.DELETE); - break; - case HISTORYINSTANCE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.HISTORYINSTANCE); - break; - case HISTORYTYPE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.HISTORYTYPE); - break; - case CREATE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.CREATE); - break; - case SEARCHTYPE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.SEARCHTYPE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new CapabilityStatement.TypeRestfulInteractionEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case READ: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.READ); + break; + case VREAD: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.VREAD); + break; + case UPDATE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.UPDATE); + break; + case DELETE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.DELETE); + break; + case HISTORYINSTANCE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.HISTORYINSTANCE); + break; + case HISTORYTYPE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.HISTORYTYPE); + break; + case CREATE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.CREATE); + break; + case SEARCHTYPE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.SEARCHTYPE); + break; + default: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertConformanceEventMode(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { @@ -902,20 +961,20 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityModeEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityMode.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case SENDER: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityMode.SENDER); - break; - case RECEIVER: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityMode.RECEIVER); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityMode.NULL); - break; - } - } + tgt.setValue(CapabilityStatement.EventCapabilityMode.SENDER); + break; + case RECEIVER: + tgt.setValue(CapabilityStatement.EventCapabilityMode.RECEIVER); + break; + default: + tgt.setValue(CapabilityStatement.EventCapabilityMode.NULL); + break; + } +} return tgt; } @@ -924,20 +983,20 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Conformance.ConformanceEventModeEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ConformanceEventMode.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case SENDER: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ConformanceEventMode.SENDER); - break; - case RECEIVER: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ConformanceEventMode.RECEIVER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ConformanceEventMode.NULL); - break; - } - } + tgt.setValue(Conformance.ConformanceEventMode.SENDER); + break; + case RECEIVER: + tgt.setValue(Conformance.ConformanceEventMode.RECEIVER); + break; + default: + tgt.setValue(Conformance.ConformanceEventMode.NULL); + break; + } +} return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/DetectedIssue10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/DetectedIssue10_40.java index 67f413e38c..5ca044f215 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/DetectedIssue10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/DetectedIssue10_40.java @@ -7,6 +7,8 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.DateTime10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.String10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Uri10_40; +import org.hl7.fhir.dstu2.model.DetectedIssue; +import org.hl7.fhir.dstu2.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; public class DetectedIssue10_40 { @@ -95,46 +97,54 @@ public static org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueMitigationComp } static public org.hl7.fhir.dstu2.model.Enumeration convertDetectedIssueSeverity(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueSeverityEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case HIGH: - tgt.setValue(org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueSeverity.HIGH); - break; - case MODERATE: - tgt.setValue(org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueSeverity.MODERATE); - break; - case LOW: - tgt.setValue(org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueSeverity.LOW); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueSeverity.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DetectedIssue.DetectedIssueSeverityEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case HIGH: + tgt.setValue(DetectedIssue.DetectedIssueSeverity.HIGH); + break; + case MODERATE: + tgt.setValue(DetectedIssue.DetectedIssueSeverity.MODERATE); + break; + case LOW: + tgt.setValue(DetectedIssue.DetectedIssueSeverity.LOW); + break; + default: + tgt.setValue(DetectedIssue.DetectedIssueSeverity.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertDetectedIssueSeverity(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverityEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case HIGH: - tgt.setValue(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverity.HIGH); - break; - case MODERATE: - tgt.setValue(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverity.MODERATE); - break; - case LOW: - tgt.setValue(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverity.LOW); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverity.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverityEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case HIGH: + tgt.setValue(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverity.HIGH); + break; + case MODERATE: + tgt.setValue(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverity.MODERATE); + break; + case LOW: + tgt.setValue(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverity.LOW); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverity.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/DeviceMetric10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/DeviceMetric10_40.java index 6c5a095ed5..d7101d609e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/DeviceMetric10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/DeviceMetric10_40.java @@ -7,6 +7,8 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.Timing10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Instant10_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.DeviceMetric; +import org.hl7.fhir.r4.model.Enumeration; public class DeviceMetric10_40 { @@ -95,270 +97,310 @@ public static org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationComponen } static public org.hl7.fhir.r4.model.Enumeration convertDeviceMetricCalibrationState(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationStateEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case NOTCALIBRATED: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationState.NOTCALIBRATED); - break; - case CALIBRATIONREQUIRED: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATIONREQUIRED); - break; - case CALIBRATED: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATED); - break; - case UNSPECIFIED: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationState.UNSPECIFIED); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationState.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DeviceMetric.DeviceMetricCalibrationStateEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTCALIBRATED: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationState.NOTCALIBRATED); + break; + case CALIBRATIONREQUIRED: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationState.CALIBRATIONREQUIRED); + break; + case CALIBRATED: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationState.CALIBRATED); + break; + case UNSPECIFIED: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationState.UNSPECIFIED); + break; + default: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationState.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertDeviceMetricCalibrationState(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationStateEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case NOTCALIBRATED: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState.NOTCALIBRATED); - break; - case CALIBRATIONREQUIRED: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATIONREQUIRED); - break; - case CALIBRATED: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATED); - break; - case UNSPECIFIED: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState.UNSPECIFIED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationStateEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTCALIBRATED: + tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState.NOTCALIBRATED); + break; + case CALIBRATIONREQUIRED: + tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATIONREQUIRED); + break; + case CALIBRATED: + tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATED); + break; + case UNSPECIFIED: + tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState.UNSPECIFIED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertDeviceMetricCalibrationType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationTypeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case UNSPECIFIED: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationType.UNSPECIFIED); - break; - case OFFSET: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationType.OFFSET); - break; - case GAIN: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationType.GAIN); - break; - case TWOPOINT: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationType.TWOPOINT); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DeviceMetric.DeviceMetricCalibrationTypeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case UNSPECIFIED: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationType.UNSPECIFIED); + break; + case OFFSET: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationType.OFFSET); + break; + case GAIN: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationType.GAIN); + break; + case TWOPOINT: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationType.TWOPOINT); + break; + default: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertDeviceMetricCalibrationType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationTypeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case UNSPECIFIED: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType.UNSPECIFIED); - break; - case OFFSET: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType.OFFSET); - break; - case GAIN: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType.GAIN); - break; - case TWOPOINT: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType.TWOPOINT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationTypeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case UNSPECIFIED: + tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType.UNSPECIFIED); + break; + case OFFSET: + tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType.OFFSET); + break; + case GAIN: + tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType.GAIN); + break; + case TWOPOINT: + tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType.TWOPOINT); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertDeviceMetricCategory(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCategoryEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case MEASUREMENT: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCategory.MEASUREMENT); - break; - case SETTING: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCategory.SETTING); - break; - case CALCULATION: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCategory.CALCULATION); - break; - case UNSPECIFIED: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCategory.UNSPECIFIED); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCategory.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DeviceMetric.DeviceMetricCategoryEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MEASUREMENT: + tgt.setValue(DeviceMetric.DeviceMetricCategory.MEASUREMENT); + break; + case SETTING: + tgt.setValue(DeviceMetric.DeviceMetricCategory.SETTING); + break; + case CALCULATION: + tgt.setValue(DeviceMetric.DeviceMetricCategory.CALCULATION); + break; + case UNSPECIFIED: + tgt.setValue(DeviceMetric.DeviceMetricCategory.UNSPECIFIED); + break; + default: + tgt.setValue(DeviceMetric.DeviceMetricCategory.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertDeviceMetricCategory(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategoryEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case MEASUREMENT: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory.MEASUREMENT); - break; - case SETTING: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory.SETTING); - break; - case CALCULATION: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory.CALCULATION); - break; - case UNSPECIFIED: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory.UNSPECIFIED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategoryEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MEASUREMENT: + tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory.MEASUREMENT); + break; + case SETTING: + tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory.SETTING); + break; + case CALCULATION: + tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory.CALCULATION); + break; + case UNSPECIFIED: + tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory.UNSPECIFIED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertDeviceMetricColor(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColorEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case BLACK: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor.BLACK); - break; - case RED: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor.RED); - break; - case GREEN: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor.GREEN); - break; - case YELLOW: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor.YELLOW); - break; - case BLUE: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor.BLUE); - break; - case MAGENTA: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor.MAGENTA); - break; - case CYAN: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor.CYAN); - break; - case WHITE: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor.WHITE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DeviceMetric.DeviceMetricColorEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case BLACK: + tgt.setValue(DeviceMetric.DeviceMetricColor.BLACK); + break; + case RED: + tgt.setValue(DeviceMetric.DeviceMetricColor.RED); + break; + case GREEN: + tgt.setValue(DeviceMetric.DeviceMetricColor.GREEN); + break; + case YELLOW: + tgt.setValue(DeviceMetric.DeviceMetricColor.YELLOW); + break; + case BLUE: + tgt.setValue(DeviceMetric.DeviceMetricColor.BLUE); + break; + case MAGENTA: + tgt.setValue(DeviceMetric.DeviceMetricColor.MAGENTA); + break; + case CYAN: + tgt.setValue(DeviceMetric.DeviceMetricColor.CYAN); + break; + case WHITE: + tgt.setValue(DeviceMetric.DeviceMetricColor.WHITE); + break; + default: + tgt.setValue(DeviceMetric.DeviceMetricColor.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertDeviceMetricColor(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColorEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case BLACK: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.BLACK); - break; - case RED: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.RED); - break; - case GREEN: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.GREEN); - break; - case YELLOW: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.YELLOW); - break; - case BLUE: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.BLUE); - break; - case MAGENTA: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.MAGENTA); - break; - case CYAN: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.CYAN); - break; - case WHITE: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.WHITE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColorEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case BLACK: + tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.BLACK); + break; + case RED: + tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.RED); + break; + case GREEN: + tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.GREEN); + break; + case YELLOW: + tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.YELLOW); + break; + case BLUE: + tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.BLUE); + break; + case MAGENTA: + tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.MAGENTA); + break; + case CYAN: + tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.CYAN); + break; + case WHITE: + tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.WHITE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertDeviceMetricOperationalStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricOperationalStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case ON: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricOperationalStatus.ON); - break; - case OFF: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricOperationalStatus.OFF); - break; - case STANDBY: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricOperationalStatus.STANDBY); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricOperationalStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DeviceMetric.DeviceMetricOperationalStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ON: + tgt.setValue(DeviceMetric.DeviceMetricOperationalStatus.ON); + break; + case OFF: + tgt.setValue(DeviceMetric.DeviceMetricOperationalStatus.OFF); + break; + case STANDBY: + tgt.setValue(DeviceMetric.DeviceMetricOperationalStatus.STANDBY); + break; + default: + tgt.setValue(DeviceMetric.DeviceMetricOperationalStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertDeviceMetricOperationalStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case ON: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatus.ON); - break; - case OFF: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatus.OFF); - break; - case STANDBY: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatus.STANDBY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ON: + tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatus.ON); + break; + case OFF: + tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatus.OFF); + break; + case STANDBY: + tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatus.STANDBY); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/DiagnosticReport10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/DiagnosticReport10_40.java index 1049a490d5..a81b6e0133 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/DiagnosticReport10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/DiagnosticReport10_40.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Instant10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.String10_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.DiagnosticReport; +import org.hl7.fhir.r4.model.Enumeration; public class DiagnosticReport10_40 { @@ -108,70 +110,78 @@ public static org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportMediaCompon } static public org.hl7.fhir.r4.model.Enumeration convertDiagnosticReportStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.REGISTERED); - break; - case PARTIAL: - tgt.setValue(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.PARTIAL); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.FINAL); - break; - case CORRECTED: - tgt.setValue(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.CORRECTED); - break; - case APPENDED: - tgt.setValue(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.APPENDED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DiagnosticReport.DiagnosticReportStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.REGISTERED); + break; + case PARTIAL: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.PARTIAL); + break; + case FINAL: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.FINAL); + break; + case CORRECTED: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.CORRECTED); + break; + case APPENDED: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.APPENDED); + break; + case CANCELLED: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertDiagnosticReportStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.REGISTERED); - break; - case PARTIAL: - tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.PARTIAL); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.FINAL); - break; - case CORRECTED: - tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.CORRECTED); - break; - case APPENDED: - tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.APPENDED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.REGISTERED); + break; + case PARTIAL: + tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.PARTIAL); + break; + case FINAL: + tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.FINAL); + break; + case CORRECTED: + tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.CORRECTED); + break; + case APPENDED: + tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.APPENDED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/DocumentReference10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/DocumentReference10_40.java index c95d2637f4..6b07789e7a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/DocumentReference10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/DocumentReference10_40.java @@ -9,8 +9,11 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.Period10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.String10_40; import org.hl7.fhir.dstu2.model.CodeableConcept; +import org.hl7.fhir.dstu2.model.DocumentReference; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus; +import org.hl7.fhir.r4.model.Enumeration; +import org.hl7.fhir.r4.model.Enumerations; public class DocumentReference10_40 { @@ -236,96 +239,112 @@ public static org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceRelate } static public org.hl7.fhir.r4.model.Enumeration convertDocumentReferenceStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case CURRENT: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.CURRENT); - break; - case SUPERSEDED: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.SUPERSEDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.DocumentReferenceStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CURRENT: + tgt.setValue(Enumerations.DocumentReferenceStatus.CURRENT); + break; + case SUPERSEDED: + tgt.setValue(Enumerations.DocumentReferenceStatus.SUPERSEDED); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.DocumentReferenceStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Enumerations.DocumentReferenceStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertDocumentReferenceStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case CURRENT: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatus.CURRENT); - break; - case SUPERSEDED: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatus.SUPERSEDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CURRENT: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatus.CURRENT); + break; + case SUPERSEDED: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatus.SUPERSEDED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertDocumentRelationshipType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DocumentReference.DocumentRelationshipTypeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case REPLACES: - tgt.setValue(org.hl7.fhir.dstu2.model.DocumentReference.DocumentRelationshipType.REPLACES); - break; - case TRANSFORMS: - tgt.setValue(org.hl7.fhir.dstu2.model.DocumentReference.DocumentRelationshipType.TRANSFORMS); - break; - case SIGNS: - tgt.setValue(org.hl7.fhir.dstu2.model.DocumentReference.DocumentRelationshipType.SIGNS); - break; - case APPENDS: - tgt.setValue(org.hl7.fhir.dstu2.model.DocumentReference.DocumentRelationshipType.APPENDS); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.DocumentReference.DocumentRelationshipType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new DocumentReference.DocumentRelationshipTypeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REPLACES: + tgt.setValue(DocumentReference.DocumentRelationshipType.REPLACES); + break; + case TRANSFORMS: + tgt.setValue(DocumentReference.DocumentRelationshipType.TRANSFORMS); + break; + case SIGNS: + tgt.setValue(DocumentReference.DocumentRelationshipType.SIGNS); + break; + case APPENDS: + tgt.setValue(DocumentReference.DocumentRelationshipType.APPENDS); + break; + default: + tgt.setValue(DocumentReference.DocumentRelationshipType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertDocumentRelationshipType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipTypeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case REPLACES: - tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.REPLACES); - break; - case TRANSFORMS: - tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.TRANSFORMS); - break; - case SIGNS: - tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.SIGNS); - break; - case APPENDS: - tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.APPENDS); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipTypeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REPLACES: + tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.REPLACES); + break; + case TRANSFORMS: + tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.TRANSFORMS); + break; + case SIGNS: + tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.SIGNS); + break; + case APPENDS: + tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.APPENDS); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Encounter10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Encounter10_40.java index b647c297ac..91afed5d1b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Encounter10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Encounter10_40.java @@ -6,6 +6,8 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.Duration10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.Identifier10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.Period10_40; +import org.hl7.fhir.dstu2.model.Encounter; +import org.hl7.fhir.dstu2.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; public class Encounter10_40 { @@ -222,53 +224,61 @@ public static org.hl7.fhir.dstu2.model.Encounter.EncounterLocationComponent conv } static public org.hl7.fhir.dstu2.model.Enumeration convertEncounterLocationStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Encounter.EncounterLocationStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterLocationStatus.PLANNED); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterLocationStatus.ACTIVE); - break; - case RESERVED: - tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterLocationStatus.RESERVED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterLocationStatus.COMPLETED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterLocationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Encounter.EncounterLocationStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(Encounter.EncounterLocationStatus.PLANNED); + break; + case ACTIVE: + tgt.setValue(Encounter.EncounterLocationStatus.ACTIVE); + break; + case RESERVED: + tgt.setValue(Encounter.EncounterLocationStatus.RESERVED); + break; + case COMPLETED: + tgt.setValue(Encounter.EncounterLocationStatus.COMPLETED); + break; + default: + tgt.setValue(Encounter.EncounterLocationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertEncounterLocationStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Encounter.EncounterLocationStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus.PLANNED); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus.ACTIVE); - break; - case RESERVED: - tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus.RESERVED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus.COMPLETED); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Encounter.EncounterLocationStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus.PLANNED); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus.ACTIVE); + break; + case RESERVED: + tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus.RESERVED); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus.COMPLETED); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r4.model.Encounter.EncounterParticipantComponent convertEncounterParticipantComponent(org.hl7.fhir.dstu2.model.Encounter.EncounterParticipantComponent src) throws FHIRException { @@ -300,64 +310,72 @@ public static org.hl7.fhir.dstu2.model.Encounter.EncounterParticipantComponent c } static public org.hl7.fhir.dstu2.model.Enumeration convertEncounterState(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Encounter.EncounterStateEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterState.PLANNED); - break; - case ARRIVED: - tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterState.ARRIVED); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterState.INPROGRESS); - break; - case ONLEAVE: - tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterState.ONLEAVE); - break; - case FINISHED: - tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterState.FINISHED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterState.CANCELLED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterState.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Encounter.EncounterStateEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(Encounter.EncounterState.PLANNED); + break; + case ARRIVED: + tgt.setValue(Encounter.EncounterState.ARRIVED); + break; + case INPROGRESS: + tgt.setValue(Encounter.EncounterState.INPROGRESS); + break; + case ONLEAVE: + tgt.setValue(Encounter.EncounterState.ONLEAVE); + break; + case FINISHED: + tgt.setValue(Encounter.EncounterState.FINISHED); + break; + case CANCELLED: + tgt.setValue(Encounter.EncounterState.CANCELLED); + break; + default: + tgt.setValue(Encounter.EncounterState.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertEncounterState(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Encounter.EncounterStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterStatus.PLANNED); - break; - case ARRIVED: - tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterStatus.ARRIVED); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterStatus.INPROGRESS); - break; - case ONLEAVE: - tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterStatus.ONLEAVE); - break; - case FINISHED: - tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterStatus.FINISHED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterStatus.CANCELLED); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Encounter.EncounterStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterStatus.PLANNED); + break; + case ARRIVED: + tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterStatus.ARRIVED); + break; + case INPROGRESS: + tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterStatus.INPROGRESS); + break; + case ONLEAVE: + tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterStatus.ONLEAVE); + break; + case FINISHED: + tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterStatus.FINISHED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterStatus.CANCELLED); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Enumerations10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Enumerations10_40.java index a81e833a31..2ca77999a5 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Enumerations10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Enumerations10_40.java @@ -2,6 +2,7 @@ import org.hl7.fhir.convertors.context.ConversionContext10_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Enumerations; public class Enumerations10_40 { static public org.hl7.fhir.r4.model.Enumeration convertAdministrativeGender(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { @@ -9,26 +10,26 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.AdministrativeGenderEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case MALE: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.MALE); - break; - case FEMALE: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.FEMALE); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.OTHER); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.NULL); - break; - } - } + tgt.setValue(Enumerations.AdministrativeGender.MALE); + break; + case FEMALE: + tgt.setValue(Enumerations.AdministrativeGender.FEMALE); + break; + case OTHER: + tgt.setValue(Enumerations.AdministrativeGender.OTHER); + break; + case UNKNOWN: + tgt.setValue(Enumerations.AdministrativeGender.UNKNOWN); + break; + default: + tgt.setValue(Enumerations.AdministrativeGender.NULL); + break; + } +} return tgt; } @@ -37,26 +38,26 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGenderEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case MALE: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender.MALE); - break; - case FEMALE: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender.FEMALE); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender.OTHER); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender.MALE); + break; + case FEMALE: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender.FEMALE); + break; + case OTHER: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender.OTHER); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender.NULL); + break; + } +} return tgt; } @@ -65,38 +66,38 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.SearchParamTypeEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case NUMBER: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.NUMBER); - break; - case DATE: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.DATE); - break; - case STRING: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.STRING); - break; - case TOKEN: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.TOKEN); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.REFERENCE); - break; - case COMPOSITE: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.COMPOSITE); - break; - case QUANTITY: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.QUANTITY); - break; - case URI: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.URI); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.NULL); - break; - } - } + tgt.setValue(Enumerations.SearchParamType.NUMBER); + break; + case DATE: + tgt.setValue(Enumerations.SearchParamType.DATE); + break; + case STRING: + tgt.setValue(Enumerations.SearchParamType.STRING); + break; + case TOKEN: + tgt.setValue(Enumerations.SearchParamType.TOKEN); + break; + case REFERENCE: + tgt.setValue(Enumerations.SearchParamType.REFERENCE); + break; + case COMPOSITE: + tgt.setValue(Enumerations.SearchParamType.COMPOSITE); + break; + case QUANTITY: + tgt.setValue(Enumerations.SearchParamType.QUANTITY); + break; + case URI: + tgt.setValue(Enumerations.SearchParamType.URI); + break; + default: + tgt.setValue(Enumerations.SearchParamType.NULL); + break; + } +} return tgt; } @@ -105,38 +106,38 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Enumerations.SearchParamTypeEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case NUMBER: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.NUMBER); - break; - case DATE: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.DATE); - break; - case STRING: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.STRING); - break; - case TOKEN: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.TOKEN); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.REFERENCE); - break; - case COMPOSITE: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.COMPOSITE); - break; - case QUANTITY: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.QUANTITY); - break; - case URI: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.URI); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.NUMBER); + break; + case DATE: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.DATE); + break; + case STRING: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.STRING); + break; + case TOKEN: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.TOKEN); + break; + case REFERENCE: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.REFERENCE); + break; + case COMPOSITE: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.COMPOSITE); + break; + case QUANTITY: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.QUANTITY); + break; + case URI: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.URI); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.NULL); + break; + } +} return tgt; } @@ -145,23 +146,23 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.PublicationStatusEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case DRAFT: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.ACTIVE); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.RETIRED); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.NULL); - break; - } - } + tgt.setValue(Enumerations.PublicationStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(Enumerations.PublicationStatus.ACTIVE); + break; + case RETIRED: + tgt.setValue(Enumerations.PublicationStatus.RETIRED); + break; + default: + tgt.setValue(Enumerations.PublicationStatus.NULL); + break; + } +} return tgt; } @@ -170,23 +171,23 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatusEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case DRAFT: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatus.ACTIVE); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatus.RETIRED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatus.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatus.ACTIVE); + break; + case RETIRED: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatus.RETIRED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatus.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/EpisodeOfCare10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/EpisodeOfCare10_40.java index 6852b93df1..f0829767b8 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/EpisodeOfCare10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/EpisodeOfCare10_40.java @@ -6,6 +6,8 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.Identifier10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.Period10_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Enumeration; +import org.hl7.fhir.r4.model.EpisodeOfCare; public class EpisodeOfCare10_40 { @@ -62,65 +64,73 @@ public static org.hl7.fhir.r4.model.EpisodeOfCare convertEpisodeOfCare(org.hl7.f } static public org.hl7.fhir.r4.model.Enumeration convertEpisodeOfCareStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.PLANNED); - break; - case WAITLIST: - tgt.setValue(org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.WAITLIST); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.ONHOLD); - break; - case FINISHED: - tgt.setValue(org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.FINISHED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.CANCELLED); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new EpisodeOfCare.EpisodeOfCareStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.PLANNED); + break; + case WAITLIST: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.WAITLIST); + break; + case ACTIVE: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.ONHOLD); + break; + case FINISHED: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.FINISHED); + break; + case CANCELLED: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.CANCELLED); + break; + default: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertEpisodeOfCareStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatus.PLANNED); - break; - case WAITLIST: - tgt.setValue(org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatus.WAITLIST); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatus.ONHOLD); - break; - case FINISHED: - tgt.setValue(org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatus.FINISHED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatus.CANCELLED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatus.PLANNED); + break; + case WAITLIST: + tgt.setValue(org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatus.WAITLIST); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatus.ONHOLD); + break; + case FINISHED: + tgt.setValue(org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatus.FINISHED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatus.CANCELLED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent convertEpisodeOfCareStatusHistoryComponent(org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/FamilyMemberHistory10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/FamilyMemberHistory10_40.java index 55af2a7702..a25bfc0f9d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/FamilyMemberHistory10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/FamilyMemberHistory10_40.java @@ -7,57 +7,67 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.DateTime10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.String10_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Enumeration; +import org.hl7.fhir.r4.model.FamilyMemberHistory; public class FamilyMemberHistory10_40 { static public org.hl7.fhir.r4.model.Enumeration convertFamilyHistoryStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case PARTIAL: - tgt.setValue(org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus.PARTIAL); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus.ENTEREDINERROR); - break; - case HEALTHUNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus.HEALTHUNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new FamilyMemberHistory.FamilyHistoryStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PARTIAL: + tgt.setValue(FamilyMemberHistory.FamilyHistoryStatus.PARTIAL); + break; + case COMPLETED: + tgt.setValue(FamilyMemberHistory.FamilyHistoryStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(FamilyMemberHistory.FamilyHistoryStatus.ENTEREDINERROR); + break; + case HEALTHUNKNOWN: + tgt.setValue(FamilyMemberHistory.FamilyHistoryStatus.HEALTHUNKNOWN); + break; + default: + tgt.setValue(FamilyMemberHistory.FamilyHistoryStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertFamilyHistoryStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyHistoryStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case PARTIAL: - tgt.setValue(org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyHistoryStatus.PARTIAL); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyHistoryStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyHistoryStatus.ENTEREDINERROR); - break; - case HEALTHUNKNOWN: - tgt.setValue(org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyHistoryStatus.HEALTHUNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyHistoryStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyHistoryStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PARTIAL: + tgt.setValue(org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyHistoryStatus.PARTIAL); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyHistoryStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyHistoryStatus.ENTEREDINERROR); + break; + case HEALTHUNKNOWN: + tgt.setValue(org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyHistoryStatus.HEALTHUNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyHistoryStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r4.model.FamilyMemberHistory convertFamilyMemberHistory(org.hl7.fhir.dstu2.model.FamilyMemberHistory src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Flag10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Flag10_40.java index eca19a7434..ade3a287b4 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Flag10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Flag10_40.java @@ -5,6 +5,8 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.CodeableConcept10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.Identifier10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.Period10_40; +import org.hl7.fhir.dstu2.model.Enumeration; +import org.hl7.fhir.dstu2.model.Flag; import org.hl7.fhir.exceptions.FHIRException; public class Flag10_40 { @@ -58,46 +60,54 @@ public static org.hl7.fhir.dstu2.model.Flag convertFlag(org.hl7.fhir.r4.model.Fl } static public org.hl7.fhir.dstu2.model.Enumeration convertFlagStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Flag.FlagStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.Flag.FlagStatus.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.Flag.FlagStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.Flag.FlagStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Flag.FlagStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Flag.FlagStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Flag.FlagStatus.ACTIVE); + break; + case INACTIVE: + tgt.setValue(Flag.FlagStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(Flag.FlagStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Flag.FlagStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertFlagStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Flag.FlagStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Flag.FlagStatus.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Flag.FlagStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Flag.FlagStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Flag.FlagStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Flag.FlagStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4.model.Flag.FlagStatus.ACTIVE); + break; + case INACTIVE: + tgt.setValue(org.hl7.fhir.r4.model.Flag.FlagStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.Flag.FlagStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Flag.FlagStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Group10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Group10_40.java index 244efcd7ec..b8027f0d94 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Group10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Group10_40.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Boolean10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.String10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.UnsignedInt10_40; +import org.hl7.fhir.dstu2.model.Enumeration; +import org.hl7.fhir.dstu2.model.Group; import org.hl7.fhir.exceptions.FHIRException; public class Group10_40 { @@ -121,64 +123,72 @@ public static org.hl7.fhir.dstu2.model.Group.GroupMemberComponent convertGroupMe } static public org.hl7.fhir.dstu2.model.Enumeration convertGroupType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Group.GroupTypeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case PERSON: - tgt.setValue(org.hl7.fhir.dstu2.model.Group.GroupType.PERSON); - break; - case ANIMAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Group.GroupType.ANIMAL); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.dstu2.model.Group.GroupType.PRACTITIONER); - break; - case DEVICE: - tgt.setValue(org.hl7.fhir.dstu2.model.Group.GroupType.DEVICE); - break; - case MEDICATION: - tgt.setValue(org.hl7.fhir.dstu2.model.Group.GroupType.MEDICATION); - break; - case SUBSTANCE: - tgt.setValue(org.hl7.fhir.dstu2.model.Group.GroupType.SUBSTANCE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Group.GroupType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Group.GroupTypeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PERSON: + tgt.setValue(Group.GroupType.PERSON); + break; + case ANIMAL: + tgt.setValue(Group.GroupType.ANIMAL); + break; + case PRACTITIONER: + tgt.setValue(Group.GroupType.PRACTITIONER); + break; + case DEVICE: + tgt.setValue(Group.GroupType.DEVICE); + break; + case MEDICATION: + tgt.setValue(Group.GroupType.MEDICATION); + break; + case SUBSTANCE: + tgt.setValue(Group.GroupType.SUBSTANCE); + break; + default: + tgt.setValue(Group.GroupType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertGroupType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Group.GroupTypeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case PERSON: - tgt.setValue(org.hl7.fhir.r4.model.Group.GroupType.PERSON); - break; - case ANIMAL: - tgt.setValue(org.hl7.fhir.r4.model.Group.GroupType.ANIMAL); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.r4.model.Group.GroupType.PRACTITIONER); - break; - case DEVICE: - tgt.setValue(org.hl7.fhir.r4.model.Group.GroupType.DEVICE); - break; - case MEDICATION: - tgt.setValue(org.hl7.fhir.r4.model.Group.GroupType.MEDICATION); - break; - case SUBSTANCE: - tgt.setValue(org.hl7.fhir.r4.model.Group.GroupType.SUBSTANCE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Group.GroupType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Group.GroupTypeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PERSON: + tgt.setValue(org.hl7.fhir.r4.model.Group.GroupType.PERSON); + break; + case ANIMAL: + tgt.setValue(org.hl7.fhir.r4.model.Group.GroupType.ANIMAL); + break; + case PRACTITIONER: + tgt.setValue(org.hl7.fhir.r4.model.Group.GroupType.PRACTITIONER); + break; + case DEVICE: + tgt.setValue(org.hl7.fhir.r4.model.Group.GroupType.DEVICE); + break; + case MEDICATION: + tgt.setValue(org.hl7.fhir.r4.model.Group.GroupType.MEDICATION); + break; + case SUBSTANCE: + tgt.setValue(org.hl7.fhir.r4.model.Group.GroupType.SUBSTANCE); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Group.GroupType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/HealthcareService10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/HealthcareService10_40.java index 13eb481b6b..5460286f10 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/HealthcareService10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/HealthcareService10_40.java @@ -13,75 +13,85 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.String10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Time10_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Enumeration; +import org.hl7.fhir.r4.model.HealthcareService; public class HealthcareService10_40 { static public org.hl7.fhir.r4.model.Enumeration convertDaysOfWeek(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.HealthcareService.DaysOfWeekEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case MON: - tgt.setValue(org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.MON); - break; - case TUE: - tgt.setValue(org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.TUE); - break; - case WED: - tgt.setValue(org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.WED); - break; - case THU: - tgt.setValue(org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.THU); - break; - case FRI: - tgt.setValue(org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.FRI); - break; - case SAT: - tgt.setValue(org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.SAT); - break; - case SUN: - tgt.setValue(org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.SUN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new HealthcareService.DaysOfWeekEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MON: + tgt.setValue(HealthcareService.DaysOfWeek.MON); + break; + case TUE: + tgt.setValue(HealthcareService.DaysOfWeek.TUE); + break; + case WED: + tgt.setValue(HealthcareService.DaysOfWeek.WED); + break; + case THU: + tgt.setValue(HealthcareService.DaysOfWeek.THU); + break; + case FRI: + tgt.setValue(HealthcareService.DaysOfWeek.FRI); + break; + case SAT: + tgt.setValue(HealthcareService.DaysOfWeek.SAT); + break; + case SUN: + tgt.setValue(HealthcareService.DaysOfWeek.SUN); + break; + default: + tgt.setValue(HealthcareService.DaysOfWeek.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertDaysOfWeek(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.HealthcareService.DaysOfWeekEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case MON: - tgt.setValue(org.hl7.fhir.dstu2.model.HealthcareService.DaysOfWeek.MON); - break; - case TUE: - tgt.setValue(org.hl7.fhir.dstu2.model.HealthcareService.DaysOfWeek.TUE); - break; - case WED: - tgt.setValue(org.hl7.fhir.dstu2.model.HealthcareService.DaysOfWeek.WED); - break; - case THU: - tgt.setValue(org.hl7.fhir.dstu2.model.HealthcareService.DaysOfWeek.THU); - break; - case FRI: - tgt.setValue(org.hl7.fhir.dstu2.model.HealthcareService.DaysOfWeek.FRI); - break; - case SAT: - tgt.setValue(org.hl7.fhir.dstu2.model.HealthcareService.DaysOfWeek.SAT); - break; - case SUN: - tgt.setValue(org.hl7.fhir.dstu2.model.HealthcareService.DaysOfWeek.SUN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.HealthcareService.DaysOfWeek.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.HealthcareService.DaysOfWeekEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MON: + tgt.setValue(org.hl7.fhir.dstu2.model.HealthcareService.DaysOfWeek.MON); + break; + case TUE: + tgt.setValue(org.hl7.fhir.dstu2.model.HealthcareService.DaysOfWeek.TUE); + break; + case WED: + tgt.setValue(org.hl7.fhir.dstu2.model.HealthcareService.DaysOfWeek.WED); + break; + case THU: + tgt.setValue(org.hl7.fhir.dstu2.model.HealthcareService.DaysOfWeek.THU); + break; + case FRI: + tgt.setValue(org.hl7.fhir.dstu2.model.HealthcareService.DaysOfWeek.FRI); + break; + case SAT: + tgt.setValue(org.hl7.fhir.dstu2.model.HealthcareService.DaysOfWeek.SAT); + break; + case SUN: + tgt.setValue(org.hl7.fhir.dstu2.model.HealthcareService.DaysOfWeek.SUN); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.HealthcareService.DaysOfWeek.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r4.model.HealthcareService convertHealthcareService(org.hl7.fhir.dstu2.model.HealthcareService src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/List10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/List10_40.java index 63322bdb8d..a11402fadc 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/List10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/List10_40.java @@ -8,7 +8,10 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Boolean10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.DateTime10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.String10_40; +import org.hl7.fhir.dstu2.model.Enumeration; +import org.hl7.fhir.dstu2.model.List_; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.ListResource; public class List10_40 { @@ -106,91 +109,107 @@ public static org.hl7.fhir.dstu2.model.List_.ListEntryComponent convertListEntry } static public org.hl7.fhir.dstu2.model.Enumeration convertListMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.List_.ListModeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case WORKING: - tgt.setValue(org.hl7.fhir.dstu2.model.List_.ListMode.WORKING); - break; - case SNAPSHOT: - tgt.setValue(org.hl7.fhir.dstu2.model.List_.ListMode.SNAPSHOT); - break; - case CHANGES: - tgt.setValue(org.hl7.fhir.dstu2.model.List_.ListMode.CHANGES); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.List_.ListMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new List_.ListModeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case WORKING: + tgt.setValue(List_.ListMode.WORKING); + break; + case SNAPSHOT: + tgt.setValue(List_.ListMode.SNAPSHOT); + break; + case CHANGES: + tgt.setValue(List_.ListMode.CHANGES); + break; + default: + tgt.setValue(List_.ListMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertListMode(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ListResource.ListModeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case WORKING: - tgt.setValue(org.hl7.fhir.r4.model.ListResource.ListMode.WORKING); - break; - case SNAPSHOT: - tgt.setValue(org.hl7.fhir.r4.model.ListResource.ListMode.SNAPSHOT); - break; - case CHANGES: - tgt.setValue(org.hl7.fhir.r4.model.ListResource.ListMode.CHANGES); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ListResource.ListMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new ListResource.ListModeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case WORKING: + tgt.setValue(ListResource.ListMode.WORKING); + break; + case SNAPSHOT: + tgt.setValue(ListResource.ListMode.SNAPSHOT); + break; + case CHANGES: + tgt.setValue(ListResource.ListMode.CHANGES); + break; + default: + tgt.setValue(ListResource.ListMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertListStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ListResource.ListStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case CURRENT: - tgt.setValue(org.hl7.fhir.r4.model.ListResource.ListStatus.CURRENT); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.r4.model.ListResource.ListStatus.RETIRED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.ListResource.ListStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ListResource.ListStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new ListResource.ListStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CURRENT: + tgt.setValue(ListResource.ListStatus.CURRENT); + break; + case RETIRED: + tgt.setValue(ListResource.ListStatus.RETIRED); + break; + case ENTEREDINERROR: + tgt.setValue(ListResource.ListStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(ListResource.ListStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertListStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.List_.ListStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case CURRENT: - tgt.setValue(org.hl7.fhir.dstu2.model.List_.ListStatus.CURRENT); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.dstu2.model.List_.ListStatus.RETIRED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.List_.ListStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.List_.ListStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new List_.ListStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CURRENT: + tgt.setValue(List_.ListStatus.CURRENT); + break; + case RETIRED: + tgt.setValue(List_.ListStatus.RETIRED); + break; + case ENTEREDINERROR: + tgt.setValue(List_.ListStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(List_.ListStatus.NULL); + break; + } + } + return tgt; } public static void copyBackboneElement(org.hl7.fhir.r4.model.BackboneElement src, org.hl7.fhir.dstu2.model.BackboneElement tgt) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Location10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Location10_40.java index 6193b3ad57..0132ecc93c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Location10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Location10_40.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Decimal10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.String10_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Enumeration; +import org.hl7.fhir.r4.model.Location; public class Location10_40 { @@ -77,41 +79,49 @@ public static org.hl7.fhir.r4.model.Location convertLocation(org.hl7.fhir.dstu2. } static public org.hl7.fhir.r4.model.Enumeration convertLocationMode(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Location.LocationModeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.r4.model.Location.LocationMode.INSTANCE); - break; - case KIND: - tgt.setValue(org.hl7.fhir.r4.model.Location.LocationMode.KIND); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Location.LocationMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Location.LocationModeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(Location.LocationMode.INSTANCE); + break; + case KIND: + tgt.setValue(Location.LocationMode.KIND); + break; + default: + tgt.setValue(Location.LocationMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertLocationMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Location.LocationModeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.dstu2.model.Location.LocationMode.INSTANCE); - break; - case KIND: - tgt.setValue(org.hl7.fhir.dstu2.model.Location.LocationMode.KIND); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Location.LocationMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Location.LocationModeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(org.hl7.fhir.dstu2.model.Location.LocationMode.INSTANCE); + break; + case KIND: + tgt.setValue(org.hl7.fhir.dstu2.model.Location.LocationMode.KIND); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Location.LocationMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r4.model.Location.LocationPositionComponent convertLocationPositionComponent(org.hl7.fhir.dstu2.model.Location.LocationPositionComponent src) throws FHIRException { @@ -143,46 +153,54 @@ public static org.hl7.fhir.dstu2.model.Location.LocationPositionComponent conver } static public org.hl7.fhir.r4.model.Enumeration convertLocationStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Location.LocationStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Location.LocationStatus.ACTIVE); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.r4.model.Location.LocationStatus.SUSPENDED); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Location.LocationStatus.INACTIVE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Location.LocationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Location.LocationStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Location.LocationStatus.ACTIVE); + break; + case SUSPENDED: + tgt.setValue(Location.LocationStatus.SUSPENDED); + break; + case INACTIVE: + tgt.setValue(Location.LocationStatus.INACTIVE); + break; + default: + tgt.setValue(Location.LocationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertLocationStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Location.LocationStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.Location.LocationStatus.ACTIVE); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.dstu2.model.Location.LocationStatus.SUSPENDED); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.Location.LocationStatus.INACTIVE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Location.LocationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Location.LocationStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu2.model.Location.LocationStatus.ACTIVE); + break; + case SUSPENDED: + tgt.setValue(org.hl7.fhir.dstu2.model.Location.LocationStatus.SUSPENDED); + break; + case INACTIVE: + tgt.setValue(org.hl7.fhir.dstu2.model.Location.LocationStatus.INACTIVE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Location.LocationStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/MedicationDispense10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/MedicationDispense10_40.java index 94aaff812d..14914eb5be 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/MedicationDispense10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/MedicationDispense10_40.java @@ -12,6 +12,8 @@ import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4.model.Dosage; import org.hl7.fhir.r4.model.Dosage.DosageDoseAndRateComponent; +import org.hl7.fhir.r4.model.Enumeration; +import org.hl7.fhir.r4.model.MedicationDispense; public class MedicationDispense10_40 { @@ -137,71 +139,79 @@ public static org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseDosa } private static org.hl7.fhir.r4.model.Enumeration convertMedicationDispenseStatus(org.hl7.fhir.dstu2.model.Enumeration src) { - if (src == null) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseStatus.ENTEREDINERROR); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseStatus.INPROGRESS); - break; - case NULL: - tgt.setValue(org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseStatus.NULL); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseStatus.ONHOLD); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseStatus.STOPPED); - break; - } - return tgt; + if (src == null) + return null; + Enumeration tgt = new Enumeration<>(new MedicationDispense.MedicationDispenseStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case COMPLETED: + tgt.setValue(MedicationDispense.MedicationDispenseStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(MedicationDispense.MedicationDispenseStatus.ENTEREDINERROR); + break; + case INPROGRESS: + tgt.setValue(MedicationDispense.MedicationDispenseStatus.INPROGRESS); + break; + case NULL: + tgt.setValue(MedicationDispense.MedicationDispenseStatus.NULL); + break; + case ONHOLD: + tgt.setValue(MedicationDispense.MedicationDispenseStatus.ONHOLD); + break; + case STOPPED: + tgt.setValue(MedicationDispense.MedicationDispenseStatus.STOPPED); + break; + } + } + return tgt; } private static org.hl7.fhir.dstu2.model.Enumeration convertMedicationDispenseStatus(org.hl7.fhir.r4.model.Enumeration src) { - if (src == null) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatus.STOPPED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatus.COMPLETED); - break; - case DECLINED: - tgt.setValue(org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatus.STOPPED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatus.ENTEREDINERROR); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatus.INPROGRESS); - break; - case NULL: - tgt.setValue(org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatus.NULL); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatus.ONHOLD); - break; - case PREPARATION: - tgt.setValue(org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatus.INPROGRESS); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatus.STOPPED); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatus.NULL); - break; - } - return tgt; + if (src == null) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CANCELLED: + tgt.setValue(org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatus.STOPPED); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatus.COMPLETED); + break; + case DECLINED: + tgt.setValue(org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatus.STOPPED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatus.ENTEREDINERROR); + break; + case INPROGRESS: + tgt.setValue(org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatus.INPROGRESS); + break; + case NULL: + tgt.setValue(org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatus.NULL); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatus.ONHOLD); + break; + case PREPARATION: + tgt.setValue(org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatus.INPROGRESS); + break; + case STOPPED: + tgt.setValue(org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatus.STOPPED); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseSubstitutionComponent convertMedicationDispenseSubstitutionComponent(org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseSubstitutionComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/MedicationStatement10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/MedicationStatement10_40.java index 54bb81f4fd..8e697344dc 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/MedicationStatement10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/MedicationStatement10_40.java @@ -10,6 +10,8 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.String10_40; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4.model.Dosage.DosageDoseAndRateComponent; +import org.hl7.fhir.r4.model.Enumeration; +import org.hl7.fhir.r4.model.MedicationStatement; public class MedicationStatement10_40 { @@ -119,52 +121,60 @@ public static org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementDo } static public org.hl7.fhir.r4.model.Enumeration convertMedicationStatementStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.ACTIVE); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.ENTEREDINERROR); - break; - case INTENDED: - tgt.setValue(org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.INTENDED); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new MedicationStatement.MedicationStatementStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(MedicationStatement.MedicationStatementStatus.ACTIVE); + break; + case COMPLETED: + tgt.setValue(MedicationStatement.MedicationStatementStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(MedicationStatement.MedicationStatementStatus.ENTEREDINERROR); + break; + case INTENDED: + tgt.setValue(MedicationStatement.MedicationStatementStatus.INTENDED); + break; + default: + tgt.setValue(MedicationStatement.MedicationStatementStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertMedicationStatementStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementStatus.ACTIVE); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementStatus.ENTEREDINERROR); - break; - case INTENDED: - tgt.setValue(org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementStatus.INTENDED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementStatus.ACTIVE); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementStatus.ENTEREDINERROR); + break; + case INTENDED: + tgt.setValue(org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementStatus.INTENDED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/MessageHeader10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/MessageHeader10_40.java index 18ba45aa3a..dc3c7b94ed 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/MessageHeader10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/MessageHeader10_40.java @@ -7,6 +7,8 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.ContactPoint10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Id10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.String10_40; +import org.hl7.fhir.dstu2.model.Enumeration; +import org.hl7.fhir.dstu2.model.MessageHeader; import org.hl7.fhir.exceptions.FHIRException; public class MessageHeader10_40 { @@ -154,46 +156,54 @@ public static org.hl7.fhir.dstu2.model.MessageHeader.MessageSourceComponent conv } static public org.hl7.fhir.dstu2.model.Enumeration convertResponseType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.MessageHeader.ResponseTypeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case OK: - tgt.setValue(org.hl7.fhir.dstu2.model.MessageHeader.ResponseType.OK); - break; - case TRANSIENTERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.MessageHeader.ResponseType.TRANSIENTERROR); - break; - case FATALERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.MessageHeader.ResponseType.FATALERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.MessageHeader.ResponseType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new MessageHeader.ResponseTypeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OK: + tgt.setValue(MessageHeader.ResponseType.OK); + break; + case TRANSIENTERROR: + tgt.setValue(MessageHeader.ResponseType.TRANSIENTERROR); + break; + case FATALERROR: + tgt.setValue(MessageHeader.ResponseType.FATALERROR); + break; + default: + tgt.setValue(MessageHeader.ResponseType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertResponseType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MessageHeader.ResponseTypeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case OK: - tgt.setValue(org.hl7.fhir.r4.model.MessageHeader.ResponseType.OK); - break; - case TRANSIENTERROR: - tgt.setValue(org.hl7.fhir.r4.model.MessageHeader.ResponseType.TRANSIENTERROR); - break; - case FATALERROR: - tgt.setValue(org.hl7.fhir.r4.model.MessageHeader.ResponseType.FATALERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.MessageHeader.ResponseType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MessageHeader.ResponseTypeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OK: + tgt.setValue(org.hl7.fhir.r4.model.MessageHeader.ResponseType.OK); + break; + case TRANSIENTERROR: + tgt.setValue(org.hl7.fhir.r4.model.MessageHeader.ResponseType.TRANSIENTERROR); + break; + case FATALERROR: + tgt.setValue(org.hl7.fhir.r4.model.MessageHeader.ResponseType.FATALERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.MessageHeader.ResponseType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/NamingSystem10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/NamingSystem10_40.java index 4b59804c5f..4a8d1e5541 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/NamingSystem10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/NamingSystem10_40.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Boolean10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.DateTime10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.String10_40; +import org.hl7.fhir.dstu2.model.Enumeration; +import org.hl7.fhir.dstu2.model.NamingSystem; import org.hl7.fhir.exceptions.FHIRException; public class NamingSystem10_40 { @@ -107,97 +109,113 @@ public static org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemContactComponent } static public org.hl7.fhir.dstu2.model.Enumeration convertNamingSystemIdentifierType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemIdentifierTypeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case OID: - tgt.setValue(org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemIdentifierType.OID); - break; - case UUID: - tgt.setValue(org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemIdentifierType.UUID); - break; - case URI: - tgt.setValue(org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemIdentifierType.URI); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemIdentifierType.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemIdentifierType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new NamingSystem.NamingSystemIdentifierTypeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OID: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.OID); + break; + case UUID: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.UUID); + break; + case URI: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.URI); + break; + case OTHER: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.OTHER); + break; + default: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertNamingSystemIdentifierType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierTypeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case OID: - tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.OID); - break; - case UUID: - tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.UUID); - break; - case URI: - tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.URI); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierTypeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OID: + tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.OID); + break; + case UUID: + tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.UUID); + break; + case URI: + tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.URI); + break; + case OTHER: + tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.OTHER); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertNamingSystemType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemTypeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case CODESYSTEM: - tgt.setValue(org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemType.CODESYSTEM); - break; - case IDENTIFIER: - tgt.setValue(org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemType.IDENTIFIER); - break; - case ROOT: - tgt.setValue(org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemType.ROOT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new NamingSystem.NamingSystemTypeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CODESYSTEM: + tgt.setValue(NamingSystem.NamingSystemType.CODESYSTEM); + break; + case IDENTIFIER: + tgt.setValue(NamingSystem.NamingSystemType.IDENTIFIER); + break; + case ROOT: + tgt.setValue(NamingSystem.NamingSystemType.ROOT); + break; + default: + tgt.setValue(NamingSystem.NamingSystemType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertNamingSystemType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.NamingSystem.NamingSystemTypeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case CODESYSTEM: - tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemType.CODESYSTEM); - break; - case IDENTIFIER: - tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemType.IDENTIFIER); - break; - case ROOT: - tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemType.ROOT); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.NamingSystem.NamingSystemTypeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CODESYSTEM: + tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemType.CODESYSTEM); + break; + case IDENTIFIER: + tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemType.IDENTIFIER); + break; + case ROOT: + tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemType.ROOT); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r4.model.NamingSystem.NamingSystemUniqueIdComponent convertNamingSystemUniqueIdComponent(org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemUniqueIdComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Observation10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Observation10_40.java index bd2ebaefb5..83e7cb9aa3 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Observation10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Observation10_40.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.SimpleQuantity10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Instant10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.String10_40; +import org.hl7.fhir.dstu2.model.Enumeration; +import org.hl7.fhir.dstu2.model.Observation; import org.hl7.fhir.exceptions.FHIRException; public class Observation10_40 { @@ -191,70 +193,78 @@ public static org.hl7.fhir.dstu2.model.Observation.ObservationRelatedComponent c } static public org.hl7.fhir.dstu2.model.Enumeration convertObservationStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Observation.ObservationStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationStatus.REGISTERED); - break; - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationStatus.AMENDED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Observation.ObservationStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(Observation.ObservationStatus.REGISTERED); + break; + case PRELIMINARY: + tgt.setValue(Observation.ObservationStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(Observation.ObservationStatus.FINAL); + break; + case AMENDED: + tgt.setValue(Observation.ObservationStatus.AMENDED); + break; + case CANCELLED: + tgt.setValue(Observation.ObservationStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(Observation.ObservationStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Observation.ObservationStatus.UNKNOWN); + break; + default: + tgt.setValue(Observation.ObservationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertObservationStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Observation.ObservationStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.REGISTERED); - break; - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.AMENDED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Observation.ObservationStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.REGISTERED); + break; + case PRELIMINARY: + tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.FINAL); + break; + case AMENDED: + tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.AMENDED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/OperationDefinition10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/OperationDefinition10_40.java index 46e9b00c2d..d482a5f074 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/OperationDefinition10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/OperationDefinition10_40.java @@ -11,6 +11,8 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Integer10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.String10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Uri10_40; +import org.hl7.fhir.dstu2.model.Enumeration; +import org.hl7.fhir.dstu2.model.OperationDefinition; import org.hl7.fhir.dstu2.model.Reference; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4.model.Enumerations.SearchParamType; @@ -228,78 +230,94 @@ public static org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParam } static public org.hl7.fhir.dstu2.model.Enumeration convertOperationKind(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.OperationDefinition.OperationKindEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case OPERATION: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationDefinition.OperationKind.OPERATION); - break; - case QUERY: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationDefinition.OperationKind.QUERY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationDefinition.OperationKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new OperationDefinition.OperationKindEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OPERATION: + tgt.setValue(OperationDefinition.OperationKind.OPERATION); + break; + case QUERY: + tgt.setValue(OperationDefinition.OperationKind.QUERY); + break; + default: + tgt.setValue(OperationDefinition.OperationKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertOperationKind(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.OperationDefinition.OperationKindEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case OPERATION: - tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationKind.OPERATION); - break; - case QUERY: - tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationKind.QUERY); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.OperationDefinition.OperationKindEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OPERATION: + tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationKind.OPERATION); + break; + case QUERY: + tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationKind.QUERY); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertOperationParameterUse(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.OperationDefinition.OperationParameterUseEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case IN: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationDefinition.OperationParameterUse.IN); - break; - case OUT: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationDefinition.OperationParameterUse.OUT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationDefinition.OperationParameterUse.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new OperationDefinition.OperationParameterUseEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case IN: + tgt.setValue(OperationDefinition.OperationParameterUse.IN); + break; + case OUT: + tgt.setValue(OperationDefinition.OperationParameterUse.OUT); + break; + default: + tgt.setValue(OperationDefinition.OperationParameterUse.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertOperationParameterUse(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUseEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case IN: - tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUse.IN); - break; - case OUT: - tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUse.OUT); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUse.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUseEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case IN: + tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUse.IN); + break; + case OUT: + tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUse.OUT); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUse.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/OperationOutcome10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/OperationOutcome10_40.java index 52c6355072..5315d71a41 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/OperationOutcome10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/OperationOutcome10_40.java @@ -4,257 +4,275 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.CodeableConcept10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.String10_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Enumeration; +import org.hl7.fhir.r4.model.OperationOutcome; public class OperationOutcome10_40 { static public org.hl7.fhir.r4.model.Enumeration convertIssueSeverity(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.OperationOutcome.IssueSeverityEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case FATAL: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.FATAL); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.ERROR); - break; - case WARNING: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.WARNING); - break; - case INFORMATION: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.INFORMATION); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new OperationOutcome.IssueSeverityEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FATAL: + tgt.setValue(OperationOutcome.IssueSeverity.FATAL); + break; + case ERROR: + tgt.setValue(OperationOutcome.IssueSeverity.ERROR); + break; + case WARNING: + tgt.setValue(OperationOutcome.IssueSeverity.WARNING); + break; + case INFORMATION: + tgt.setValue(OperationOutcome.IssueSeverity.INFORMATION); + break; + default: + tgt.setValue(OperationOutcome.IssueSeverity.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertIssueSeverity(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverityEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case FATAL: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverity.FATAL); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverity.ERROR); - break; - case WARNING: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverity.WARNING); - break; - case INFORMATION: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverity.INFORMATION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverity.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverityEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FATAL: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverity.FATAL); + break; + case ERROR: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverity.ERROR); + break; + case WARNING: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverity.WARNING); + break; + case INFORMATION: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverity.INFORMATION); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverity.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertIssueType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.OperationOutcome.IssueTypeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case INVALID: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.INVALID); - break; - case STRUCTURE: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.STRUCTURE); - break; - case REQUIRED: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.REQUIRED); - break; - case VALUE: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.VALUE); - break; - case INVARIANT: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.INVARIANT); - break; - case SECURITY: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.SECURITY); - break; - case LOGIN: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.LOGIN); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.UNKNOWN); - break; - case EXPIRED: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.EXPIRED); - break; - case FORBIDDEN: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.FORBIDDEN); - break; - case SUPPRESSED: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.SUPPRESSED); - break; - case PROCESSING: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.PROCESSING); - break; - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.NOTSUPPORTED); - break; - case DUPLICATE: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.DUPLICATE); - break; - case NOTFOUND: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.NOTFOUND); - break; - case TOOLONG: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.TOOLONG); - break; - case CODEINVALID: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.CODEINVALID); - break; - case EXTENSION: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.EXTENSION); - break; - case TOOCOSTLY: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.TOOCOSTLY); - break; - case BUSINESSRULE: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.BUSINESSRULE); - break; - case CONFLICT: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.CONFLICT); - break; - case INCOMPLETE: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.INCOMPLETE); - break; - case TRANSIENT: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.TRANSIENT); - break; - case LOCKERROR: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.LOCKERROR); - break; - case NOSTORE: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.NOSTORE); - break; - case EXCEPTION: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.EXCEPTION); - break; - case TIMEOUT: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.TIMEOUT); - break; - case THROTTLED: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.THROTTLED); - break; - case INFORMATIONAL: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.INFORMATIONAL); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new OperationOutcome.IssueTypeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INVALID: + tgt.setValue(OperationOutcome.IssueType.INVALID); + break; + case STRUCTURE: + tgt.setValue(OperationOutcome.IssueType.STRUCTURE); + break; + case REQUIRED: + tgt.setValue(OperationOutcome.IssueType.REQUIRED); + break; + case VALUE: + tgt.setValue(OperationOutcome.IssueType.VALUE); + break; + case INVARIANT: + tgt.setValue(OperationOutcome.IssueType.INVARIANT); + break; + case SECURITY: + tgt.setValue(OperationOutcome.IssueType.SECURITY); + break; + case LOGIN: + tgt.setValue(OperationOutcome.IssueType.LOGIN); + break; + case UNKNOWN: + tgt.setValue(OperationOutcome.IssueType.UNKNOWN); + break; + case EXPIRED: + tgt.setValue(OperationOutcome.IssueType.EXPIRED); + break; + case FORBIDDEN: + tgt.setValue(OperationOutcome.IssueType.FORBIDDEN); + break; + case SUPPRESSED: + tgt.setValue(OperationOutcome.IssueType.SUPPRESSED); + break; + case PROCESSING: + tgt.setValue(OperationOutcome.IssueType.PROCESSING); + break; + case NOTSUPPORTED: + tgt.setValue(OperationOutcome.IssueType.NOTSUPPORTED); + break; + case DUPLICATE: + tgt.setValue(OperationOutcome.IssueType.DUPLICATE); + break; + case NOTFOUND: + tgt.setValue(OperationOutcome.IssueType.NOTFOUND); + break; + case TOOLONG: + tgt.setValue(OperationOutcome.IssueType.TOOLONG); + break; + case CODEINVALID: + tgt.setValue(OperationOutcome.IssueType.CODEINVALID); + break; + case EXTENSION: + tgt.setValue(OperationOutcome.IssueType.EXTENSION); + break; + case TOOCOSTLY: + tgt.setValue(OperationOutcome.IssueType.TOOCOSTLY); + break; + case BUSINESSRULE: + tgt.setValue(OperationOutcome.IssueType.BUSINESSRULE); + break; + case CONFLICT: + tgt.setValue(OperationOutcome.IssueType.CONFLICT); + break; + case INCOMPLETE: + tgt.setValue(OperationOutcome.IssueType.INCOMPLETE); + break; + case TRANSIENT: + tgt.setValue(OperationOutcome.IssueType.TRANSIENT); + break; + case LOCKERROR: + tgt.setValue(OperationOutcome.IssueType.LOCKERROR); + break; + case NOSTORE: + tgt.setValue(OperationOutcome.IssueType.NOSTORE); + break; + case EXCEPTION: + tgt.setValue(OperationOutcome.IssueType.EXCEPTION); + break; + case TIMEOUT: + tgt.setValue(OperationOutcome.IssueType.TIMEOUT); + break; + case THROTTLED: + tgt.setValue(OperationOutcome.IssueType.THROTTLED); + break; + case INFORMATIONAL: + tgt.setValue(OperationOutcome.IssueType.INFORMATIONAL); + break; + default: + tgt.setValue(OperationOutcome.IssueType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertIssueType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.OperationOutcome.IssueTypeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case INVALID: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.INVALID); - break; - case STRUCTURE: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.STRUCTURE); - break; - case REQUIRED: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.REQUIRED); - break; - case VALUE: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.VALUE); - break; - case INVARIANT: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.INVARIANT); - break; - case SECURITY: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.SECURITY); - break; - case LOGIN: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.LOGIN); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.UNKNOWN); - break; - case EXPIRED: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.EXPIRED); - break; - case FORBIDDEN: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.FORBIDDEN); - break; - case SUPPRESSED: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.SUPPRESSED); - break; - case PROCESSING: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.PROCESSING); - break; - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.NOTSUPPORTED); - break; - case DUPLICATE: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.DUPLICATE); - break; - case NOTFOUND: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.NOTFOUND); - break; - case TOOLONG: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.TOOLONG); - break; - case CODEINVALID: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.CODEINVALID); - break; - case EXTENSION: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.EXTENSION); - break; - case TOOCOSTLY: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.TOOCOSTLY); - break; - case BUSINESSRULE: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.BUSINESSRULE); - break; - case CONFLICT: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.CONFLICT); - break; - case INCOMPLETE: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.INCOMPLETE); - break; - case TRANSIENT: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.TRANSIENT); - break; - case LOCKERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.LOCKERROR); - break; - case NOSTORE: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.NOSTORE); - break; - case EXCEPTION: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.EXCEPTION); - break; - case TIMEOUT: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.TIMEOUT); - break; - case THROTTLED: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.THROTTLED); - break; - case INFORMATIONAL: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.INFORMATIONAL); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.OperationOutcome.IssueTypeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INVALID: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.INVALID); + break; + case STRUCTURE: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.STRUCTURE); + break; + case REQUIRED: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.REQUIRED); + break; + case VALUE: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.VALUE); + break; + case INVARIANT: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.INVARIANT); + break; + case SECURITY: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.SECURITY); + break; + case LOGIN: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.LOGIN); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.UNKNOWN); + break; + case EXPIRED: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.EXPIRED); + break; + case FORBIDDEN: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.FORBIDDEN); + break; + case SUPPRESSED: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.SUPPRESSED); + break; + case PROCESSING: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.PROCESSING); + break; + case NOTSUPPORTED: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.NOTSUPPORTED); + break; + case DUPLICATE: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.DUPLICATE); + break; + case NOTFOUND: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.NOTFOUND); + break; + case TOOLONG: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.TOOLONG); + break; + case CODEINVALID: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.CODEINVALID); + break; + case EXTENSION: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.EXTENSION); + break; + case TOOCOSTLY: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.TOOCOSTLY); + break; + case BUSINESSRULE: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.BUSINESSRULE); + break; + case CONFLICT: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.CONFLICT); + break; + case INCOMPLETE: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.INCOMPLETE); + break; + case TRANSIENT: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.TRANSIENT); + break; + case LOCKERROR: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.LOCKERROR); + break; + case NOSTORE: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.NOSTORE); + break; + case EXCEPTION: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.EXCEPTION); + break; + case TIMEOUT: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.TIMEOUT); + break; + case THROTTLED: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.THROTTLED); + break; + case INFORMATIONAL: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.INFORMATIONAL); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r4.model.OperationOutcome convertOperationOutcome(org.hl7.fhir.dstu2.model.OperationOutcome src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Patient10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Patient10_40.java index 11ca83115b..cf3eaf0c36 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Patient10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Patient10_40.java @@ -12,6 +12,8 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Boolean10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Date10_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Enumeration; +import org.hl7.fhir.r4.model.Patient; public class Patient10_40 { @@ -89,50 +91,58 @@ public static org.hl7.fhir.dstu2.model.Patient.ContactComponent convertContactCo } static public org.hl7.fhir.r4.model.Enumeration convertLinkType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Patient.LinkTypeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case REPLACE: - tgt.setValue(org.hl7.fhir.r4.model.Patient.LinkType.REPLACEDBY); - break; - case REFER: - tgt.setValue(org.hl7.fhir.r4.model.Patient.LinkType.REFER); - break; - case SEEALSO: - tgt.setValue(org.hl7.fhir.r4.model.Patient.LinkType.SEEALSO); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Patient.LinkType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Patient.LinkTypeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REPLACE: + tgt.setValue(Patient.LinkType.REPLACEDBY); + break; + case REFER: + tgt.setValue(Patient.LinkType.REFER); + break; + case SEEALSO: + tgt.setValue(Patient.LinkType.SEEALSO); + break; + default: + tgt.setValue(Patient.LinkType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertLinkType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Patient.LinkTypeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case REPLACEDBY: - tgt.setValue(org.hl7.fhir.dstu2.model.Patient.LinkType.REPLACE); - break; - case REPLACES: - tgt.setValue(org.hl7.fhir.dstu2.model.Patient.LinkType.REPLACE); - break; - case REFER: - tgt.setValue(org.hl7.fhir.dstu2.model.Patient.LinkType.REFER); - break; - case SEEALSO: - tgt.setValue(org.hl7.fhir.dstu2.model.Patient.LinkType.SEEALSO); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Patient.LinkType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Patient.LinkTypeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REPLACEDBY: + tgt.setValue(org.hl7.fhir.dstu2.model.Patient.LinkType.REPLACE); + break; + case REPLACES: + tgt.setValue(org.hl7.fhir.dstu2.model.Patient.LinkType.REPLACE); + break; + case REFER: + tgt.setValue(org.hl7.fhir.dstu2.model.Patient.LinkType.REFER); + break; + case SEEALSO: + tgt.setValue(org.hl7.fhir.dstu2.model.Patient.LinkType.SEEALSO); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Patient.LinkType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r4.model.Patient convertPatient(org.hl7.fhir.dstu2.model.Patient src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Person10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Person10_40.java index 9dbececd28..b7519d1730 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Person10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Person10_40.java @@ -10,57 +10,67 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Boolean10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Date10_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Enumeration; +import org.hl7.fhir.r4.model.Person; public class Person10_40 { static public org.hl7.fhir.r4.model.Enumeration convertIdentityAssuranceLevel(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Person.IdentityAssuranceLevelEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case LEVEL1: - tgt.setValue(org.hl7.fhir.r4.model.Person.IdentityAssuranceLevel.LEVEL1); - break; - case LEVEL2: - tgt.setValue(org.hl7.fhir.r4.model.Person.IdentityAssuranceLevel.LEVEL2); - break; - case LEVEL3: - tgt.setValue(org.hl7.fhir.r4.model.Person.IdentityAssuranceLevel.LEVEL3); - break; - case LEVEL4: - tgt.setValue(org.hl7.fhir.r4.model.Person.IdentityAssuranceLevel.LEVEL4); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Person.IdentityAssuranceLevel.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Person.IdentityAssuranceLevelEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case LEVEL1: + tgt.setValue(Person.IdentityAssuranceLevel.LEVEL1); + break; + case LEVEL2: + tgt.setValue(Person.IdentityAssuranceLevel.LEVEL2); + break; + case LEVEL3: + tgt.setValue(Person.IdentityAssuranceLevel.LEVEL3); + break; + case LEVEL4: + tgt.setValue(Person.IdentityAssuranceLevel.LEVEL4); + break; + default: + tgt.setValue(Person.IdentityAssuranceLevel.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertIdentityAssuranceLevel(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Person.IdentityAssuranceLevelEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case LEVEL1: - tgt.setValue(org.hl7.fhir.dstu2.model.Person.IdentityAssuranceLevel.LEVEL1); - break; - case LEVEL2: - tgt.setValue(org.hl7.fhir.dstu2.model.Person.IdentityAssuranceLevel.LEVEL2); - break; - case LEVEL3: - tgt.setValue(org.hl7.fhir.dstu2.model.Person.IdentityAssuranceLevel.LEVEL3); - break; - case LEVEL4: - tgt.setValue(org.hl7.fhir.dstu2.model.Person.IdentityAssuranceLevel.LEVEL4); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Person.IdentityAssuranceLevel.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Person.IdentityAssuranceLevelEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case LEVEL1: + tgt.setValue(org.hl7.fhir.dstu2.model.Person.IdentityAssuranceLevel.LEVEL1); + break; + case LEVEL2: + tgt.setValue(org.hl7.fhir.dstu2.model.Person.IdentityAssuranceLevel.LEVEL2); + break; + case LEVEL3: + tgt.setValue(org.hl7.fhir.dstu2.model.Person.IdentityAssuranceLevel.LEVEL3); + break; + case LEVEL4: + tgt.setValue(org.hl7.fhir.dstu2.model.Person.IdentityAssuranceLevel.LEVEL4); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Person.IdentityAssuranceLevel.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r4.model.Person convertPerson(org.hl7.fhir.dstu2.model.Person src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Questionnaire10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Questionnaire10_40.java index 384193bfb3..349338a5e8 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Questionnaire10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Questionnaire10_40.java @@ -9,8 +9,11 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Canonical10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.DateTime10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.String10_40; +import org.hl7.fhir.dstu2.model.Enumeration; +import org.hl7.fhir.dstu2.model.Questionnaire; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4.model.ContactDetail; +import org.hl7.fhir.r4.model.Enumerations; import org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemAnswerOptionComponent; public class Questionnaire10_40 { @@ -130,58 +133,62 @@ public static org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemComponent con } static public org.hl7.fhir.dstu2.model.Enumeration convertQuestionnaireItemType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Questionnaire.AnswerFormatEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case BOOLEAN: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.AnswerFormat.BOOLEAN); - break; - case DECIMAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.AnswerFormat.DECIMAL); - break; - case INTEGER: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.AnswerFormat.INTEGER); - break; - case DATE: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.AnswerFormat.DATE); - break; - case DATETIME: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.AnswerFormat.DATETIME); - break; - case TIME: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.AnswerFormat.TIME); - break; - case STRING: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.AnswerFormat.STRING); - break; - case TEXT: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.AnswerFormat.TEXT); - break; - case URL: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.AnswerFormat.URL); - break; - case CHOICE: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.AnswerFormat.CHOICE); - break; - case OPENCHOICE: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.AnswerFormat.OPENCHOICE); - break; - case ATTACHMENT: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.AnswerFormat.ATTACHMENT); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.AnswerFormat.REFERENCE); - break; - case QUANTITY: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.AnswerFormat.QUANTITY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.AnswerFormat.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Questionnaire.AnswerFormatEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case BOOLEAN: + tgt.setValue(Questionnaire.AnswerFormat.BOOLEAN); + break; + case DECIMAL: + tgt.setValue(Questionnaire.AnswerFormat.DECIMAL); + break; + case INTEGER: + tgt.setValue(Questionnaire.AnswerFormat.INTEGER); + break; + case DATE: + tgt.setValue(Questionnaire.AnswerFormat.DATE); + break; + case DATETIME: + tgt.setValue(Questionnaire.AnswerFormat.DATETIME); + break; + case TIME: + tgt.setValue(Questionnaire.AnswerFormat.TIME); + break; + case STRING: + tgt.setValue(Questionnaire.AnswerFormat.STRING); + break; + case TEXT: + tgt.setValue(Questionnaire.AnswerFormat.TEXT); + break; + case URL: + tgt.setValue(Questionnaire.AnswerFormat.URL); + break; + case CHOICE: + tgt.setValue(Questionnaire.AnswerFormat.CHOICE); + break; + case OPENCHOICE: + tgt.setValue(Questionnaire.AnswerFormat.OPENCHOICE); + break; + case ATTACHMENT: + tgt.setValue(Questionnaire.AnswerFormat.ATTACHMENT); + break; + case REFERENCE: + tgt.setValue(Questionnaire.AnswerFormat.REFERENCE); + break; + case QUANTITY: + tgt.setValue(Questionnaire.AnswerFormat.QUANTITY); + break; + default: + tgt.setValue(Questionnaire.AnswerFormat.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2.model.Questionnaire.QuestionComponent convertQuestionnaireQuestionComponent(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemComponent src) throws FHIRException { @@ -240,104 +247,116 @@ public static org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemComponent con } static public org.hl7.fhir.r4.model.Enumeration convertQuestionnaireQuestionType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemTypeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case BOOLEAN: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.BOOLEAN); - break; - case DECIMAL: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.DECIMAL); - break; - case INTEGER: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.INTEGER); - break; - case DATE: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.DATE); - break; - case DATETIME: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.DATETIME); - break; - case INSTANT: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.DATETIME); - break; - case TIME: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.TIME); - break; - case STRING: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.STRING); - break; - case TEXT: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.TEXT); - break; - case URL: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.URL); - break; - case CHOICE: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.CHOICE); - break; - case OPENCHOICE: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.OPENCHOICE); - break; - case ATTACHMENT: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.ATTACHMENT); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.REFERENCE); - break; - case QUANTITY: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.QUANTITY); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemTypeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case BOOLEAN: + tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.BOOLEAN); + break; + case DECIMAL: + tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.DECIMAL); + break; + case INTEGER: + tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.INTEGER); + break; + case DATE: + tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.DATE); + break; + case DATETIME: + tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.DATETIME); + break; + case INSTANT: + tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.DATETIME); + break; + case TIME: + tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.TIME); + break; + case STRING: + tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.STRING); + break; + case TEXT: + tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.TEXT); + break; + case URL: + tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.URL); + break; + case CHOICE: + tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.CHOICE); + break; + case OPENCHOICE: + tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.OPENCHOICE); + break; + case ATTACHMENT: + tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.ATTACHMENT); + break; + case REFERENCE: + tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.REFERENCE); + break; + case QUANTITY: + tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.QUANTITY); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertQuestionnaireStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Questionnaire.QuestionnaireStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.QuestionnaireStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.QuestionnaireStatus.PUBLISHED); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.QuestionnaireStatus.RETIRED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.QuestionnaireStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Questionnaire.QuestionnaireStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(Questionnaire.QuestionnaireStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(Questionnaire.QuestionnaireStatus.PUBLISHED); + break; + case RETIRED: + tgt.setValue(Questionnaire.QuestionnaireStatus.RETIRED); + break; + default: + tgt.setValue(Questionnaire.QuestionnaireStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertQuestionnaireStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.PublicationStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.DRAFT); - break; - case PUBLISHED: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.ACTIVE); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.RETIRED); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new Enumerations.PublicationStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(Enumerations.PublicationStatus.DRAFT); + break; + case PUBLISHED: + tgt.setValue(Enumerations.PublicationStatus.ACTIVE); + break; + case RETIRED: + tgt.setValue(Enumerations.PublicationStatus.RETIRED); + break; + default: + tgt.setValue(Enumerations.PublicationStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/QuestionnaireResponse10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/QuestionnaireResponse10_40.java index 06e6b64be7..cd910d3bc5 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/QuestionnaireResponse10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/QuestionnaireResponse10_40.java @@ -7,6 +7,8 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.DateTime10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.String10_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Enumeration; +import org.hl7.fhir.r4.model.QuestionnaireResponse; public class QuestionnaireResponse10_40 { @@ -149,46 +151,54 @@ public static org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseI } static public org.hl7.fhir.r4.model.Enumeration convertQuestionnaireResponseStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED); + break; + case AMENDED: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED); + break; + default: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertQuestionnaireResponseStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionnaireResponseStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED); + break; + case AMENDED: + tgt.setValue(org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionnaireResponseStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/SearchParameter10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/SearchParameter10_40.java index 21c76e2bc7..4e9b65e896 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/SearchParameter10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/SearchParameter10_40.java @@ -7,6 +7,8 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.DateTime10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.String10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Uri10_40; +import org.hl7.fhir.dstu2.model.Enumeration; +import org.hl7.fhir.dstu2.model.SearchParameter; import org.hl7.fhir.dstu2.utils.ToolingExtensions; import org.hl7.fhir.exceptions.FHIRException; @@ -137,30 +139,34 @@ static public org.hl7.fhir.r4.model.SearchParameter.XPathUsageType convertXPathU } static public org.hl7.fhir.dstu2.model.Enumeration convertXPathUsageType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.SearchParameter.XPathUsageTypeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case NORMAL: - tgt.setValue(org.hl7.fhir.dstu2.model.SearchParameter.XPathUsageType.NORMAL); - break; - case PHONETIC: - tgt.setValue(org.hl7.fhir.dstu2.model.SearchParameter.XPathUsageType.PHONETIC); - break; - case NEARBY: - tgt.setValue(org.hl7.fhir.dstu2.model.SearchParameter.XPathUsageType.NEARBY); - break; - case DISTANCE: - tgt.setValue(org.hl7.fhir.dstu2.model.SearchParameter.XPathUsageType.DISTANCE); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.dstu2.model.SearchParameter.XPathUsageType.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.SearchParameter.XPathUsageType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new SearchParameter.XPathUsageTypeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NORMAL: + tgt.setValue(SearchParameter.XPathUsageType.NORMAL); + break; + case PHONETIC: + tgt.setValue(SearchParameter.XPathUsageType.PHONETIC); + break; + case NEARBY: + tgt.setValue(SearchParameter.XPathUsageType.NEARBY); + break; + case DISTANCE: + tgt.setValue(SearchParameter.XPathUsageType.DISTANCE); + break; + case OTHER: + tgt.setValue(SearchParameter.XPathUsageType.OTHER); + break; + default: + tgt.setValue(SearchParameter.XPathUsageType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Slot10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Slot10_40.java index a051370007..a77662704d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Slot10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Slot10_40.java @@ -8,6 +8,7 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Instant10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.String10_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Slot; public class Slot10_40 { @@ -60,26 +61,26 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Slot.SlotStatusEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Slot.SlotStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case BUSY: - tgt.setValue(org.hl7.fhir.r4.model.Slot.SlotStatus.BUSY); - break; - case FREE: - tgt.setValue(org.hl7.fhir.r4.model.Slot.SlotStatus.FREE); - break; - case BUSYUNAVAILABLE: - tgt.setValue(org.hl7.fhir.r4.model.Slot.SlotStatus.BUSYUNAVAILABLE); - break; - case BUSYTENTATIVE: - tgt.setValue(org.hl7.fhir.r4.model.Slot.SlotStatus.BUSYTENTATIVE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Slot.SlotStatus.NULL); - break; - } - } + tgt.setValue(Slot.SlotStatus.BUSY); + break; + case FREE: + tgt.setValue(Slot.SlotStatus.FREE); + break; + case BUSYUNAVAILABLE: + tgt.setValue(Slot.SlotStatus.BUSYUNAVAILABLE); + break; + case BUSYTENTATIVE: + tgt.setValue(Slot.SlotStatus.BUSYTENTATIVE); + break; + default: + tgt.setValue(Slot.SlotStatus.NULL); + break; + } +} return tgt; } @@ -88,26 +89,26 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Slot.SlotStatusEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.Slot.SlotStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case BUSY: - tgt.setValue(org.hl7.fhir.dstu2.model.Slot.SlotStatus.BUSY); - break; - case FREE: - tgt.setValue(org.hl7.fhir.dstu2.model.Slot.SlotStatus.FREE); - break; - case BUSYUNAVAILABLE: - tgt.setValue(org.hl7.fhir.dstu2.model.Slot.SlotStatus.BUSYUNAVAILABLE); - break; - case BUSYTENTATIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.Slot.SlotStatus.BUSYTENTATIVE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Slot.SlotStatus.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.Slot.SlotStatus.BUSY); + break; + case FREE: + tgt.setValue(org.hl7.fhir.dstu2.model.Slot.SlotStatus.FREE); + break; + case BUSYUNAVAILABLE: + tgt.setValue(org.hl7.fhir.dstu2.model.Slot.SlotStatus.BUSYUNAVAILABLE); + break; + case BUSYTENTATIVE: + tgt.setValue(org.hl7.fhir.dstu2.model.Slot.SlotStatus.BUSYTENTATIVE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Slot.SlotStatus.NULL); + break; + } +} return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/StructureDefinition10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/StructureDefinition10_40.java index 879f8ac239..145800676f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/StructureDefinition10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/StructureDefinition10_40.java @@ -17,6 +17,8 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Uri10_40; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4.model.ElementDefinition; +import org.hl7.fhir.r4.model.Enumeration; +import org.hl7.fhir.r4.model.StructureDefinition; import org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind; import org.hl7.fhir.r4.model.StructureDefinition.TypeDerivationRule; import org.hl7.fhir.utilities.Utilities; @@ -24,52 +26,60 @@ public class StructureDefinition10_40 { static public org.hl7.fhir.r4.model.Enumeration convertExtensionContext(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextTypeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case RESOURCE: - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextType.ELEMENT); - break; - case DATATYPE: - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextType.ELEMENT); - break; - case EXTENSION: - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextType.EXTENSION); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureDefinition.ExtensionContextTypeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case RESOURCE: + tgt.setValue(StructureDefinition.ExtensionContextType.ELEMENT); + break; + case DATATYPE: + tgt.setValue(StructureDefinition.ExtensionContextType.ELEMENT); + break; + case EXTENSION: + tgt.setValue(StructureDefinition.ExtensionContextType.EXTENSION); + break; + default: + tgt.setValue(StructureDefinition.ExtensionContextType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertExtensionContext(org.hl7.fhir.r4.model.Enumeration src, String expression) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.StructureDefinition.ExtensionContextEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case FHIRPATH: - tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.ExtensionContext.RESOURCE); - break; - case ELEMENT: - String tn = expression.contains(".") ? expression.substring(0, expression.indexOf(".")) : expression; - if (isResource102(tn)) { - tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.ExtensionContext.RESOURCE); - } else { - tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.ExtensionContext.DATATYPE); - } - break; - case EXTENSION: - tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.ExtensionContext.EXTENSION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.ExtensionContext.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.StructureDefinition.ExtensionContextEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FHIRPATH: + tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.ExtensionContext.RESOURCE); + break; + case ELEMENT: + String tn = expression.contains(".") ? expression.substring(0, expression.indexOf(".")) : expression; + if (isResource102(tn)) { + tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.ExtensionContext.RESOURCE); + } else { + tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.ExtensionContext.DATATYPE); + } + break; + case EXTENSION: + tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.ExtensionContext.EXTENSION); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.ExtensionContext.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r4.model.StructureDefinition convertStructureDefinition(org.hl7.fhir.dstu2.model.StructureDefinition src) throws FHIRException { @@ -272,52 +282,60 @@ public static org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionDi } public static org.hl7.fhir.r4.model.Enumeration convertStructureDefinitionKind(org.hl7.fhir.dstu2.model.Enumeration src, String dtName) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKindEnumFactory()); - switch (src.getValue()) { - case DATATYPE: - if (Utilities.existsInList(dtName, "boolean", "integer", "decimal", "base64Binary", "instant", "string", "uri", "date", "dateTime", "time", "code", "oid", "uuid", "id", "unsignedInt", "positiveInt", "markdown", "xhtml", "url", "canonical")) - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind.PRIMITIVETYPE); - else - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind.COMPLEXTYPE); - break; - case RESOURCE: - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind.RESOURCE); - break; - case LOGICAL: - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind.LOGICAL); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureDefinition.StructureDefinitionKindEnumFactory()); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DATATYPE: + if (Utilities.existsInList(dtName, "boolean", "integer", "decimal", "base64Binary", "instant", "string", "uri", "date", "dateTime", "time", "code", "oid", "uuid", "id", "unsignedInt", "positiveInt", "markdown", "xhtml", "url", "canonical")) + tgt.setValue(StructureDefinitionKind.PRIMITIVETYPE); + else + tgt.setValue(StructureDefinitionKind.COMPLEXTYPE); + break; + case RESOURCE: + tgt.setValue(StructureDefinitionKind.RESOURCE); + break; + case LOGICAL: + tgt.setValue(StructureDefinitionKind.LOGICAL); + break; + default: + tgt.setValue(StructureDefinitionKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertStructureDefinitionKind(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionKindEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case PRIMITIVETYPE: - tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionKind.DATATYPE); - break; - case COMPLEXTYPE: - tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionKind.DATATYPE); - break; - case RESOURCE: - tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionKind.RESOURCE); - break; - case LOGICAL: - tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionKind.LOGICAL); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionKindEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRIMITIVETYPE: + tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionKind.DATATYPE); + break; + case COMPLEXTYPE: + tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionKind.DATATYPE); + break; + case RESOURCE: + tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionKind.RESOURCE); + break; + case LOGICAL: + tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionKind.LOGICAL); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionKind.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionMappingComponent convertStructureDefinitionMappingComponent(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionMappingComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Subscription10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Subscription10_40.java index f55b98d964..e47e435b33 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Subscription10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Subscription10_40.java @@ -4,6 +4,8 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.ContactPoint10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Instant10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.String10_40; +import org.hl7.fhir.dstu2.model.Enumeration; +import org.hl7.fhir.dstu2.model.Subscription; import org.hl7.fhir.exceptions.FHIRException; public class Subscription10_40 { @@ -84,108 +86,124 @@ public static org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelComponent } static public org.hl7.fhir.dstu2.model.Enumeration convertSubscriptionChannelType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelTypeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case RESTHOOK: - tgt.setValue(org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType.RESTHOOK); - break; - case WEBSOCKET: - tgt.setValue(org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType.WEBSOCKET); - break; - case EMAIL: - tgt.setValue(org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType.EMAIL); - break; - case SMS: - tgt.setValue(org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType.SMS); - break; - case MESSAGE: - tgt.setValue(org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType.MESSAGE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Subscription.SubscriptionChannelTypeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case RESTHOOK: + tgt.setValue(Subscription.SubscriptionChannelType.RESTHOOK); + break; + case WEBSOCKET: + tgt.setValue(Subscription.SubscriptionChannelType.WEBSOCKET); + break; + case EMAIL: + tgt.setValue(Subscription.SubscriptionChannelType.EMAIL); + break; + case SMS: + tgt.setValue(Subscription.SubscriptionChannelType.SMS); + break; + case MESSAGE: + tgt.setValue(Subscription.SubscriptionChannelType.MESSAGE); + break; + default: + tgt.setValue(Subscription.SubscriptionChannelType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertSubscriptionChannelType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Subscription.SubscriptionChannelTypeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case RESTHOOK: - tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionChannelType.RESTHOOK); - break; - case WEBSOCKET: - tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionChannelType.WEBSOCKET); - break; - case EMAIL: - tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionChannelType.EMAIL); - break; - case SMS: - tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionChannelType.SMS); - break; - case MESSAGE: - tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionChannelType.MESSAGE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionChannelType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Subscription.SubscriptionChannelTypeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case RESTHOOK: + tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionChannelType.RESTHOOK); + break; + case WEBSOCKET: + tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionChannelType.WEBSOCKET); + break; + case EMAIL: + tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionChannelType.EMAIL); + break; + case SMS: + tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionChannelType.SMS); + break; + case MESSAGE: + tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionChannelType.MESSAGE); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionChannelType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertSubscriptionStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Subscription.SubscriptionStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case REQUESTED: - tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionStatus.REQUESTED); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionStatus.ACTIVE); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionStatus.ERROR); - break; - case OFF: - tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionStatus.OFF); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Subscription.SubscriptionStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REQUESTED: + tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionStatus.REQUESTED); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionStatus.ACTIVE); + break; + case ERROR: + tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionStatus.ERROR); + break; + case OFF: + tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionStatus.OFF); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertSubscriptionStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Subscription.SubscriptionStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case REQUESTED: - tgt.setValue(org.hl7.fhir.dstu2.model.Subscription.SubscriptionStatus.REQUESTED); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.Subscription.SubscriptionStatus.ACTIVE); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.Subscription.SubscriptionStatus.ERROR); - break; - case OFF: - tgt.setValue(org.hl7.fhir.dstu2.model.Subscription.SubscriptionStatus.OFF); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Subscription.SubscriptionStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Subscription.SubscriptionStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REQUESTED: + tgt.setValue(Subscription.SubscriptionStatus.REQUESTED); + break; + case ACTIVE: + tgt.setValue(Subscription.SubscriptionStatus.ACTIVE); + break; + case ERROR: + tgt.setValue(Subscription.SubscriptionStatus.ERROR); + break; + case OFF: + tgt.setValue(Subscription.SubscriptionStatus.OFF); + break; + default: + tgt.setValue(Subscription.SubscriptionStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/SupplyDelivery10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/SupplyDelivery10_40.java index e8e2b3de9d..e8226676e2 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/SupplyDelivery10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/SupplyDelivery10_40.java @@ -4,6 +4,8 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.Reference10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.CodeableConcept10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.Identifier10_40; +import org.hl7.fhir.dstu2.model.Enumeration; +import org.hl7.fhir.dstu2.model.SupplyDelivery; import org.hl7.fhir.exceptions.FHIRException; public class SupplyDelivery10_40 { @@ -51,46 +53,54 @@ public static org.hl7.fhir.r4.model.SupplyDelivery convertSupplyDelivery(org.hl7 } static public org.hl7.fhir.dstu2.model.Enumeration convertSupplyDeliveryStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.SupplyDelivery.SupplyDeliveryStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu2.model.SupplyDelivery.SupplyDeliveryStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu2.model.SupplyDelivery.SupplyDeliveryStatus.COMPLETED); - break; - case ABANDONED: - tgt.setValue(org.hl7.fhir.dstu2.model.SupplyDelivery.SupplyDeliveryStatus.ABANDONED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.SupplyDelivery.SupplyDeliveryStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new SupplyDelivery.SupplyDeliveryStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(SupplyDelivery.SupplyDeliveryStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(SupplyDelivery.SupplyDeliveryStatus.COMPLETED); + break; + case ABANDONED: + tgt.setValue(SupplyDelivery.SupplyDeliveryStatus.ABANDONED); + break; + default: + tgt.setValue(SupplyDelivery.SupplyDeliveryStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertSupplyDeliveryStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatusEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatus.COMPLETED); - break; - case ABANDONED: - tgt.setValue(org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatus.ABANDONED); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatusEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatus.COMPLETED); + break; + case ABANDONED: + tgt.setValue(org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatus.ABANDONED); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/SupplyRequest10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/SupplyRequest10_40.java index 1034b2a5a8..e48dcf8e55 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/SupplyRequest10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/SupplyRequest10_40.java @@ -2,6 +2,7 @@ import org.hl7.fhir.convertors.context.ConversionContext10_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.SupplyRequest; public class SupplyRequest10_40 { @@ -25,26 +26,26 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatusEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case REQUESTED: - tgt.setValue(org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus.ACTIVE); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus.COMPLETED); - break; - case FAILED: - tgt.setValue(org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus.CANCELLED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus.CANCELLED); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus.NULL); - break; - } - } + tgt.setValue(SupplyRequest.SupplyRequestStatus.ACTIVE); + break; + case COMPLETED: + tgt.setValue(SupplyRequest.SupplyRequestStatus.COMPLETED); + break; + case FAILED: + tgt.setValue(SupplyRequest.SupplyRequestStatus.CANCELLED); + break; + case CANCELLED: + tgt.setValue(SupplyRequest.SupplyRequestStatus.CANCELLED); + break; + default: + tgt.setValue(SupplyRequest.SupplyRequestStatus.NULL); + break; + } +} return tgt; } @@ -53,23 +54,23 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.SupplyRequest.SupplyRequestStatusEnumFactory()); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.SupplyRequest.SupplyRequestStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.SupplyRequest.SupplyRequestStatus.REQUESTED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu2.model.SupplyRequest.SupplyRequestStatus.COMPLETED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu2.model.SupplyRequest.SupplyRequestStatus.CANCELLED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.SupplyRequest.SupplyRequestStatus.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.SupplyRequest.SupplyRequestStatus.REQUESTED); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.dstu2.model.SupplyRequest.SupplyRequestStatus.COMPLETED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.dstu2.model.SupplyRequest.SupplyRequestStatus.CANCELLED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.SupplyRequest.SupplyRequestStatus.NULL); + break; + } +} return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/TestScript10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/TestScript10_40.java index e3ef2d47ff..2fde43eb86 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/TestScript10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/TestScript10_40.java @@ -15,230 +15,256 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Integer10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.String10_40; import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Uri10_40; +import org.hl7.fhir.dstu2.model.Enumeration; +import org.hl7.fhir.dstu2.model.TestScript; import org.hl7.fhir.exceptions.FHIRException; public class TestScript10_40 { static public org.hl7.fhir.dstu2.model.Enumeration convertAssertionDirectionType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.TestScript.AssertionDirectionTypeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case RESPONSE: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionDirectionType.RESPONSE); - break; - case REQUEST: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionDirectionType.REQUEST); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionDirectionType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new TestScript.AssertionDirectionTypeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case RESPONSE: + tgt.setValue(TestScript.AssertionDirectionType.RESPONSE); + break; + case REQUEST: + tgt.setValue(TestScript.AssertionDirectionType.REQUEST); + break; + default: + tgt.setValue(TestScript.AssertionDirectionType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertAssertionDirectionType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TestScript.AssertionDirectionTypeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case RESPONSE: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionDirectionType.RESPONSE); - break; - case REQUEST: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionDirectionType.REQUEST); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionDirectionType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TestScript.AssertionDirectionTypeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case RESPONSE: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionDirectionType.RESPONSE); + break; + case REQUEST: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionDirectionType.REQUEST); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionDirectionType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertAssertionOperatorType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TestScript.AssertionOperatorTypeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case EQUALS: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.EQUALS); - break; - case NOTEQUALS: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.NOTEQUALS); - break; - case IN: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.NOTIN); - break; - case GREATERTHAN: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.GREATERTHAN); - break; - case LESSTHAN: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.LESSTHAN); - break; - case EMPTY: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.EMPTY); - break; - case NOTEMPTY: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.NOTEMPTY); - break; - case CONTAINS: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.CONTAINS); - break; - case NOTCONTAINS: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.NOTCONTAINS); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TestScript.AssertionOperatorTypeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUALS: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.EQUALS); + break; + case NOTEQUALS: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.NOTEQUALS); + break; + case IN: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.IN); + break; + case NOTIN: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.NOTIN); + break; + case GREATERTHAN: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.GREATERTHAN); + break; + case LESSTHAN: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.LESSTHAN); + break; + case EMPTY: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.EMPTY); + break; + case NOTEMPTY: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.NOTEMPTY); + break; + case CONTAINS: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.CONTAINS); + break; + case NOTCONTAINS: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.NOTCONTAINS); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertAssertionOperatorType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorTypeEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case EQUALS: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.EQUALS); - break; - case NOTEQUALS: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.NOTEQUALS); - break; - case IN: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.NOTIN); - break; - case GREATERTHAN: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.GREATERTHAN); - break; - case LESSTHAN: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.LESSTHAN); - break; - case EMPTY: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.EMPTY); - break; - case NOTEMPTY: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.NOTEMPTY); - break; - case CONTAINS: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.CONTAINS); - break; - case NOTCONTAINS: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.NOTCONTAINS); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new TestScript.AssertionOperatorTypeEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUALS: + tgt.setValue(TestScript.AssertionOperatorType.EQUALS); + break; + case NOTEQUALS: + tgt.setValue(TestScript.AssertionOperatorType.NOTEQUALS); + break; + case IN: + tgt.setValue(TestScript.AssertionOperatorType.IN); + break; + case NOTIN: + tgt.setValue(TestScript.AssertionOperatorType.NOTIN); + break; + case GREATERTHAN: + tgt.setValue(TestScript.AssertionOperatorType.GREATERTHAN); + break; + case LESSTHAN: + tgt.setValue(TestScript.AssertionOperatorType.LESSTHAN); + break; + case EMPTY: + tgt.setValue(TestScript.AssertionOperatorType.EMPTY); + break; + case NOTEMPTY: + tgt.setValue(TestScript.AssertionOperatorType.NOTEMPTY); + break; + case CONTAINS: + tgt.setValue(TestScript.AssertionOperatorType.CONTAINS); + break; + case NOTCONTAINS: + tgt.setValue(TestScript.AssertionOperatorType.NOTCONTAINS); + break; + default: + tgt.setValue(TestScript.AssertionOperatorType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertAssertionResponseTypes(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypesEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case OKAY: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.OKAY); - break; - case CREATED: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.CREATED); - break; - case NOCONTENT: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.NOCONTENT); - break; - case NOTMODIFIED: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.NOTMODIFIED); - break; - case BAD: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.BAD); - break; - case FORBIDDEN: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.FORBIDDEN); - break; - case NOTFOUND: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.NOTFOUND); - break; - case METHODNOTALLOWED: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.METHODNOTALLOWED); - break; - case CONFLICT: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.CONFLICT); - break; - case GONE: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.GONE); - break; - case PRECONDITIONFAILED: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.PRECONDITIONFAILED); - break; - case UNPROCESSABLE: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.UNPROCESSABLE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new TestScript.AssertionResponseTypesEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OKAY: + tgt.setValue(TestScript.AssertionResponseTypes.OKAY); + break; + case CREATED: + tgt.setValue(TestScript.AssertionResponseTypes.CREATED); + break; + case NOCONTENT: + tgt.setValue(TestScript.AssertionResponseTypes.NOCONTENT); + break; + case NOTMODIFIED: + tgt.setValue(TestScript.AssertionResponseTypes.NOTMODIFIED); + break; + case BAD: + tgt.setValue(TestScript.AssertionResponseTypes.BAD); + break; + case FORBIDDEN: + tgt.setValue(TestScript.AssertionResponseTypes.FORBIDDEN); + break; + case NOTFOUND: + tgt.setValue(TestScript.AssertionResponseTypes.NOTFOUND); + break; + case METHODNOTALLOWED: + tgt.setValue(TestScript.AssertionResponseTypes.METHODNOTALLOWED); + break; + case CONFLICT: + tgt.setValue(TestScript.AssertionResponseTypes.CONFLICT); + break; + case GONE: + tgt.setValue(TestScript.AssertionResponseTypes.GONE); + break; + case PRECONDITIONFAILED: + tgt.setValue(TestScript.AssertionResponseTypes.PRECONDITIONFAILED); + break; + case UNPROCESSABLE: + tgt.setValue(TestScript.AssertionResponseTypes.UNPROCESSABLE); + break; + default: + tgt.setValue(TestScript.AssertionResponseTypes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertAssertionResponseTypes(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TestScript.AssertionResponseTypesEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case OKAY: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.OKAY); - break; - case CREATED: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.CREATED); - break; - case NOCONTENT: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.NOCONTENT); - break; - case NOTMODIFIED: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.NOTMODIFIED); - break; - case BAD: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.BAD); - break; - case FORBIDDEN: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.FORBIDDEN); - break; - case NOTFOUND: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.NOTFOUND); - break; - case METHODNOTALLOWED: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.METHODNOTALLOWED); - break; - case CONFLICT: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.CONFLICT); - break; - case GONE: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.GONE); - break; - case PRECONDITIONFAILED: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.PRECONDITIONFAILED); - break; - case UNPROCESSABLE: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.UNPROCESSABLE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TestScript.AssertionResponseTypesEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OKAY: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.OKAY); + break; + case CREATED: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.CREATED); + break; + case NOCONTENT: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.NOCONTENT); + break; + case NOTMODIFIED: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.NOTMODIFIED); + break; + case BAD: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.BAD); + break; + case FORBIDDEN: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.FORBIDDEN); + break; + case NOTFOUND: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.NOTFOUND); + break; + case METHODNOTALLOWED: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.METHODNOTALLOWED); + break; + case CONFLICT: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.CONFLICT); + break; + case GONE: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.GONE); + break; + case PRECONDITIONFAILED: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.PRECONDITIONFAILED); + break; + case UNPROCESSABLE: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.UNPROCESSABLE); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.NULL); + break; + } + } + return tgt; } static public String convertContentType(org.hl7.fhir.dstu2.model.TestScript.ContentType src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/ValueSet10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/ValueSet10_40.java index 3fa218021b..a3e95a7cdc 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/ValueSet10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/ValueSet10_40.java @@ -21,6 +21,7 @@ import org.hl7.fhir.r4.model.CodeSystem; import org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode; import org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent; +import org.hl7.fhir.r4.model.Enumeration; import org.hl7.fhir.r4.terminologies.CodeSystemUtilities; public class ValueSet10_40 { @@ -142,65 +143,73 @@ public static org.hl7.fhir.r4.model.ValueSet.ConceptSetFilterComponent convertCo } static public org.hl7.fhir.r4.model.Enumeration convertFilterOperator(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ValueSet.FilterOperatorEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case EQUAL: - tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.EQUAL); - break; - case ISA: - tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.ISA); - break; - case ISNOTA: - tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.ISNOTA); - break; - case REGEX: - tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.REGEX); - break; - case IN: - tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.NOTIN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new org.hl7.fhir.r4.model.ValueSet.FilterOperatorEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUAL: + tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.EQUAL); + break; + case ISA: + tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.ISA); + break; + case ISNOTA: + tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.ISNOTA); + break; + case REGEX: + tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.REGEX); + break; + case IN: + tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.IN); + break; + case NOTIN: + tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.NOTIN); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertFilterOperator(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ValueSet.FilterOperatorEnumFactory()); - ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); - switch (src.getValue()) { - case EQUAL: - tgt.setValue(org.hl7.fhir.dstu2.model.ValueSet.FilterOperator.EQUAL); - break; - case ISA: - tgt.setValue(org.hl7.fhir.dstu2.model.ValueSet.FilterOperator.ISA); - break; - case ISNOTA: - tgt.setValue(org.hl7.fhir.dstu2.model.ValueSet.FilterOperator.ISNOTA); - break; - case REGEX: - tgt.setValue(org.hl7.fhir.dstu2.model.ValueSet.FilterOperator.REGEX); - break; - case IN: - tgt.setValue(org.hl7.fhir.dstu2.model.ValueSet.FilterOperator.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.dstu2.model.ValueSet.FilterOperator.NOTIN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.ValueSet.FilterOperator.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new ValueSet.FilterOperatorEnumFactory()); + ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUAL: + tgt.setValue(ValueSet.FilterOperator.EQUAL); + break; + case ISA: + tgt.setValue(ValueSet.FilterOperator.ISA); + break; + case ISNOTA: + tgt.setValue(ValueSet.FilterOperator.ISNOTA); + break; + case REGEX: + tgt.setValue(ValueSet.FilterOperator.REGEX); + break; + case IN: + tgt.setValue(ValueSet.FilterOperator.IN); + break; + case NOTIN: + tgt.setValue(ValueSet.FilterOperator.NOTIN); + break; + default: + tgt.setValue(ValueSet.FilterOperator.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r4.model.ValueSet convertValueSet(org.hl7.fhir.dstu2.model.ValueSet src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/datatypes10_50/ElementDefinition10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/datatypes10_50/ElementDefinition10_50.java index 3f8db99fd3..d2aac7e863 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/datatypes10_50/ElementDefinition10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/datatypes10_50/ElementDefinition10_50.java @@ -151,17 +151,17 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentationEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case XMLATTR: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.XMLATTR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.NULL); - break; - } - } + tgt.setValue(ElementDefinition.PropertyRepresentation.XMLATTR); + break; + default: + tgt.setValue(ElementDefinition.PropertyRepresentation.NULL); + break; + } +} return tgt; } @@ -170,17 +170,17 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ElementDefinition.PropertyRepresentationEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.PropertyRepresentation.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case XMLATTR: - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.PropertyRepresentation.XMLATTR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.PropertyRepresentation.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.PropertyRepresentation.XMLATTR); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.PropertyRepresentation.NULL); + break; + } +} return tgt; } @@ -232,23 +232,23 @@ static public org.hl7.fhir.r5.model.Enumeration org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new ElementDefinition.SlicingRulesEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(ElementDefinition.SlicingRules.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CLOSED: - tgt.setValue(ElementDefinition.SlicingRules.CLOSED); - break; - case OPEN: - tgt.setValue(ElementDefinition.SlicingRules.OPEN); - break; - case OPENATEND: - tgt.setValue(ElementDefinition.SlicingRules.OPENATEND); - break; - default: - tgt.setValue(ElementDefinition.SlicingRules.NULL); - break; - } - } + tgt.setValue(ElementDefinition.SlicingRules.CLOSED); + break; + case OPEN: + tgt.setValue(ElementDefinition.SlicingRules.OPEN); + break; + case OPENATEND: + tgt.setValue(ElementDefinition.SlicingRules.OPENATEND); + break; + default: + tgt.setValue(ElementDefinition.SlicingRules.NULL); + break; + } +} return tgt; } @@ -257,23 +257,23 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRulesEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CLOSED: - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules.CLOSED); - break; - case OPEN: - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules.OPEN); - break; - case OPENATEND: - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules.OPENATEND); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules.CLOSED); + break; + case OPEN: + tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules.OPEN); + break; + case OPENATEND: + tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules.OPENATEND); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules.NULL); + break; + } +} return tgt; } @@ -342,23 +342,23 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new ElementDefinition.AggregationModeEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(ElementDefinition.AggregationMode.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CONTAINED: - tgt.setValue(ElementDefinition.AggregationMode.CONTAINED); - break; - case REFERENCED: - tgt.setValue(ElementDefinition.AggregationMode.REFERENCED); - break; - case BUNDLED: - tgt.setValue(ElementDefinition.AggregationMode.BUNDLED); - break; - default: - tgt.setValue(ElementDefinition.AggregationMode.NULL); - break; - } - } + tgt.setValue(ElementDefinition.AggregationMode.CONTAINED); + break; + case REFERENCED: + tgt.setValue(ElementDefinition.AggregationMode.REFERENCED); + break; + case BUNDLED: + tgt.setValue(ElementDefinition.AggregationMode.BUNDLED); + break; + default: + tgt.setValue(ElementDefinition.AggregationMode.NULL); + break; + } +} return tgt; } @@ -367,23 +367,23 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ElementDefinition.AggregationModeEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CONTAINED: - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode.CONTAINED); - break; - case REFERENCED: - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode.REFERENCED); - break; - case BUNDLED: - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode.BUNDLED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode.CONTAINED); + break; + case REFERENCED: + tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode.REFERENCED); + break; + case BUNDLED: + tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode.BUNDLED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode.NULL); + break; + } +} return tgt; } @@ -425,20 +425,20 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new ElementDefinition.ConstraintSeverityEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(ElementDefinition.ConstraintSeverity.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case ERROR: - tgt.setValue(ElementDefinition.ConstraintSeverity.ERROR); - break; - case WARNING: - tgt.setValue(ElementDefinition.ConstraintSeverity.WARNING); - break; - default: - tgt.setValue(ElementDefinition.ConstraintSeverity.NULL); - break; - } - } + tgt.setValue(ElementDefinition.ConstraintSeverity.ERROR); + break; + case WARNING: + tgt.setValue(ElementDefinition.ConstraintSeverity.WARNING); + break; + default: + tgt.setValue(ElementDefinition.ConstraintSeverity.NULL); + break; + } +} return tgt; } @@ -447,20 +447,20 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ElementDefinition.ConstraintSeverityEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.ConstraintSeverity.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case ERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.ConstraintSeverity.ERROR); - break; - case WARNING: - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.ConstraintSeverity.WARNING); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.ConstraintSeverity.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.ConstraintSeverity.ERROR); + break; + case WARNING: + tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.ConstraintSeverity.WARNING); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.ConstraintSeverity.NULL); + break; + } +} return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/datatypes10_50/Narrative10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/datatypes10_50/Narrative10_50.java index f353d3f011..b654448ecd 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/datatypes10_50/Narrative10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/datatypes10_50/Narrative10_50.java @@ -2,6 +2,7 @@ import org.hl7.fhir.convertors.context.ConversionContext10_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Narrative; public class Narrative10_50 { public static org.hl7.fhir.r5.model.Narrative convertNarrative(org.hl7.fhir.dstu2.model.Narrative src) throws FHIRException { @@ -27,26 +28,26 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Narrative.NarrativeStatusEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Narrative.NarrativeStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case GENERATED: - tgt.setValue(org.hl7.fhir.r5.model.Narrative.NarrativeStatus.GENERATED); - break; - case EXTENSIONS: - tgt.setValue(org.hl7.fhir.r5.model.Narrative.NarrativeStatus.EXTENSIONS); - break; - case ADDITIONAL: - tgt.setValue(org.hl7.fhir.r5.model.Narrative.NarrativeStatus.ADDITIONAL); - break; - case EMPTY: - tgt.setValue(org.hl7.fhir.r5.model.Narrative.NarrativeStatus.EMPTY); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Narrative.NarrativeStatus.NULL); - break; - } - } + tgt.setValue(Narrative.NarrativeStatus.GENERATED); + break; + case EXTENSIONS: + tgt.setValue(Narrative.NarrativeStatus.EXTENSIONS); + break; + case ADDITIONAL: + tgt.setValue(Narrative.NarrativeStatus.ADDITIONAL); + break; + case EMPTY: + tgt.setValue(Narrative.NarrativeStatus.EMPTY); + break; + default: + tgt.setValue(Narrative.NarrativeStatus.NULL); + break; + } +} return tgt; } @@ -55,26 +56,26 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Narrative.NarrativeStatusEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case GENERATED: - tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.GENERATED); - break; - case EXTENSIONS: - tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.EXTENSIONS); - break; - case ADDITIONAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.ADDITIONAL); - break; - case EMPTY: - tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.EMPTY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.GENERATED); + break; + case EXTENSIONS: + tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.EXTENSIONS); + break; + case ADDITIONAL: + tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.ADDITIONAL); + break; + case EMPTY: + tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.EMPTY); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/datatypes10_50/complextypes10_50/Address10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/datatypes10_50/complextypes10_50/Address10_50.java index 5a40156fdd..1adf337f54 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/datatypes10_50/complextypes10_50/Address10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/datatypes10_50/complextypes10_50/Address10_50.java @@ -3,6 +3,7 @@ import org.hl7.fhir.convertors.context.ConversionContext10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.String10_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Address; public class Address10_50 { public static org.hl7.fhir.r5.model.Address convertAddress(org.hl7.fhir.dstu2.model.Address src) throws FHIRException { @@ -44,26 +45,26 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Address.AddressUseEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HOME: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressUse.HOME); - break; - case WORK: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressUse.WORK); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressUse.OLD); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressUse.NULL); - break; - } - } + tgt.setValue(Address.AddressUse.HOME); + break; + case WORK: + tgt.setValue(Address.AddressUse.WORK); + break; + case TEMP: + tgt.setValue(Address.AddressUse.TEMP); + break; + case OLD: + tgt.setValue(Address.AddressUse.OLD); + break; + default: + tgt.setValue(Address.AddressUse.NULL); + break; + } +} return tgt; } @@ -72,26 +73,26 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Address.AddressUseEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HOME: - tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.HOME); - break; - case WORK: - tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.WORK); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.OLD); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.HOME); + break; + case WORK: + tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.WORK); + break; + case TEMP: + tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.TEMP); + break; + case OLD: + tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.OLD); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.NULL); + break; + } +} return tgt; } @@ -100,23 +101,23 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Address.AddressTypeEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case POSTAL: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressType.POSTAL); - break; - case PHYSICAL: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressType.PHYSICAL); - break; - case BOTH: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressType.BOTH); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressType.NULL); - break; - } - } + tgt.setValue(Address.AddressType.POSTAL); + break; + case PHYSICAL: + tgt.setValue(Address.AddressType.PHYSICAL); + break; + case BOTH: + tgt.setValue(Address.AddressType.BOTH); + break; + default: + tgt.setValue(Address.AddressType.NULL); + break; + } +} return tgt; } @@ -125,23 +126,23 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Address.AddressTypeEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case POSTAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressType.POSTAL); - break; - case PHYSICAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressType.PHYSICAL); - break; - case BOTH: - tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressType.BOTH); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressType.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressType.POSTAL); + break; + case PHYSICAL: + tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressType.PHYSICAL); + break; + case BOTH: + tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressType.BOTH); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressType.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/datatypes10_50/complextypes10_50/ContactPoint10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/datatypes10_50/complextypes10_50/ContactPoint10_50.java index e66317168d..d01794edef 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/datatypes10_50/complextypes10_50/ContactPoint10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/datatypes10_50/complextypes10_50/ContactPoint10_50.java @@ -4,6 +4,7 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.PositiveInt10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.String10_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.ContactPoint; public class ContactPoint10_50 { public static org.hl7.fhir.r5.model.ContactPoint convertContactPoint(org.hl7.fhir.dstu2.model.ContactPoint src) throws FHIRException { @@ -35,29 +36,29 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ContactPoint.ContactPointSystemEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case PHONE: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.PHONE); - break; - case FAX: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.FAX); - break; - case EMAIL: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.EMAIL); - break; - case PAGER: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.PAGER); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.NULL); - break; - } - } + tgt.setValue(ContactPoint.ContactPointSystem.PHONE); + break; + case FAX: + tgt.setValue(ContactPoint.ContactPointSystem.FAX); + break; + case EMAIL: + tgt.setValue(ContactPoint.ContactPointSystem.EMAIL); + break; + case PAGER: + tgt.setValue(ContactPoint.ContactPointSystem.PAGER); + break; + case OTHER: + tgt.setValue(ContactPoint.ContactPointSystem.OTHER); + break; + default: + tgt.setValue(ContactPoint.ContactPointSystem.NULL); + break; + } +} return tgt; } @@ -66,32 +67,32 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystemEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case PHONE: - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.PHONE); - break; - case FAX: - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.FAX); - break; - case EMAIL: - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.EMAIL); - break; - case PAGER: - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.PAGER); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.OTHER); - break; - case URL: - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.PHONE); + break; + case FAX: + tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.FAX); + break; + case EMAIL: + tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.EMAIL); + break; + case PAGER: + tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.PAGER); + break; + case OTHER: + tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.OTHER); + break; + case URL: + tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.OTHER); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.NULL); + break; + } +} return tgt; } @@ -100,29 +101,29 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ContactPoint.ContactPointUseEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HOME: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.HOME); - break; - case WORK: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.WORK); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.OLD); - break; - case MOBILE: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.MOBILE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.NULL); - break; - } - } + tgt.setValue(ContactPoint.ContactPointUse.HOME); + break; + case WORK: + tgt.setValue(ContactPoint.ContactPointUse.WORK); + break; + case TEMP: + tgt.setValue(ContactPoint.ContactPointUse.TEMP); + break; + case OLD: + tgt.setValue(ContactPoint.ContactPointUse.OLD); + break; + case MOBILE: + tgt.setValue(ContactPoint.ContactPointUse.MOBILE); + break; + default: + tgt.setValue(ContactPoint.ContactPointUse.NULL); + break; + } +} return tgt; } @@ -131,29 +132,29 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUseEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HOME: - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.HOME); - break; - case WORK: - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.WORK); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.OLD); - break; - case MOBILE: - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.MOBILE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.HOME); + break; + case WORK: + tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.WORK); + break; + case TEMP: + tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.TEMP); + break; + case OLD: + tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.OLD); + break; + case MOBILE: + tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.MOBILE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/datatypes10_50/complextypes10_50/HumanName10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/datatypes10_50/complextypes10_50/HumanName10_50.java index fde818d514..ece55f0c1e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/datatypes10_50/complextypes10_50/HumanName10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/datatypes10_50/complextypes10_50/HumanName10_50.java @@ -3,6 +3,7 @@ import org.hl7.fhir.convertors.context.ConversionContext10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.String10_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.HumanName; public class HumanName10_50 { public static org.hl7.fhir.r5.model.HumanName convertHumanName(org.hl7.fhir.dstu2.model.HumanName src) throws FHIRException { @@ -38,35 +39,35 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.HumanName.NameUseEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case USUAL: - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.USUAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.OFFICIAL); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.TEMP); - break; - case NICKNAME: - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.NICKNAME); - break; - case ANONYMOUS: - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.ANONYMOUS); - break; - case OLD: - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.OLD); - break; - case MAIDEN: - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.MAIDEN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.NULL); - break; - } - } + tgt.setValue(HumanName.NameUse.USUAL); + break; + case OFFICIAL: + tgt.setValue(HumanName.NameUse.OFFICIAL); + break; + case TEMP: + tgt.setValue(HumanName.NameUse.TEMP); + break; + case NICKNAME: + tgt.setValue(HumanName.NameUse.NICKNAME); + break; + case ANONYMOUS: + tgt.setValue(HumanName.NameUse.ANONYMOUS); + break; + case OLD: + tgt.setValue(HumanName.NameUse.OLD); + break; + case MAIDEN: + tgt.setValue(HumanName.NameUse.MAIDEN); + break; + default: + tgt.setValue(HumanName.NameUse.NULL); + break; + } +} return tgt; } @@ -75,35 +76,35 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.HumanName.NameUseEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case USUAL: - tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.USUAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.OFFICIAL); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.TEMP); - break; - case NICKNAME: - tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.NICKNAME); - break; - case ANONYMOUS: - tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.ANONYMOUS); - break; - case OLD: - tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.OLD); - break; - case MAIDEN: - tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.MAIDEN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.USUAL); + break; + case OFFICIAL: + tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.OFFICIAL); + break; + case TEMP: + tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.TEMP); + break; + case NICKNAME: + tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.NICKNAME); + break; + case ANONYMOUS: + tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.ANONYMOUS); + break; + case OLD: + tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.OLD); + break; + case MAIDEN: + tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.MAIDEN); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/datatypes10_50/complextypes10_50/Identifier10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/datatypes10_50/complextypes10_50/Identifier10_50.java index b109480554..da5f4d51b9 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/datatypes10_50/complextypes10_50/Identifier10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/datatypes10_50/complextypes10_50/Identifier10_50.java @@ -5,6 +5,7 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.String10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.Uri10_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Identifier; public class Identifier10_50 { public static org.hl7.fhir.r5.model.Identifier convertIdentifier(org.hl7.fhir.dstu2.model.Identifier src) throws FHIRException { @@ -38,26 +39,26 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Identifier.IdentifierUseEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Identifier.IdentifierUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case USUAL: - tgt.setValue(org.hl7.fhir.r5.model.Identifier.IdentifierUse.USUAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.r5.model.Identifier.IdentifierUse.OFFICIAL); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.r5.model.Identifier.IdentifierUse.TEMP); - break; - case SECONDARY: - tgt.setValue(org.hl7.fhir.r5.model.Identifier.IdentifierUse.SECONDARY); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Identifier.IdentifierUse.NULL); - break; - } - } + tgt.setValue(Identifier.IdentifierUse.USUAL); + break; + case OFFICIAL: + tgt.setValue(Identifier.IdentifierUse.OFFICIAL); + break; + case TEMP: + tgt.setValue(Identifier.IdentifierUse.TEMP); + break; + case SECONDARY: + tgt.setValue(Identifier.IdentifierUse.SECONDARY); + break; + default: + tgt.setValue(Identifier.IdentifierUse.NULL); + break; + } +} return tgt; } @@ -66,26 +67,26 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Identifier.IdentifierUseEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case USUAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.USUAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.OFFICIAL); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.TEMP); - break; - case SECONDARY: - tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.SECONDARY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.USUAL); + break; + case OFFICIAL: + tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.OFFICIAL); + break; + case TEMP: + tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.TEMP); + break; + case SECONDARY: + tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.SECONDARY); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/datatypes10_50/complextypes10_50/Quantity10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/datatypes10_50/complextypes10_50/Quantity10_50.java index 92d8637190..dec4b6ea60 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/datatypes10_50/complextypes10_50/Quantity10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/datatypes10_50/complextypes10_50/Quantity10_50.java @@ -5,7 +5,9 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.Decimal10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.String10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.Uri10_50; +import org.hl7.fhir.dstu2.model.Quantity; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumerations; public class Quantity10_50 { public static org.hl7.fhir.r5.model.Quantity convertQuantity(org.hl7.fhir.dstu2.model.Quantity src) throws FHIRException { @@ -37,26 +39,26 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.QuantityComparatorEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.QuantityComparator.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case LESS_THAN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.QuantityComparator.LESS_THAN); - break; - case LESS_OR_EQUAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.QuantityComparator.LESS_OR_EQUAL); - break; - case GREATER_OR_EQUAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.QuantityComparator.GREATER_OR_EQUAL); - break; - case GREATER_THAN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.QuantityComparator.GREATER_THAN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.QuantityComparator.NULL); - break; - } - } + tgt.setValue(Enumerations.QuantityComparator.LESS_THAN); + break; + case LESS_OR_EQUAL: + tgt.setValue(Enumerations.QuantityComparator.LESS_OR_EQUAL); + break; + case GREATER_OR_EQUAL: + tgt.setValue(Enumerations.QuantityComparator.GREATER_OR_EQUAL); + break; + case GREATER_THAN: + tgt.setValue(Enumerations.QuantityComparator.GREATER_THAN); + break; + default: + tgt.setValue(Enumerations.QuantityComparator.NULL); + break; + } +} return tgt; } @@ -65,26 +67,26 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Quantity.QuantityComparatorEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.Quantity.QuantityComparator.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case LESS_THAN: - tgt.setValue(org.hl7.fhir.dstu2.model.Quantity.QuantityComparator.LESS_THAN); - break; - case LESS_OR_EQUAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Quantity.QuantityComparator.LESS_OR_EQUAL); - break; - case GREATER_OR_EQUAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Quantity.QuantityComparator.GREATER_OR_EQUAL); - break; - case GREATER_THAN: - tgt.setValue(org.hl7.fhir.dstu2.model.Quantity.QuantityComparator.GREATER_THAN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Quantity.QuantityComparator.NULL); - break; - } - } + tgt.setValue(Quantity.QuantityComparator.LESS_THAN); + break; + case LESS_OR_EQUAL: + tgt.setValue(Quantity.QuantityComparator.LESS_OR_EQUAL); + break; + case GREATER_OR_EQUAL: + tgt.setValue(Quantity.QuantityComparator.GREATER_OR_EQUAL); + break; + case GREATER_THAN: + tgt.setValue(Quantity.QuantityComparator.GREATER_THAN); + break; + default: + tgt.setValue(Quantity.QuantityComparator.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/datatypes10_50/complextypes10_50/Timing10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/datatypes10_50/complextypes10_50/Timing10_50.java index f4eb009d71..0542717bd8 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/datatypes10_50/complextypes10_50/Timing10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/datatypes10_50/complextypes10_50/Timing10_50.java @@ -5,6 +5,7 @@ import org.hl7.fhir.convertors.context.ConversionContext10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.Decimal10_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Timing; public class Timing10_50 { public static org.hl7.fhir.r5.model.Timing convertTiming(org.hl7.fhir.dstu2.model.Timing src) throws FHIRException { @@ -72,35 +73,35 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Timing.UnitsOfTimeEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case S: - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.S); - break; - case MIN: - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.MIN); - break; - case H: - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.H); - break; - case D: - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.D); - break; - case WK: - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.WK); - break; - case MO: - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.MO); - break; - case A: - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.A); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.NULL); - break; - } - } + tgt.setValue(Timing.UnitsOfTime.S); + break; + case MIN: + tgt.setValue(Timing.UnitsOfTime.MIN); + break; + case H: + tgt.setValue(Timing.UnitsOfTime.H); + break; + case D: + tgt.setValue(Timing.UnitsOfTime.D); + break; + case WK: + tgt.setValue(Timing.UnitsOfTime.WK); + break; + case MO: + tgt.setValue(Timing.UnitsOfTime.MO); + break; + case A: + tgt.setValue(Timing.UnitsOfTime.A); + break; + default: + tgt.setValue(Timing.UnitsOfTime.NULL); + break; + } +} return tgt; } @@ -109,35 +110,35 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Timing.UnitsOfTimeEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case S: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.S); - break; - case MIN: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.MIN); - break; - case H: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.H); - break; - case D: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.D); - break; - case WK: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.WK); - break; - case MO: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.MO); - break; - case A: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.A); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.S); + break; + case MIN: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.MIN); + break; + case H: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.H); + break; + case D: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.D); + break; + case WK: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.WK); + break; + case MO: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.MO); + break; + case A: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.A); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.NULL); + break; + } +} return tgt; } @@ -146,56 +147,56 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Timing.EventTimingEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HS: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.HS); - break; - case WAKE: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.WAKE); - break; - case C: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.C); - break; - case CM: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.CM); - break; - case CD: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.CD); - break; - case CV: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.CV); - break; - case AC: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.AC); - break; - case ACM: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.ACM); - break; - case ACD: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.ACD); - break; - case ACV: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.ACV); - break; - case PC: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.PC); - break; - case PCM: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.PCM); - break; - case PCD: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.PCD); - break; - case PCV: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.PCV); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.NULL); - break; - } - } + tgt.setValue(Timing.EventTiming.HS); + break; + case WAKE: + tgt.setValue(Timing.EventTiming.WAKE); + break; + case C: + tgt.setValue(Timing.EventTiming.C); + break; + case CM: + tgt.setValue(Timing.EventTiming.CM); + break; + case CD: + tgt.setValue(Timing.EventTiming.CD); + break; + case CV: + tgt.setValue(Timing.EventTiming.CV); + break; + case AC: + tgt.setValue(Timing.EventTiming.AC); + break; + case ACM: + tgt.setValue(Timing.EventTiming.ACM); + break; + case ACD: + tgt.setValue(Timing.EventTiming.ACD); + break; + case ACV: + tgt.setValue(Timing.EventTiming.ACV); + break; + case PC: + tgt.setValue(Timing.EventTiming.PC); + break; + case PCM: + tgt.setValue(Timing.EventTiming.PCM); + break; + case PCD: + tgt.setValue(Timing.EventTiming.PCD); + break; + case PCV: + tgt.setValue(Timing.EventTiming.PCV); + break; + default: + tgt.setValue(Timing.EventTiming.NULL); + break; + } +} return tgt; } @@ -204,56 +205,56 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Timing.EventTimingEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HS: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.HS); - break; - case WAKE: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.WAKE); - break; - case C: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.C); - break; - case CM: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.CM); - break; - case CD: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.CD); - break; - case CV: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.CV); - break; - case AC: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.AC); - break; - case ACM: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.ACM); - break; - case ACD: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.ACD); - break; - case ACV: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.ACV); - break; - case PC: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.PC); - break; - case PCM: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.PCM); - break; - case PCD: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.PCD); - break; - case PCV: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.PCV); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.HS); + break; + case WAKE: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.WAKE); + break; + case C: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.C); + break; + case CM: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.CM); + break; + case CD: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.CD); + break; + case CV: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.CV); + break; + case AC: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.AC); + break; + case ACM: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.ACM); + break; + case ACD: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.ACD); + break; + case ACV: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.ACV); + break; + case PC: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.PC); + break; + case PCM: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.PCM); + break; + case PCD: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.PCD); + break; + case PCV: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.PCV); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Appointment10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Appointment10_50.java index 2b02ed0017..fdb4bc49b4 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Appointment10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Appointment10_50.java @@ -10,7 +10,10 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.String10_50; import org.hl7.fhir.dstu2.model.UnsignedIntType; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Appointment; +import org.hl7.fhir.r5.model.BooleanType; import org.hl7.fhir.r5.model.CodeableConcept; +import org.hl7.fhir.r5.model.Enumeration; public class Appointment10_50 { @@ -126,71 +129,79 @@ public static org.hl7.fhir.r5.model.Appointment.AppointmentParticipantComponent } static public org.hl7.fhir.r5.model.Enumeration convertAppointmentStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Appointment.AppointmentStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSED: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.PROPOSED); - break; - case PENDING: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.PENDING); - break; - case BOOKED: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.BOOKED); - break; - case ARRIVED: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.ARRIVED); - break; - case FULFILLED: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.FULFILLED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.CANCELLED); - break; - case NOSHOW: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.NOSHOW); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Appointment.AppointmentStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSED: + tgt.setValue(Appointment.AppointmentStatus.PROPOSED); + break; + case PENDING: + tgt.setValue(Appointment.AppointmentStatus.PENDING); + break; + case BOOKED: + tgt.setValue(Appointment.AppointmentStatus.BOOKED); + break; + case ARRIVED: + tgt.setValue(Appointment.AppointmentStatus.ARRIVED); + break; + case FULFILLED: + tgt.setValue(Appointment.AppointmentStatus.FULFILLED); + break; + case CANCELLED: + tgt.setValue(Appointment.AppointmentStatus.CANCELLED); + break; + case NOSHOW: + tgt.setValue(Appointment.AppointmentStatus.NOSHOW); + break; + default: + tgt.setValue(Appointment.AppointmentStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertAppointmentStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Appointment.AppointmentStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSED: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.PROPOSED); - break; - case PENDING: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.PENDING); - break; - case BOOKED: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.BOOKED); - break; - case ARRIVED: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.ARRIVED); - break; - case FULFILLED: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.FULFILLED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.CANCELLED); - break; - case NOSHOW: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.NOSHOW); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Appointment.AppointmentStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSED: + tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.PROPOSED); + break; + case PENDING: + tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.PENDING); + break; + case BOOKED: + tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.BOOKED); + break; + case ARRIVED: + tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.ARRIVED); + break; + case FULFILLED: + tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.FULFILLED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.CANCELLED); + break; + case NOSHOW: + tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.NOSHOW); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertParticipantRequired(org.hl7.fhir.r5.model.BooleanType src) throws FHIRException { @@ -207,73 +218,85 @@ static public org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.BooleanType tgt = new org.hl7.fhir.r5.model.BooleanType(); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case REQUIRED: - tgt.setValue(true); - break; - case OPTIONAL: - tgt.setValue(false); - break; - case INFORMATIONONLY: - tgt.setValue(false); - break; - default: - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + BooleanType tgt = new BooleanType(); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REQUIRED: + tgt.setValue(true); + break; + case OPTIONAL: + tgt.setValue(false); + break; + case INFORMATIONONLY: + tgt.setValue(false); + break; + default: + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertParticipationStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Appointment.ParticipationStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACCEPTED: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.ParticipationStatus.ACCEPTED); - break; - case DECLINED: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.ParticipationStatus.DECLINED); - break; - case TENTATIVE: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.ParticipationStatus.TENTATIVE); - break; - case NEEDSACTION: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.ParticipationStatus.NEEDSACTION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.ParticipationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Appointment.ParticipationStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACCEPTED: + tgt.setValue(Appointment.ParticipationStatus.ACCEPTED); + break; + case DECLINED: + tgt.setValue(Appointment.ParticipationStatus.DECLINED); + break; + case TENTATIVE: + tgt.setValue(Appointment.ParticipationStatus.TENTATIVE); + break; + case NEEDSACTION: + tgt.setValue(Appointment.ParticipationStatus.NEEDSACTION); + break; + default: + tgt.setValue(Appointment.ParticipationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertParticipationStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Appointment.ParticipationStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACCEPTED: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipationStatus.ACCEPTED); - break; - case DECLINED: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipationStatus.DECLINED); - break; - case TENTATIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipationStatus.TENTATIVE); - break; - case NEEDSACTION: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipationStatus.NEEDSACTION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Appointment.ParticipationStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACCEPTED: + tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipationStatus.ACCEPTED); + break; + case DECLINED: + tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipationStatus.DECLINED); + break; + case TENTATIVE: + tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipationStatus.TENTATIVE); + break; + case NEEDSACTION: + tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipationStatus.NEEDSACTION); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipationStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/AppointmentResponse10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/AppointmentResponse10_50.java index 1d36529b06..832e49d9d8 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/AppointmentResponse10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/AppointmentResponse10_50.java @@ -6,6 +6,8 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.complextypes10_50.Identifier10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.Instant10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.String10_50; +import org.hl7.fhir.dstu2.model.AppointmentResponse; +import org.hl7.fhir.dstu2.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; public class AppointmentResponse10_50 { @@ -59,58 +61,66 @@ public static org.hl7.fhir.r5.model.AppointmentResponse convertAppointmentRespon } static public org.hl7.fhir.dstu2.model.Enumeration convertParticipantStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACCEPTED: - tgt.setValue(org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus.ACCEPTED); - break; - case DECLINED: - tgt.setValue(org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus.DECLINED); - break; - case TENTATIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus.TENTATIVE); - break; - case NEEDSACTION: - tgt.setValue(org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus.NEEDSACTION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new AppointmentResponse.ParticipantStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACCEPTED: + tgt.setValue(AppointmentResponse.ParticipantStatus.ACCEPTED); + break; + case DECLINED: + tgt.setValue(AppointmentResponse.ParticipantStatus.DECLINED); + break; + case TENTATIVE: + tgt.setValue(AppointmentResponse.ParticipantStatus.TENTATIVE); + break; + case NEEDSACTION: + tgt.setValue(AppointmentResponse.ParticipantStatus.NEEDSACTION); + break; + default: + tgt.setValue(AppointmentResponse.ParticipantStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertParticipantStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.AppointmentResponse.AppointmentResponseStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACCEPTED: - tgt.setValue(org.hl7.fhir.r5.model.AppointmentResponse.AppointmentResponseStatus.ACCEPTED); - break; - case DECLINED: - tgt.setValue(org.hl7.fhir.r5.model.AppointmentResponse.AppointmentResponseStatus.DECLINED); - break; - case TENTATIVE: - tgt.setValue(org.hl7.fhir.r5.model.AppointmentResponse.AppointmentResponseStatus.TENTATIVE); - break; - case INPROCESS: - tgt.setValue(org.hl7.fhir.r5.model.AppointmentResponse.AppointmentResponseStatus.ACCEPTED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.AppointmentResponse.AppointmentResponseStatus.ACCEPTED); - break; - case NEEDSACTION: - tgt.setValue(org.hl7.fhir.r5.model.AppointmentResponse.AppointmentResponseStatus.NEEDSACTION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.AppointmentResponse.AppointmentResponseStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.AppointmentResponse.AppointmentResponseStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACCEPTED: + tgt.setValue(org.hl7.fhir.r5.model.AppointmentResponse.AppointmentResponseStatus.ACCEPTED); + break; + case DECLINED: + tgt.setValue(org.hl7.fhir.r5.model.AppointmentResponse.AppointmentResponseStatus.DECLINED); + break; + case TENTATIVE: + tgt.setValue(org.hl7.fhir.r5.model.AppointmentResponse.AppointmentResponseStatus.TENTATIVE); + break; + case INPROCESS: + tgt.setValue(org.hl7.fhir.r5.model.AppointmentResponse.AppointmentResponseStatus.ACCEPTED); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r5.model.AppointmentResponse.AppointmentResponseStatus.ACCEPTED); + break; + case NEEDSACTION: + tgt.setValue(org.hl7.fhir.r5.model.AppointmentResponse.AppointmentResponseStatus.NEEDSACTION); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.AppointmentResponse.AppointmentResponseStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/AuditEvent10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/AuditEvent10_50.java index cccfda8689..bf059699d9 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/AuditEvent10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/AuditEvent10_50.java @@ -9,7 +9,9 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.Boolean10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.String10_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.AuditEvent; import org.hl7.fhir.r5.model.CodeableConcept; +import org.hl7.fhir.r5.model.Enumeration; public class AuditEvent10_50 { @@ -72,59 +74,67 @@ public static org.hl7.fhir.r5.model.AuditEvent convertAuditEvent(org.hl7.fhir.ds } static public org.hl7.fhir.r5.model.Enumeration convertAuditEventAction(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.AuditEvent.AuditEventActionEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case C: - tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.C); - break; - case R: - tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.R); - break; - case U: - tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.U); - break; - case D: - tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.D); - break; - case E: - tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.E); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new AuditEvent.AuditEventActionEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case C: + tgt.setValue(AuditEvent.AuditEventAction.C); + break; + case R: + tgt.setValue(AuditEvent.AuditEventAction.R); + break; + case U: + tgt.setValue(AuditEvent.AuditEventAction.U); + break; + case D: + tgt.setValue(AuditEvent.AuditEventAction.D); + break; + case E: + tgt.setValue(AuditEvent.AuditEventAction.E); + break; + default: + tgt.setValue(AuditEvent.AuditEventAction.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertAuditEventAction(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventActionEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case C: - tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.C); - break; - case R: - tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.R); - break; - case U: - tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.U); - break; - case D: - tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.D); - break; - case E: - tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.E); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventActionEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case C: + tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.C); + break; + case R: + tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.R); + break; + case U: + tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.U); + break; + case D: + tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.D); + break; + case E: + tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.E); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantComponent convertAuditEventAgentComponent(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Bundle10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Bundle10_50.java index e87e8e5eef..38bbf3e577 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Bundle10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Bundle10_50.java @@ -9,7 +9,9 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.UnsignedInt10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.Uri10_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Bundle; import org.hl7.fhir.r5.model.Bundle.LinkRelationTypes; +import org.hl7.fhir.r5.model.Enumeration; import org.hl7.fhir.utilities.FhirPublication; public class Bundle10_50 { @@ -219,176 +221,200 @@ public static org.hl7.fhir.dstu2.model.Bundle.BundleLinkComponent convertBundleL } static public org.hl7.fhir.r5.model.Enumeration convertBundleType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Bundle.BundleTypeEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case DOCUMENT: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.DOCUMENT); - break; - case MESSAGE: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.MESSAGE); - break; - case TRANSACTION: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.TRANSACTION); - break; - case TRANSACTIONRESPONSE: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.TRANSACTIONRESPONSE); - break; - case BATCH: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.BATCH); - break; - case BATCHRESPONSE: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.BATCHRESPONSE); - break; - case HISTORY: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.HISTORY); - break; - case SEARCHSET: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.SEARCHSET); - break; - case COLLECTION: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.COLLECTION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Bundle.BundleTypeEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DOCUMENT: + tgt.setValue(Bundle.BundleType.DOCUMENT); + break; + case MESSAGE: + tgt.setValue(Bundle.BundleType.MESSAGE); + break; + case TRANSACTION: + tgt.setValue(Bundle.BundleType.TRANSACTION); + break; + case TRANSACTIONRESPONSE: + tgt.setValue(Bundle.BundleType.TRANSACTIONRESPONSE); + break; + case BATCH: + tgt.setValue(Bundle.BundleType.BATCH); + break; + case BATCHRESPONSE: + tgt.setValue(Bundle.BundleType.BATCHRESPONSE); + break; + case HISTORY: + tgt.setValue(Bundle.BundleType.HISTORY); + break; + case SEARCHSET: + tgt.setValue(Bundle.BundleType.SEARCHSET); + break; + case COLLECTION: + tgt.setValue(Bundle.BundleType.COLLECTION); + break; + default: + tgt.setValue(Bundle.BundleType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertBundleType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Bundle.BundleTypeEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case DOCUMENT: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.DOCUMENT); - break; - case MESSAGE: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.MESSAGE); - break; - case TRANSACTION: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.TRANSACTION); - break; - case TRANSACTIONRESPONSE: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.TRANSACTIONRESPONSE); - break; - case BATCH: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.BATCH); - break; - case BATCHRESPONSE: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.BATCHRESPONSE); - break; - case HISTORY: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.HISTORY); - break; - case SEARCHSET: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.SEARCHSET); - break; - case COLLECTION: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.COLLECTION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Bundle.BundleTypeEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DOCUMENT: + tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.DOCUMENT); + break; + case MESSAGE: + tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.MESSAGE); + break; + case TRANSACTION: + tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.TRANSACTION); + break; + case TRANSACTIONRESPONSE: + tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.TRANSACTIONRESPONSE); + break; + case BATCH: + tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.BATCH); + break; + case BATCHRESPONSE: + tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.BATCHRESPONSE); + break; + case HISTORY: + tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.HISTORY); + break; + case SEARCHSET: + tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.SEARCHSET); + break; + case COLLECTION: + tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.COLLECTION); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertHTTPVerb(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Bundle.HTTPVerbEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case GET: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.GET); - break; - case POST: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.POST); - break; - case PUT: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.PUT); - break; - case DELETE: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.DELETE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Bundle.HTTPVerbEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case GET: + tgt.setValue(Bundle.HTTPVerb.GET); + break; + case POST: + tgt.setValue(Bundle.HTTPVerb.POST); + break; + case PUT: + tgt.setValue(Bundle.HTTPVerb.PUT); + break; + case DELETE: + tgt.setValue(Bundle.HTTPVerb.DELETE); + break; + default: + tgt.setValue(Bundle.HTTPVerb.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertHTTPVerb(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Bundle.HTTPVerbEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case GET: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.HTTPVerb.GET); - break; - case POST: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.HTTPVerb.POST); - break; - case PUT: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.HTTPVerb.PUT); - break; - case DELETE: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.HTTPVerb.DELETE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.HTTPVerb.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Bundle.HTTPVerbEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case GET: + tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.HTTPVerb.GET); + break; + case POST: + tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.HTTPVerb.POST); + break; + case PUT: + tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.HTTPVerb.PUT); + break; + case DELETE: + tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.HTTPVerb.DELETE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.HTTPVerb.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertSearchEntryMode(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Bundle.SearchEntryModeEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case MATCH: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.SearchEntryMode.MATCH); - break; - case INCLUDE: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.SearchEntryMode.INCLUDE); - break; - case OUTCOME: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.SearchEntryMode.OUTCOME); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.SearchEntryMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Bundle.SearchEntryModeEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MATCH: + tgt.setValue(Bundle.SearchEntryMode.MATCH); + break; + case INCLUDE: + tgt.setValue(Bundle.SearchEntryMode.INCLUDE); + break; + case OUTCOME: + tgt.setValue(Bundle.SearchEntryMode.OUTCOME); + break; + default: + tgt.setValue(Bundle.SearchEntryMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertSearchEntryMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Bundle.SearchEntryModeEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case MATCH: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.SearchEntryMode.MATCH); - break; - case INCLUDE: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.SearchEntryMode.INCLUDE); - break; - case OUTCOME: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.SearchEntryMode.OUTCOME); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.SearchEntryMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Bundle.SearchEntryModeEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MATCH: + tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.SearchEntryMode.MATCH); + break; + case INCLUDE: + tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.SearchEntryMode.INCLUDE); + break; + case OUTCOME: + tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.SearchEntryMode.OUTCOME); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.SearchEntryMode.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/CarePlan10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/CarePlan10_50.java index 98dd940dfb..4cfc2ed47e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/CarePlan10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/CarePlan10_50.java @@ -7,9 +7,12 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.complextypes10_50.Identifier10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.complextypes10_50.Period10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.String10_50; +import org.hl7.fhir.dstu2.model.CarePlan; +import org.hl7.fhir.dstu2.model.Enumeration; import org.hl7.fhir.dstu2.model.Reference; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumerations; public class CarePlan10_50 { @@ -235,56 +238,64 @@ public static org.hl7.fhir.r5.model.CarePlan.CarePlanActivityComponent convertCa // } static public org.hl7.fhir.dstu2.model.Enumeration convertCarePlanStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatus.ACTIVE); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatus.COMPLETED); - break; - case REVOKED: - tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatus.CANCELLED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CarePlan.CarePlanStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(CarePlan.CarePlanStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(CarePlan.CarePlanStatus.ACTIVE); + break; + case COMPLETED: + tgt.setValue(CarePlan.CarePlanStatus.COMPLETED); + break; + case REVOKED: + tgt.setValue(CarePlan.CarePlanStatus.CANCELLED); + break; + default: + tgt.setValue(CarePlan.CarePlanStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertCarePlanStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.DRAFT); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ACTIVE); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.COMPLETED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.REVOKED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new Enumerations.RequestStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSED: + tgt.setValue(Enumerations.RequestStatus.DRAFT); + break; + case DRAFT: + tgt.setValue(Enumerations.RequestStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(Enumerations.RequestStatus.ACTIVE); + break; + case COMPLETED: + tgt.setValue(Enumerations.RequestStatus.COMPLETED); + break; + case CANCELLED: + tgt.setValue(Enumerations.RequestStatus.REVOKED); + break; + default: + tgt.setValue(Enumerations.RequestStatus.NULL); + break; + } + } + return tgt; } static public CodeableReference convertReferenceToCodableReference(Reference src) { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Communication10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Communication10_50.java index d01cc64f92..e2bfa01d9a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Communication10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Communication10_50.java @@ -5,8 +5,11 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.complextypes10_50.CodeableConcept10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.complextypes10_50.Identifier10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.DateTime10_50; +import org.hl7.fhir.dstu2.model.Communication; +import org.hl7.fhir.dstu2.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumerations; public class Communication10_50 { @@ -95,58 +98,66 @@ public static org.hl7.fhir.r5.model.Communication.CommunicationPayloadComponent } static public org.hl7.fhir.dstu2.model.Enumeration convertCommunicationStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Communication.CommunicationStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu2.model.Communication.CommunicationStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu2.model.Communication.CommunicationStatus.COMPLETED); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.dstu2.model.Communication.CommunicationStatus.SUSPENDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.Communication.CommunicationStatus.REJECTED); - break; - case NOTDONE: - tgt.setValue(org.hl7.fhir.dstu2.model.Communication.CommunicationStatus.FAILED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Communication.CommunicationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Communication.CommunicationStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(Communication.CommunicationStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(Communication.CommunicationStatus.COMPLETED); + break; + case ONHOLD: + tgt.setValue(Communication.CommunicationStatus.SUSPENDED); + break; + case ENTEREDINERROR: + tgt.setValue(Communication.CommunicationStatus.REJECTED); + break; + case NOTDONE: + tgt.setValue(Communication.CommunicationStatus.FAILED); + break; + default: + tgt.setValue(Communication.CommunicationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertCommunicationStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.EventStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.COMPLETED); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.ONHOLD); - break; - case REJECTED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.ENTEREDINERROR); - break; - case FAILED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.NOTDONE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new Enumerations.EventStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(Enumerations.EventStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(Enumerations.EventStatus.COMPLETED); + break; + case SUSPENDED: + tgt.setValue(Enumerations.EventStatus.ONHOLD); + break; + case REJECTED: + tgt.setValue(Enumerations.EventStatus.ENTEREDINERROR); + break; + case FAILED: + tgt.setValue(Enumerations.EventStatus.NOTDONE); + break; + default: + tgt.setValue(Enumerations.EventStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/CommunicationRequest10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/CommunicationRequest10_50.java index 8cfd1d76aa..a5eb7d54de 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/CommunicationRequest10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/CommunicationRequest10_50.java @@ -5,8 +5,11 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.complextypes10_50.CodeableConcept10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.complextypes10_50.Identifier10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.DateTime10_50; +import org.hl7.fhir.dstu2.model.CommunicationRequest; +import org.hl7.fhir.dstu2.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumerations; public class CommunicationRequest10_50 { @@ -103,71 +106,79 @@ public static org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequest } static public org.hl7.fhir.dstu2.model.Enumeration convertCommunicationRequestStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.PROPOSED); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.COMPLETED); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.SUSPENDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.REJECTED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CommunicationRequest.CommunicationRequestStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(CommunicationRequest.CommunicationRequestStatus.PROPOSED); + break; + case ACTIVE: + tgt.setValue(CommunicationRequest.CommunicationRequestStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(CommunicationRequest.CommunicationRequestStatus.COMPLETED); + break; + case ONHOLD: + tgt.setValue(CommunicationRequest.CommunicationRequestStatus.SUSPENDED); + break; + case ENTEREDINERROR: + tgt.setValue(CommunicationRequest.CommunicationRequestStatus.REJECTED); + break; + default: + tgt.setValue(CommunicationRequest.CommunicationRequestStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertCommunicationRequestStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.DRAFT); - break; - case PLANNED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ACTIVE); - break; - case REQUESTED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ACTIVE); - break; - case RECEIVED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ACTIVE); - break; - case ACCEPTED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ACTIVE); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ACTIVE); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.COMPLETED); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ONHOLD); - break; - case REJECTED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new Enumerations.RequestStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSED: + tgt.setValue(Enumerations.RequestStatus.DRAFT); + break; + case PLANNED: + tgt.setValue(Enumerations.RequestStatus.ACTIVE); + break; + case REQUESTED: + tgt.setValue(Enumerations.RequestStatus.ACTIVE); + break; + case RECEIVED: + tgt.setValue(Enumerations.RequestStatus.ACTIVE); + break; + case ACCEPTED: + tgt.setValue(Enumerations.RequestStatus.ACTIVE); + break; + case INPROGRESS: + tgt.setValue(Enumerations.RequestStatus.ACTIVE); + break; + case COMPLETED: + tgt.setValue(Enumerations.RequestStatus.COMPLETED); + break; + case SUSPENDED: + tgt.setValue(Enumerations.RequestStatus.ONHOLD); + break; + case REJECTED: + tgt.setValue(Enumerations.RequestStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Enumerations.RequestStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumerations.RequestPriority convertPriorityCode(org.hl7.fhir.dstu2.model.CodeableConcept priority) { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Composition10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Composition10_50.java index 0979652d9e..1bc108f4c0 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Composition10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Composition10_50.java @@ -11,8 +11,12 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.Code10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.DateTime10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.String10_50; +import org.hl7.fhir.dstu2.model.Composition; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.CodeableConcept; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; public class Composition10_50 { @@ -115,27 +119,31 @@ static public org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.CodeableConcept tgt = new org.hl7.fhir.r5.model.CodeableConcept(); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case PERSONAL: - tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("personal"); - break; - case PROFESSIONAL: - tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("professional"); - break; - case LEGAL: - tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("legal"); - break; - case OFFICIAL: - tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("official"); - break; - default: - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + CodeableConcept tgt = new CodeableConcept(); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + // Add nothing + } else { + switch (src.getValue()) { + case PERSONAL: + tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("personal"); + break; + case PROFESSIONAL: + tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("professional"); + break; + case LEGAL: + tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("legal"); + break; + case OFFICIAL: + tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("official"); + break; + default: + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2.model.Composition.CompositionAttesterComponent convertCompositionAttesterComponent(org.hl7.fhir.r5.model.Composition.CompositionAttesterComponent src) throws FHIRException { if (src == null || src.isEmpty()) @@ -197,53 +205,61 @@ public static org.hl7.fhir.r5.model.Composition.CompositionEventComponent conver } static public org.hl7.fhir.r5.model.Enumeration convertCompositionStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.CompositionStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.AMENDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.CompositionStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRELIMINARY: + tgt.setValue(Enumerations.CompositionStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(Enumerations.CompositionStatus.FINAL); + break; + case AMENDED: + tgt.setValue(Enumerations.CompositionStatus.AMENDED); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.CompositionStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Enumerations.CompositionStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertCompositionStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Composition.CompositionStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionStatus.AMENDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new Composition.CompositionStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRELIMINARY: + tgt.setValue(Composition.CompositionStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(Composition.CompositionStatus.FINAL); + break; + case AMENDED: + tgt.setValue(Composition.CompositionStatus.AMENDED); + break; + case ENTEREDINERROR: + tgt.setValue(Composition.CompositionStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Composition.CompositionStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2.model.Composition.SectionComponent convertSectionComponent(org.hl7.fhir.r5.model.Composition.SectionComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/ConceptMap10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/ConceptMap10_50.java index 6ba73f1e1b..ec3c163308 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/ConceptMap10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/ConceptMap10_50.java @@ -156,66 +156,74 @@ public static org.hl7.fhir.dstu2.model.Enumeration conver if (ccm.hasExtension(VersionConvertorConstants.EXT_OLD_CONCEPTMAP_EQUIVALENCE)) { tgt.setValueAsString(ccm.getExtensionString(VersionConvertorConstants.EXT_OLD_CONCEPTMAP_EQUIVALENCE)); } else { - switch (src.getValue()) { - case EQUIVALENT: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.EQUIVALENT); - break; - case SOURCEISNARROWERTHANTARGET: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.WIDER); - break; - case SOURCEISBROADERTHANTARGET: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.NARROWER); - break; - case NOTRELATEDTO: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.DISJOINT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.NULL); - break; - } + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUIVALENT: + tgt.setValue(ConceptMapEquivalence.EQUIVALENT); + break; + case SOURCEISNARROWERTHANTARGET: + tgt.setValue(ConceptMapEquivalence.WIDER); + break; + case SOURCEISBROADERTHANTARGET: + tgt.setValue(ConceptMapEquivalence.NARROWER); + break; + case NOTRELATEDTO: + tgt.setValue(ConceptMapEquivalence.DISJOINT); + break; + default: + tgt.setValue(ConceptMapEquivalence.NULL); + break; + } + } } return tgt; } public static Enumeration convertConceptMapRelationship(org.hl7.fhir.dstu2.model.Enumeration src, org.hl7.fhir.r5.model.ConceptMap.TargetElementComponent tgtCtxt) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - Enumeration tgt = new Enumeration(new Enumerations.ConceptMapRelationshipEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - ToolingExtensions.setCodeExtensionMod(tgtCtxt, VersionConvertorConstants.EXT_OLD_CONCEPTMAP_EQUIVALENCE, src.getValueAsString()); - switch (src.getValue()) { - case EQUIVALENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.EQUIVALENT); - break; - case EQUAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.EQUIVALENT); - break; - case WIDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.SOURCEISNARROWERTHANTARGET); - break; - case SUBSUMES: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.SOURCEISNARROWERTHANTARGET); - break; - case NARROWER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.SOURCEISBROADERTHANTARGET); - break; - case SPECIALIZES: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.SOURCEISBROADERTHANTARGET); - break; - case INEXACT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.RELATEDTO); - break; - case UNMATCHED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NULL); - break; - case DISJOINT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NOTRELATEDTO); - break; - default: - tgt.setValue(null); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration(new Enumerations.ConceptMapRelationshipEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + ToolingExtensions.setCodeExtensionMod(tgtCtxt, VersionConvertorConstants.EXT_OLD_CONCEPTMAP_EQUIVALENCE, src.getValueAsString()); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUIVALENT: + tgt.setValue(ConceptMapRelationship.EQUIVALENT); + break; + case EQUAL: + tgt.setValue(ConceptMapRelationship.EQUIVALENT); + break; + case WIDER: + tgt.setValue(ConceptMapRelationship.SOURCEISNARROWERTHANTARGET); + break; + case SUBSUMES: + tgt.setValue(ConceptMapRelationship.SOURCEISNARROWERTHANTARGET); + break; + case NARROWER: + tgt.setValue(ConceptMapRelationship.SOURCEISBROADERTHANTARGET); + break; + case SPECIALIZES: + tgt.setValue(ConceptMapRelationship.SOURCEISBROADERTHANTARGET); + break; + case INEXACT: + tgt.setValue(ConceptMapRelationship.RELATEDTO); + break; + case UNMATCHED: + tgt.setValue(ConceptMapRelationship.NULL); + break; + case DISJOINT: + tgt.setValue(ConceptMapRelationship.NOTRELATEDTO); + break; + default: + tgt.setValue(null); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2.model.ConceptMap.OtherElementComponent convertOtherElementComponent(org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent src, org.hl7.fhir.r5.model.ConceptMap srcMap) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Conformance10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Conformance10_50.java index f313c496f3..4728ef7c3c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Conformance10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Conformance10_50.java @@ -13,10 +13,14 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.String10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.UnsignedInt10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.Uri10_50; +import org.hl7.fhir.dstu2.model.Conformance; +import org.hl7.fhir.dstu2.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.CapabilityStatement; import org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestComponent; import org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent; import org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction; +import org.hl7.fhir.r5.model.Enumerations; public class Conformance10_50 { @@ -27,47 +31,55 @@ public class Conformance10_50 { }; static public org.hl7.fhir.dstu2.model.Enumeration convertConditionalDeleteStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Conformance.ConditionalDeleteStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ConditionalDeleteStatus.NOTSUPPORTED); - break; - case SINGLE: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ConditionalDeleteStatus.SINGLE); - break; - case MULTIPLE: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ConditionalDeleteStatus.MULTIPLE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ConditionalDeleteStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Conformance.ConditionalDeleteStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTSUPPORTED: + tgt.setValue(Conformance.ConditionalDeleteStatus.NOTSUPPORTED); + break; + case SINGLE: + tgt.setValue(Conformance.ConditionalDeleteStatus.SINGLE); + break; + case MULTIPLE: + tgt.setValue(Conformance.ConditionalDeleteStatus.MULTIPLE); + break; + default: + tgt.setValue(Conformance.ConditionalDeleteStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertConditionalDeleteStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus.NOTSUPPORTED); - break; - case SINGLE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus.SINGLE); - break; - case MULTIPLE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus.MULTIPLE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new CapabilityStatement.ConditionalDeleteStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTSUPPORTED: + tgt.setValue(CapabilityStatement.ConditionalDeleteStatus.NOTSUPPORTED); + break; + case SINGLE: + tgt.setValue(CapabilityStatement.ConditionalDeleteStatus.SINGLE); + break; + case MULTIPLE: + tgt.setValue(CapabilityStatement.ConditionalDeleteStatus.MULTIPLE); + break; + default: + tgt.setValue(CapabilityStatement.ConditionalDeleteStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2.model.Conformance convertConformance(org.hl7.fhir.r5.model.CapabilityStatement src) throws FHIRException { @@ -575,85 +587,101 @@ public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementSoftw } static public org.hl7.fhir.dstu2.model.Enumeration convertConformanceStatementKind(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Conformance.ConformanceStatementKindEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ConformanceStatementKind.INSTANCE); - break; - case CAPABILITY: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ConformanceStatementKind.CAPABILITY); - break; - case REQUIREMENTS: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ConformanceStatementKind.REQUIREMENTS); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ConformanceStatementKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Conformance.ConformanceStatementKindEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(Conformance.ConformanceStatementKind.INSTANCE); + break; + case CAPABILITY: + tgt.setValue(Conformance.ConformanceStatementKind.CAPABILITY); + break; + case REQUIREMENTS: + tgt.setValue(Conformance.ConformanceStatementKind.REQUIREMENTS); + break; + default: + tgt.setValue(Conformance.ConformanceStatementKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertConformanceStatementKind(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKindEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.INSTANCE); - break; - case CAPABILITY: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.CAPABILITY); - break; - case REQUIREMENTS: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.REQUIREMENTS); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new Enumerations.CapabilityStatementKindEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(Enumerations.CapabilityStatementKind.INSTANCE); + break; + case CAPABILITY: + tgt.setValue(Enumerations.CapabilityStatementKind.CAPABILITY); + break; + case REQUIREMENTS: + tgt.setValue(Enumerations.CapabilityStatementKind.REQUIREMENTS); + break; + default: + tgt.setValue(Enumerations.CapabilityStatementKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertDocumentMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Conformance.DocumentModeEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case PRODUCER: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.DocumentMode.PRODUCER); - break; - case CONSUMER: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.DocumentMode.CONSUMER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.DocumentMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Conformance.DocumentModeEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRODUCER: + tgt.setValue(Conformance.DocumentMode.PRODUCER); + break; + case CONSUMER: + tgt.setValue(Conformance.DocumentMode.CONSUMER); + break; + default: + tgt.setValue(Conformance.DocumentMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertDocumentMode(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.DocumentModeEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case PRODUCER: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.DocumentMode.PRODUCER); - break; - case CONSUMER: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.DocumentMode.CONSUMER); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.DocumentMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new CapabilityStatement.DocumentModeEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRODUCER: + tgt.setValue(CapabilityStatement.DocumentMode.PRODUCER); + break; + case CONSUMER: + tgt.setValue(CapabilityStatement.DocumentMode.CONSUMER); + break; + default: + tgt.setValue(CapabilityStatement.DocumentMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.CapabilityStatement.ResourceInteractionComponent convertResourceInteractionComponent(org.hl7.fhir.dstu2.model.Conformance.ResourceInteractionComponent src) throws FHIRException { @@ -681,85 +709,101 @@ public static org.hl7.fhir.dstu2.model.Conformance.ResourceInteractionComponent } static public org.hl7.fhir.r5.model.Enumeration convertResourceVersionPolicy(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicyEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case NOVERSION: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy.NOVERSION); - break; - case VERSIONED: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy.VERSIONED); - break; - case VERSIONEDUPDATE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy.VERSIONEDUPDATE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new CapabilityStatement.ResourceVersionPolicyEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOVERSION: + tgt.setValue(CapabilityStatement.ResourceVersionPolicy.NOVERSION); + break; + case VERSIONED: + tgt.setValue(CapabilityStatement.ResourceVersionPolicy.VERSIONED); + break; + case VERSIONEDUPDATE: + tgt.setValue(CapabilityStatement.ResourceVersionPolicy.VERSIONEDUPDATE); + break; + default: + tgt.setValue(CapabilityStatement.ResourceVersionPolicy.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertResourceVersionPolicy(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Conformance.ResourceVersionPolicyEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case NOVERSION: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ResourceVersionPolicy.NOVERSION); - break; - case VERSIONED: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ResourceVersionPolicy.VERSIONED); - break; - case VERSIONEDUPDATE: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ResourceVersionPolicy.VERSIONEDUPDATE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ResourceVersionPolicy.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Conformance.ResourceVersionPolicyEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOVERSION: + tgt.setValue(Conformance.ResourceVersionPolicy.NOVERSION); + break; + case VERSIONED: + tgt.setValue(Conformance.ResourceVersionPolicy.VERSIONED); + break; + case VERSIONEDUPDATE: + tgt.setValue(Conformance.ResourceVersionPolicy.VERSIONEDUPDATE); + break; + default: + tgt.setValue(Conformance.ResourceVersionPolicy.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertRestfulConformanceMode(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.RestfulCapabilityModeEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case CLIENT: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.RestfulCapabilityMode.CLIENT); - break; - case SERVER: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.RestfulCapabilityMode.SERVER); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.RestfulCapabilityMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new CapabilityStatement.RestfulCapabilityModeEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CLIENT: + tgt.setValue(CapabilityStatement.RestfulCapabilityMode.CLIENT); + break; + case SERVER: + tgt.setValue(CapabilityStatement.RestfulCapabilityMode.SERVER); + break; + default: + tgt.setValue(CapabilityStatement.RestfulCapabilityMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertRestfulConformanceMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Conformance.RestfulConformanceModeEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case CLIENT: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.RestfulConformanceMode.CLIENT); - break; - case SERVER: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.RestfulConformanceMode.SERVER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.RestfulConformanceMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Conformance.RestfulConformanceModeEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CLIENT: + tgt.setValue(Conformance.RestfulConformanceMode.CLIENT); + break; + case SERVER: + tgt.setValue(Conformance.RestfulConformanceMode.SERVER); + break; + default: + tgt.setValue(Conformance.RestfulConformanceMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2.model.Conformance.SystemInteractionComponent convertSystemInteractionComponent(org.hl7.fhir.r5.model.CapabilityStatement.SystemInteractionComponent src) throws FHIRException { @@ -787,121 +831,137 @@ public static org.hl7.fhir.r5.model.CapabilityStatement.SystemInteractionCompone } static public org.hl7.fhir.r5.model.Enumeration convertSystemRestfulInteraction(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteractionEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case TRANSACTION: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.TRANSACTION); - break; - case SEARCHSYSTEM: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.SEARCHSYSTEM); - break; - case HISTORYSYSTEM: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.HISTORYSYSTEM); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new CapabilityStatement.SystemRestfulInteractionEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case TRANSACTION: + tgt.setValue(SystemRestfulInteraction.TRANSACTION); + break; + case SEARCHSYSTEM: + tgt.setValue(SystemRestfulInteraction.SEARCHSYSTEM); + break; + case HISTORYSYSTEM: + tgt.setValue(SystemRestfulInteraction.HISTORYSYSTEM); + break; + default: + tgt.setValue(SystemRestfulInteraction.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertSystemRestfulInteraction(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Conformance.SystemRestfulInteractionEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case TRANSACTION: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.SystemRestfulInteraction.TRANSACTION); - break; - case SEARCHSYSTEM: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.SystemRestfulInteraction.SEARCHSYSTEM); - break; - case HISTORYSYSTEM: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.SystemRestfulInteraction.HISTORYSYSTEM); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.SystemRestfulInteraction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Conformance.SystemRestfulInteractionEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case TRANSACTION: + tgt.setValue(Conformance.SystemRestfulInteraction.TRANSACTION); + break; + case SEARCHSYSTEM: + tgt.setValue(Conformance.SystemRestfulInteraction.SEARCHSYSTEM); + break; + case HISTORYSYSTEM: + tgt.setValue(Conformance.SystemRestfulInteraction.HISTORYSYSTEM); + break; + default: + tgt.setValue(Conformance.SystemRestfulInteraction.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertTypeRestfulInteraction(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Conformance.TypeRestfulInteractionEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case READ: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.TypeRestfulInteraction.READ); - break; - case VREAD: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.TypeRestfulInteraction.VREAD); - break; - case UPDATE: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.TypeRestfulInteraction.UPDATE); - break; - case DELETE: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.TypeRestfulInteraction.DELETE); - break; - case HISTORYINSTANCE: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.TypeRestfulInteraction.HISTORYINSTANCE); - break; - case HISTORYTYPE: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.TypeRestfulInteraction.HISTORYTYPE); - break; - case CREATE: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.TypeRestfulInteraction.CREATE); - break; - case SEARCHTYPE: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.TypeRestfulInteraction.SEARCHTYPE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.TypeRestfulInteraction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Conformance.TypeRestfulInteractionEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case READ: + tgt.setValue(Conformance.TypeRestfulInteraction.READ); + break; + case VREAD: + tgt.setValue(Conformance.TypeRestfulInteraction.VREAD); + break; + case UPDATE: + tgt.setValue(Conformance.TypeRestfulInteraction.UPDATE); + break; + case DELETE: + tgt.setValue(Conformance.TypeRestfulInteraction.DELETE); + break; + case HISTORYINSTANCE: + tgt.setValue(Conformance.TypeRestfulInteraction.HISTORYINSTANCE); + break; + case HISTORYTYPE: + tgt.setValue(Conformance.TypeRestfulInteraction.HISTORYTYPE); + break; + case CREATE: + tgt.setValue(Conformance.TypeRestfulInteraction.CREATE); + break; + case SEARCHTYPE: + tgt.setValue(Conformance.TypeRestfulInteraction.SEARCHTYPE); + break; + default: + tgt.setValue(Conformance.TypeRestfulInteraction.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertTypeRestfulInteraction(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteractionEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case READ: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.READ); - break; - case VREAD: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.VREAD); - break; - case UPDATE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.UPDATE); - break; - case DELETE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.DELETE); - break; - case HISTORYINSTANCE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.HISTORYINSTANCE); - break; - case HISTORYTYPE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.HISTORYTYPE); - break; - case CREATE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.CREATE); - break; - case SEARCHTYPE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.SEARCHTYPE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new CapabilityStatement.TypeRestfulInteractionEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case READ: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.READ); + break; + case VREAD: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.VREAD); + break; + case UPDATE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.UPDATE); + break; + case DELETE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.DELETE); + break; + case HISTORYINSTANCE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.HISTORYINSTANCE); + break; + case HISTORYTYPE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.HISTORYTYPE); + break; + case CREATE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.CREATE); + break; + case SEARCHTYPE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.SEARCHTYPE); + break; + default: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertConformanceEventMode(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { @@ -909,20 +969,20 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityModeEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityMode.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case SENDER: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityMode.SENDER); - break; - case RECEIVER: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityMode.RECEIVER); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityMode.NULL); - break; - } - } + tgt.setValue(CapabilityStatement.EventCapabilityMode.SENDER); + break; + case RECEIVER: + tgt.setValue(CapabilityStatement.EventCapabilityMode.RECEIVER); + break; + default: + tgt.setValue(CapabilityStatement.EventCapabilityMode.NULL); + break; + } +} return tgt; } @@ -931,20 +991,20 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Conformance.ConformanceEventModeEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ConformanceEventMode.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case SENDER: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ConformanceEventMode.SENDER); - break; - case RECEIVER: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ConformanceEventMode.RECEIVER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Conformance.ConformanceEventMode.NULL); - break; - } - } + tgt.setValue(Conformance.ConformanceEventMode.SENDER); + break; + case RECEIVER: + tgt.setValue(Conformance.ConformanceEventMode.RECEIVER); + break; + default: + tgt.setValue(Conformance.ConformanceEventMode.NULL); + break; + } +} return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/DetectedIssue10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/DetectedIssue10_50.java index bd4e9ea6ed..1a3c3a5de4 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/DetectedIssue10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/DetectedIssue10_50.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.String10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.Uri10_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.DetectedIssue; +import org.hl7.fhir.r5.model.Enumeration; public class DetectedIssue10_50 { @@ -95,46 +97,54 @@ public static org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueMitigationCompone } static public org.hl7.fhir.r5.model.Enumeration convertDetectedIssueSeverity(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverityEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case HIGH: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity.HIGH); - break; - case MODERATE: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity.MODERATE); - break; - case LOW: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity.LOW); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DetectedIssue.DetectedIssueSeverityEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case HIGH: + tgt.setValue(DetectedIssue.DetectedIssueSeverity.HIGH); + break; + case MODERATE: + tgt.setValue(DetectedIssue.DetectedIssueSeverity.MODERATE); + break; + case LOW: + tgt.setValue(DetectedIssue.DetectedIssueSeverity.LOW); + break; + default: + tgt.setValue(DetectedIssue.DetectedIssueSeverity.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertDetectedIssueSeverity(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueSeverityEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case HIGH: - tgt.setValue(org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueSeverity.HIGH); - break; - case MODERATE: - tgt.setValue(org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueSeverity.MODERATE); - break; - case LOW: - tgt.setValue(org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueSeverity.LOW); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueSeverity.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueSeverityEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case HIGH: + tgt.setValue(org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueSeverity.HIGH); + break; + case MODERATE: + tgt.setValue(org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueSeverity.MODERATE); + break; + case LOW: + tgt.setValue(org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueSeverity.LOW); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueSeverity.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/DeviceMetric10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/DeviceMetric10_50.java index 56b30e3a0e..77a48c51bd 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/DeviceMetric10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/DeviceMetric10_50.java @@ -5,6 +5,8 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.complextypes10_50.CodeableConcept10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.complextypes10_50.Identifier10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.Instant10_50; +import org.hl7.fhir.dstu2.model.DeviceMetric; +import org.hl7.fhir.dstu2.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; public class DeviceMetric10_50 { @@ -94,153 +96,177 @@ public static org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationCompo } static public org.hl7.fhir.dstu2.model.Enumeration convertDeviceMetricCalibrationState(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationStateEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case NOTCALIBRATED: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState.NOTCALIBRATED); - break; - case CALIBRATIONREQUIRED: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATIONREQUIRED); - break; - case CALIBRATED: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATED); - break; - case UNSPECIFIED: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState.UNSPECIFIED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DeviceMetric.DeviceMetricCalibrationStateEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTCALIBRATED: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationState.NOTCALIBRATED); + break; + case CALIBRATIONREQUIRED: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationState.CALIBRATIONREQUIRED); + break; + case CALIBRATED: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationState.CALIBRATED); + break; + case UNSPECIFIED: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationState.UNSPECIFIED); + break; + default: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationState.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertDeviceMetricCalibrationState(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationStateEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case NOTCALIBRATED: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState.NOTCALIBRATED); - break; - case CALIBRATIONREQUIRED: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATIONREQUIRED); - break; - case CALIBRATED: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATED); - break; - case UNSPECIFIED: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState.UNSPECIFIED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationStateEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTCALIBRATED: + tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState.NOTCALIBRATED); + break; + case CALIBRATIONREQUIRED: + tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATIONREQUIRED); + break; + case CALIBRATED: + tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATED); + break; + case UNSPECIFIED: + tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState.UNSPECIFIED); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertDeviceMetricCalibrationType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationTypeEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case UNSPECIFIED: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType.UNSPECIFIED); - break; - case OFFSET: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType.OFFSET); - break; - case GAIN: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType.GAIN); - break; - case TWOPOINT: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType.TWOPOINT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DeviceMetric.DeviceMetricCalibrationTypeEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case UNSPECIFIED: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationType.UNSPECIFIED); + break; + case OFFSET: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationType.OFFSET); + break; + case GAIN: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationType.GAIN); + break; + case TWOPOINT: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationType.TWOPOINT); + break; + default: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertDeviceMetricCalibrationType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationTypeEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case UNSPECIFIED: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType.UNSPECIFIED); - break; - case OFFSET: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType.OFFSET); - break; - case GAIN: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType.GAIN); - break; - case TWOPOINT: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType.TWOPOINT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationTypeEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case UNSPECIFIED: + tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType.UNSPECIFIED); + break; + case OFFSET: + tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType.OFFSET); + break; + case GAIN: + tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType.GAIN); + break; + case TWOPOINT: + tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType.TWOPOINT); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertDeviceMetricCategory(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategoryEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case MEASUREMENT: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory.MEASUREMENT); - break; - case SETTING: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory.SETTING); - break; - case CALCULATION: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory.CALCULATION); - break; - case UNSPECIFIED: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory.UNSPECIFIED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategoryEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MEASUREMENT: + tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory.MEASUREMENT); + break; + case SETTING: + tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory.SETTING); + break; + case CALCULATION: + tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory.CALCULATION); + break; + case UNSPECIFIED: + tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory.UNSPECIFIED); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertDeviceMetricCategory(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategoryEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case MEASUREMENT: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory.MEASUREMENT); - break; - case SETTING: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory.SETTING); - break; - case CALCULATION: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory.CALCULATION); - break; - case UNSPECIFIED: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory.UNSPECIFIED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DeviceMetric.DeviceMetricCategoryEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MEASUREMENT: + tgt.setValue(DeviceMetric.DeviceMetricCategory.MEASUREMENT); + break; + case SETTING: + tgt.setValue(DeviceMetric.DeviceMetricCategory.SETTING); + break; + case CALCULATION: + tgt.setValue(DeviceMetric.DeviceMetricCategory.CALCULATION); + break; + case UNSPECIFIED: + tgt.setValue(DeviceMetric.DeviceMetricCategory.UNSPECIFIED); + break; + default: + tgt.setValue(DeviceMetric.DeviceMetricCategory.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.CodeType convertDeviceMetricColor(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { @@ -290,46 +316,54 @@ static public org.hl7.fhir.dstu2.model.Enumeration convertDeviceMetricOperationalStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case ON: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatus.ON); - break; - case OFF: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatus.OFF); - break; - case STANDBY: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatus.STANDBY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DeviceMetric.DeviceMetricOperationalStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ON: + tgt.setValue(DeviceMetric.DeviceMetricOperationalStatus.ON); + break; + case OFF: + tgt.setValue(DeviceMetric.DeviceMetricOperationalStatus.OFF); + break; + case STANDBY: + tgt.setValue(DeviceMetric.DeviceMetricOperationalStatus.STANDBY); + break; + default: + tgt.setValue(DeviceMetric.DeviceMetricOperationalStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertDeviceMetricOperationalStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case ON: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus.ON); - break; - case OFF: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus.OFF); - break; - case STANDBY: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus.STANDBY); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ON: + tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus.ON); + break; + case OFF: + tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus.OFF); + break; + case STANDBY: + tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus.STANDBY); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/DiagnosticReport10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/DiagnosticReport10_50.java index 6ede38b485..87cac439f9 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/DiagnosticReport10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/DiagnosticReport10_50.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.Instant10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.String10_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.DiagnosticReport; +import org.hl7.fhir.r5.model.Enumeration; public class DiagnosticReport10_50 { @@ -104,70 +106,78 @@ public static org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportImageCom } static public org.hl7.fhir.r5.model.Enumeration convertDiagnosticReportStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.REGISTERED); - break; - case PARTIAL: - tgt.setValue(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.PARTIAL); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.FINAL); - break; - case CORRECTED: - tgt.setValue(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.CORRECTED); - break; - case APPENDED: - tgt.setValue(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.APPENDED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DiagnosticReport.DiagnosticReportStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.REGISTERED); + break; + case PARTIAL: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.PARTIAL); + break; + case FINAL: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.FINAL); + break; + case CORRECTED: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.CORRECTED); + break; + case APPENDED: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.APPENDED); + break; + case CANCELLED: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertDiagnosticReportStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.REGISTERED); - break; - case PARTIAL: - tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.PARTIAL); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.FINAL); - break; - case CORRECTED: - tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.CORRECTED); - break; - case APPENDED: - tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.APPENDED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.REGISTERED); + break; + case PARTIAL: + tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.PARTIAL); + break; + case FINAL: + tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.FINAL); + break; + case CORRECTED: + tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.CORRECTED); + break; + case APPENDED: + tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.APPENDED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.DiagnosticReport.DiagnosticReportStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/DocumentReference10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/DocumentReference10_50.java index f9ce186c4b..64dfdf513e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/DocumentReference10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/DocumentReference10_50.java @@ -9,10 +9,13 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.MarkDown10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.String10_50; import org.hl7.fhir.dstu2.model.CodeableConcept; +import org.hl7.fhir.dstu2.model.Enumerations; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; import org.hl7.fhir.r5.model.Coding; +import org.hl7.fhir.r5.model.DocumentReference; import org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceAttesterComponent; +import org.hl7.fhir.r5.model.Enumeration; public class DocumentReference10_50 { @@ -227,72 +230,84 @@ public static org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceRelatesTo } static public org.hl7.fhir.r5.model.Enumeration convertDocumentReferenceStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case CURRENT: - tgt.setValue(org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceStatus.CURRENT); - break; - case SUPERSEDED: - tgt.setValue(org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceStatus.SUPERSEDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DocumentReference.DocumentReferenceStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CURRENT: + tgt.setValue(DocumentReference.DocumentReferenceStatus.CURRENT); + break; + case SUPERSEDED: + tgt.setValue(DocumentReference.DocumentReferenceStatus.SUPERSEDED); + break; + case ENTEREDINERROR: + tgt.setValue(DocumentReference.DocumentReferenceStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(DocumentReference.DocumentReferenceStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertDocumentReferenceStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case CURRENT: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatus.CURRENT); - break; - case SUPERSEDED: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatus.SUPERSEDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new Enumerations.DocumentReferenceStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CURRENT: + tgt.setValue(Enumerations.DocumentReferenceStatus.CURRENT); + break; + case SUPERSEDED: + tgt.setValue(Enumerations.DocumentReferenceStatus.SUPERSEDED); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.DocumentReferenceStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Enumerations.DocumentReferenceStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.CodeableConcept convertDocumentRelationshipType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.CodeableConcept tgt = new org.hl7.fhir.r5.model.CodeableConcept(); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case REPLACES: - tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("replaces"); - break; - case TRANSFORMS: - tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("transforms"); - break; - case SIGNS: - tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("signs"); - break; - case APPENDS: - tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("appends"); - break; - default: - break; - } + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.CodeableConcept tgt = new org.hl7.fhir.r5.model.CodeableConcept(); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + // Add nothing + } else { + switch (src.getValue()) { + case REPLACES: + tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("replaces"); + break; + case TRANSFORMS: + tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("transforms"); + break; + case SIGNS: + tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("signs"); + break; + case APPENDS: + tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("appends"); + break; + default: + break; + } + } - return tgt; + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertDocumentRelationshipType(org.hl7.fhir.r5.model.CodeableConcept src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Encounter10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Encounter10_50.java index 2dbfc59f61..493a7713c6 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Encounter10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Encounter10_50.java @@ -8,7 +8,10 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.complextypes10_50.Period10_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Encounter; import org.hl7.fhir.r5.model.Encounter.ReasonComponent; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; public class Encounter10_50 { @@ -226,53 +229,61 @@ public static org.hl7.fhir.dstu2.model.Encounter.EncounterLocationComponent conv } static public org.hl7.fhir.r5.model.Enumeration convertEncounterLocationStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Encounter.EncounterLocationStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.PLANNED); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.ACTIVE); - break; - case RESERVED: - tgt.setValue(org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.RESERVED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.COMPLETED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Encounter.EncounterLocationStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(Encounter.EncounterLocationStatus.PLANNED); + break; + case ACTIVE: + tgt.setValue(Encounter.EncounterLocationStatus.ACTIVE); + break; + case RESERVED: + tgt.setValue(Encounter.EncounterLocationStatus.RESERVED); + break; + case COMPLETED: + tgt.setValue(Encounter.EncounterLocationStatus.COMPLETED); + break; + default: + tgt.setValue(Encounter.EncounterLocationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertEncounterLocationStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Encounter.EncounterLocationStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterLocationStatus.PLANNED); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterLocationStatus.ACTIVE); - break; - case RESERVED: - tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterLocationStatus.RESERVED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterLocationStatus.COMPLETED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterLocationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Encounter.EncounterLocationStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterLocationStatus.PLANNED); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterLocationStatus.ACTIVE); + break; + case RESERVED: + tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterLocationStatus.RESERVED); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterLocationStatus.COMPLETED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterLocationStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Encounter.EncounterParticipantComponent convertEncounterParticipantComponent(org.hl7.fhir.dstu2.model.Encounter.EncounterParticipantComponent src) throws FHIRException { @@ -304,58 +315,66 @@ public static org.hl7.fhir.dstu2.model.Encounter.EncounterParticipantComponent c } static public org.hl7.fhir.dstu2.model.Enumeration convertEncounterState(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Encounter.EncounterStateEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterState.PLANNED); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterState.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterState.FINISHED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterState.CANCELLED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterState.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Encounter.EncounterStateEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterState.PLANNED); + break; + case INPROGRESS: + tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterState.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterState.FINISHED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterState.CANCELLED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Encounter.EncounterState.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertEncounterState(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.EncounterStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EncounterStatus.PLANNED); - break; - case ARRIVED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EncounterStatus.INPROGRESS); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EncounterStatus.INPROGRESS); - break; - case ONLEAVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EncounterStatus.INPROGRESS); - break; - case FINISHED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EncounterStatus.COMPLETED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EncounterStatus.CANCELLED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EncounterStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.EncounterStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(Enumerations.EncounterStatus.PLANNED); + break; + case ARRIVED: + tgt.setValue(Enumerations.EncounterStatus.INPROGRESS); + break; + case INPROGRESS: + tgt.setValue(Enumerations.EncounterStatus.INPROGRESS); + break; + case ONLEAVE: + tgt.setValue(Enumerations.EncounterStatus.INPROGRESS); + break; + case FINISHED: + tgt.setValue(Enumerations.EncounterStatus.COMPLETED); + break; + case CANCELLED: + tgt.setValue(Enumerations.EncounterStatus.CANCELLED); + break; + default: + tgt.setValue(Enumerations.EncounterStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Enumerations10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Enumerations10_50.java index 30cacaf3c1..a534bf7bef 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Enumerations10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Enumerations10_50.java @@ -2,6 +2,7 @@ import org.hl7.fhir.convertors.context.ConversionContext10_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumerations; public class Enumerations10_50 { static public org.hl7.fhir.r5.model.Enumeration convertBindingStrength(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { @@ -9,26 +10,26 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.BindingStrengthEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.BindingStrength.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case REQUIRED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.BindingStrength.REQUIRED); - break; - case EXTENSIBLE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.BindingStrength.EXTENSIBLE); - break; - case PREFERRED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.BindingStrength.PREFERRED); - break; - case EXAMPLE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.BindingStrength.EXAMPLE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.BindingStrength.NULL); - break; - } - } + tgt.setValue(Enumerations.BindingStrength.REQUIRED); + break; + case EXTENSIBLE: + tgt.setValue(Enumerations.BindingStrength.EXTENSIBLE); + break; + case PREFERRED: + tgt.setValue(Enumerations.BindingStrength.PREFERRED); + break; + case EXAMPLE: + tgt.setValue(Enumerations.BindingStrength.EXAMPLE); + break; + default: + tgt.setValue(Enumerations.BindingStrength.NULL); + break; + } +} return tgt; } @@ -37,26 +38,26 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Enumerations.BindingStrengthEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case REQUIRED: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.REQUIRED); - break; - case EXTENSIBLE: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.EXTENSIBLE); - break; - case PREFERRED: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.PREFERRED); - break; - case EXAMPLE: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.EXAMPLE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.REQUIRED); + break; + case EXTENSIBLE: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.EXTENSIBLE); + break; + case PREFERRED: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.PREFERRED); + break; + case EXAMPLE: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.EXAMPLE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.NULL); + break; + } +} return tgt; } @@ -65,26 +66,26 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.AdministrativeGenderEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case MALE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.MALE); - break; - case FEMALE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.FEMALE); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.OTHER); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.NULL); - break; - } - } + tgt.setValue(Enumerations.AdministrativeGender.MALE); + break; + case FEMALE: + tgt.setValue(Enumerations.AdministrativeGender.FEMALE); + break; + case OTHER: + tgt.setValue(Enumerations.AdministrativeGender.OTHER); + break; + case UNKNOWN: + tgt.setValue(Enumerations.AdministrativeGender.UNKNOWN); + break; + default: + tgt.setValue(Enumerations.AdministrativeGender.NULL); + break; + } +} return tgt; } @@ -93,26 +94,26 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGenderEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case MALE: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender.MALE); - break; - case FEMALE: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender.FEMALE); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender.OTHER); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender.MALE); + break; + case FEMALE: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender.FEMALE); + break; + case OTHER: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender.OTHER); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender.NULL); + break; + } +} return tgt; } @@ -121,38 +122,38 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.SearchParamTypeEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case NUMBER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.NUMBER); - break; - case DATE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.DATE); - break; - case STRING: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.STRING); - break; - case TOKEN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.TOKEN); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.REFERENCE); - break; - case COMPOSITE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.COMPOSITE); - break; - case QUANTITY: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.QUANTITY); - break; - case URI: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.URI); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.NULL); - break; - } - } + tgt.setValue(Enumerations.SearchParamType.NUMBER); + break; + case DATE: + tgt.setValue(Enumerations.SearchParamType.DATE); + break; + case STRING: + tgt.setValue(Enumerations.SearchParamType.STRING); + break; + case TOKEN: + tgt.setValue(Enumerations.SearchParamType.TOKEN); + break; + case REFERENCE: + tgt.setValue(Enumerations.SearchParamType.REFERENCE); + break; + case COMPOSITE: + tgt.setValue(Enumerations.SearchParamType.COMPOSITE); + break; + case QUANTITY: + tgt.setValue(Enumerations.SearchParamType.QUANTITY); + break; + case URI: + tgt.setValue(Enumerations.SearchParamType.URI); + break; + default: + tgt.setValue(Enumerations.SearchParamType.NULL); + break; + } +} return tgt; } @@ -161,38 +162,38 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Enumerations.SearchParamTypeEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case NUMBER: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.NUMBER); - break; - case DATE: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.DATE); - break; - case STRING: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.STRING); - break; - case TOKEN: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.TOKEN); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.REFERENCE); - break; - case COMPOSITE: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.COMPOSITE); - break; - case QUANTITY: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.QUANTITY); - break; - case URI: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.URI); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.NUMBER); + break; + case DATE: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.DATE); + break; + case STRING: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.STRING); + break; + case TOKEN: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.TOKEN); + break; + case REFERENCE: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.REFERENCE); + break; + case COMPOSITE: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.COMPOSITE); + break; + case QUANTITY: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.QUANTITY); + break; + case URI: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.URI); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.NULL); + break; + } +} return tgt; } @@ -201,23 +202,23 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.PublicationStatusEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.ACTIVE); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.RETIRED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.NULL); - break; - } - } + tgt.setValue(Enumerations.PublicationStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(Enumerations.PublicationStatus.ACTIVE); + break; + case RETIRED: + tgt.setValue(Enumerations.PublicationStatus.RETIRED); + break; + default: + tgt.setValue(Enumerations.PublicationStatus.NULL); + break; + } +} return tgt; } @@ -226,23 +227,23 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatusEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case DRAFT: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatus.ACTIVE); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatus.RETIRED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatus.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatus.ACTIVE); + break; + case RETIRED: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatus.RETIRED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatus.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/EpisodeOfCare10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/EpisodeOfCare10_50.java index a08d08e9e9..d2aed54327 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/EpisodeOfCare10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/EpisodeOfCare10_50.java @@ -6,6 +6,8 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.complextypes10_50.Identifier10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.complextypes10_50.Period10_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.EpisodeOfCare; public class EpisodeOfCare10_50 { @@ -62,65 +64,73 @@ public static org.hl7.fhir.r5.model.EpisodeOfCare convertEpisodeOfCare(org.hl7.f } static public org.hl7.fhir.r5.model.Enumeration convertEpisodeOfCareStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.PLANNED); - break; - case WAITLIST: - tgt.setValue(org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.WAITLIST); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.ONHOLD); - break; - case FINISHED: - tgt.setValue(org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.FINISHED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.CANCELLED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new EpisodeOfCare.EpisodeOfCareStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.PLANNED); + break; + case WAITLIST: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.WAITLIST); + break; + case ACTIVE: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.ONHOLD); + break; + case FINISHED: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.FINISHED); + break; + case CANCELLED: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.CANCELLED); + break; + default: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertEpisodeOfCareStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatus.PLANNED); - break; - case WAITLIST: - tgt.setValue(org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatus.WAITLIST); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatus.ONHOLD); - break; - case FINISHED: - tgt.setValue(org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatus.FINISHED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatus.CANCELLED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatus.PLANNED); + break; + case WAITLIST: + tgt.setValue(org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatus.WAITLIST); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatus.ONHOLD); + break; + case FINISHED: + tgt.setValue(org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatus.FINISHED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatus.CANCELLED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent convertEpisodeOfCareStatusHistoryComponent(org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/FamilyMemberHistory10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/FamilyMemberHistory10_50.java index c602dd2223..5a8d1d5322 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/FamilyMemberHistory10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/FamilyMemberHistory10_50.java @@ -7,57 +7,67 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.DateTime10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.String10_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.FamilyMemberHistory; public class FamilyMemberHistory10_50 { static public org.hl7.fhir.r5.model.Enumeration convertFamilyHistoryStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case PARTIAL: - tgt.setValue(org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus.PARTIAL); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus.ENTEREDINERROR); - break; - case HEALTHUNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus.HEALTHUNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new FamilyMemberHistory.FamilyHistoryStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PARTIAL: + tgt.setValue(FamilyMemberHistory.FamilyHistoryStatus.PARTIAL); + break; + case COMPLETED: + tgt.setValue(FamilyMemberHistory.FamilyHistoryStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(FamilyMemberHistory.FamilyHistoryStatus.ENTEREDINERROR); + break; + case HEALTHUNKNOWN: + tgt.setValue(FamilyMemberHistory.FamilyHistoryStatus.HEALTHUNKNOWN); + break; + default: + tgt.setValue(FamilyMemberHistory.FamilyHistoryStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertFamilyHistoryStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyHistoryStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case PARTIAL: - tgt.setValue(org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyHistoryStatus.PARTIAL); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyHistoryStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyHistoryStatus.ENTEREDINERROR); - break; - case HEALTHUNKNOWN: - tgt.setValue(org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyHistoryStatus.HEALTHUNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyHistoryStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyHistoryStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PARTIAL: + tgt.setValue(org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyHistoryStatus.PARTIAL); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyHistoryStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyHistoryStatus.ENTEREDINERROR); + break; + case HEALTHUNKNOWN: + tgt.setValue(org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyHistoryStatus.HEALTHUNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.FamilyMemberHistory.FamilyHistoryStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.FamilyMemberHistory convertFamilyMemberHistory(org.hl7.fhir.dstu2.model.FamilyMemberHistory src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Flag10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Flag10_50.java index f132059aa8..8077f7817b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Flag10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Flag10_50.java @@ -5,6 +5,8 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.complextypes10_50.CodeableConcept10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.complextypes10_50.Identifier10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.complextypes10_50.Period10_50; +import org.hl7.fhir.dstu2.model.Enumeration; +import org.hl7.fhir.dstu2.model.Flag; import org.hl7.fhir.exceptions.FHIRException; public class Flag10_50 { @@ -58,46 +60,54 @@ public static org.hl7.fhir.dstu2.model.Flag convertFlag(org.hl7.fhir.r5.model.Fl } static public org.hl7.fhir.dstu2.model.Enumeration convertFlagStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Flag.FlagStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.Flag.FlagStatus.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.Flag.FlagStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.Flag.FlagStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Flag.FlagStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Flag.FlagStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Flag.FlagStatus.ACTIVE); + break; + case INACTIVE: + tgt.setValue(Flag.FlagStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(Flag.FlagStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Flag.FlagStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertFlagStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Flag.FlagStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Flag.FlagStatus.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Flag.FlagStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Flag.FlagStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Flag.FlagStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Flag.FlagStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.r5.model.Flag.FlagStatus.ACTIVE); + break; + case INACTIVE: + tgt.setValue(org.hl7.fhir.r5.model.Flag.FlagStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r5.model.Flag.FlagStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.Flag.FlagStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Group10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Group10_50.java index c5ba568f0c..09ac595153 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Group10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Group10_50.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.String10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.UnsignedInt10_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Group; import org.hl7.fhir.r5.model.Group.GroupMembershipBasis; public class Group10_50 { @@ -122,52 +124,60 @@ public static org.hl7.fhir.dstu2.model.Group.GroupMemberComponent convertGroupMe } static public org.hl7.fhir.r5.model.Enumeration convertGroupType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Group.GroupTypeEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case PERSON: - tgt.setValue(org.hl7.fhir.r5.model.Group.GroupType.PERSON); - break; - case ANIMAL: - tgt.setValue(org.hl7.fhir.r5.model.Group.GroupType.ANIMAL); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.r5.model.Group.GroupType.PRACTITIONER); - break; - case DEVICE: - tgt.setValue(org.hl7.fhir.r5.model.Group.GroupType.DEVICE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Group.GroupType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Group.GroupTypeEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PERSON: + tgt.setValue(Group.GroupType.PERSON); + break; + case ANIMAL: + tgt.setValue(Group.GroupType.ANIMAL); + break; + case PRACTITIONER: + tgt.setValue(Group.GroupType.PRACTITIONER); + break; + case DEVICE: + tgt.setValue(Group.GroupType.DEVICE); + break; + default: + tgt.setValue(Group.GroupType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertGroupType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Group.GroupTypeEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case PERSON: - tgt.setValue(org.hl7.fhir.dstu2.model.Group.GroupType.PERSON); - break; - case ANIMAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Group.GroupType.ANIMAL); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.dstu2.model.Group.GroupType.PRACTITIONER); - break; - case DEVICE: - tgt.setValue(org.hl7.fhir.dstu2.model.Group.GroupType.DEVICE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Group.GroupType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Group.GroupTypeEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PERSON: + tgt.setValue(org.hl7.fhir.dstu2.model.Group.GroupType.PERSON); + break; + case ANIMAL: + tgt.setValue(org.hl7.fhir.dstu2.model.Group.GroupType.ANIMAL); + break; + case PRACTITIONER: + tgt.setValue(org.hl7.fhir.dstu2.model.Group.GroupType.PRACTITIONER); + break; + case DEVICE: + tgt.setValue(org.hl7.fhir.dstu2.model.Group.GroupType.DEVICE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Group.GroupType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/HealthcareService10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/HealthcareService10_50.java index 827e34296e..e0cf933e43 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/HealthcareService10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/HealthcareService10_50.java @@ -8,77 +8,88 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.complextypes10_50.Identifier10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.Boolean10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.String10_50; +import org.hl7.fhir.dstu2.model.Enumeration; +import org.hl7.fhir.dstu2.model.HealthcareService; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumerations; import org.hl7.fhir.r5.model.ExtendedContactDetail; public class HealthcareService10_50 { static public org.hl7.fhir.dstu2.model.Enumeration convertDaysOfWeek(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.HealthcareService.DaysOfWeekEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case MON: - tgt.setValue(org.hl7.fhir.dstu2.model.HealthcareService.DaysOfWeek.MON); - break; - case TUE: - tgt.setValue(org.hl7.fhir.dstu2.model.HealthcareService.DaysOfWeek.TUE); - break; - case WED: - tgt.setValue(org.hl7.fhir.dstu2.model.HealthcareService.DaysOfWeek.WED); - break; - case THU: - tgt.setValue(org.hl7.fhir.dstu2.model.HealthcareService.DaysOfWeek.THU); - break; - case FRI: - tgt.setValue(org.hl7.fhir.dstu2.model.HealthcareService.DaysOfWeek.FRI); - break; - case SAT: - tgt.setValue(org.hl7.fhir.dstu2.model.HealthcareService.DaysOfWeek.SAT); - break; - case SUN: - tgt.setValue(org.hl7.fhir.dstu2.model.HealthcareService.DaysOfWeek.SUN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.HealthcareService.DaysOfWeek.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new HealthcareService.DaysOfWeekEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MON: + tgt.setValue(HealthcareService.DaysOfWeek.MON); + break; + case TUE: + tgt.setValue(HealthcareService.DaysOfWeek.TUE); + break; + case WED: + tgt.setValue(HealthcareService.DaysOfWeek.WED); + break; + case THU: + tgt.setValue(HealthcareService.DaysOfWeek.THU); + break; + case FRI: + tgt.setValue(HealthcareService.DaysOfWeek.FRI); + break; + case SAT: + tgt.setValue(HealthcareService.DaysOfWeek.SAT); + break; + case SUN: + tgt.setValue(HealthcareService.DaysOfWeek.SUN); + break; + default: + tgt.setValue(HealthcareService.DaysOfWeek.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertDaysOfWeek(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.DaysOfWeekEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case MON: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.MON); - break; - case TUE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.TUE); - break; - case WED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.WED); - break; - case THU: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.THU); - break; - case FRI: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.FRI); - break; - case SAT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.SAT); - break; - case SUN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.SUN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new Enumerations.DaysOfWeekEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MON: + tgt.setValue(Enumerations.DaysOfWeek.MON); + break; + case TUE: + tgt.setValue(Enumerations.DaysOfWeek.TUE); + break; + case WED: + tgt.setValue(Enumerations.DaysOfWeek.WED); + break; + case THU: + tgt.setValue(Enumerations.DaysOfWeek.THU); + break; + case FRI: + tgt.setValue(Enumerations.DaysOfWeek.FRI); + break; + case SAT: + tgt.setValue(Enumerations.DaysOfWeek.SAT); + break; + case SUN: + tgt.setValue(Enumerations.DaysOfWeek.SUN); + break; + default: + tgt.setValue(Enumerations.DaysOfWeek.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2.model.HealthcareService convertHealthcareService(org.hl7.fhir.r5.model.HealthcareService src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/List10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/List10_50.java index de685edc72..82a24afd43 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/List10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/List10_50.java @@ -8,7 +8,11 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.Boolean10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.DateTime10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.String10_50; +import org.hl7.fhir.dstu2.model.List_; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; +import org.hl7.fhir.r5.model.ListResource; public class List10_50 { @@ -107,91 +111,107 @@ public static org.hl7.fhir.r5.model.ListResource.ListResourceEntryComponent conv } static public org.hl7.fhir.r5.model.Enumeration convertListMode(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ListModeEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case WORKING: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ListMode.WORKING); - break; - case SNAPSHOT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ListMode.SNAPSHOT); - break; - case CHANGES: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ListMode.CHANGES); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ListMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ListModeEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case WORKING: + tgt.setValue(Enumerations.ListMode.WORKING); + break; + case SNAPSHOT: + tgt.setValue(Enumerations.ListMode.SNAPSHOT); + break; + case CHANGES: + tgt.setValue(Enumerations.ListMode.CHANGES); + break; + default: + tgt.setValue(Enumerations.ListMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertListMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.List_.ListModeEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case WORKING: - tgt.setValue(org.hl7.fhir.dstu2.model.List_.ListMode.WORKING); - break; - case SNAPSHOT: - tgt.setValue(org.hl7.fhir.dstu2.model.List_.ListMode.SNAPSHOT); - break; - case CHANGES: - tgt.setValue(org.hl7.fhir.dstu2.model.List_.ListMode.CHANGES); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.List_.ListMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new List_.ListModeEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case WORKING: + tgt.setValue(List_.ListMode.WORKING); + break; + case SNAPSHOT: + tgt.setValue(List_.ListMode.SNAPSHOT); + break; + case CHANGES: + tgt.setValue(List_.ListMode.CHANGES); + break; + default: + tgt.setValue(List_.ListMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertListStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ListResource.ListStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case CURRENT: - tgt.setValue(org.hl7.fhir.r5.model.ListResource.ListStatus.CURRENT); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.r5.model.ListResource.ListStatus.RETIRED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.ListResource.ListStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ListResource.ListStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ListResource.ListStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CURRENT: + tgt.setValue(ListResource.ListStatus.CURRENT); + break; + case RETIRED: + tgt.setValue(ListResource.ListStatus.RETIRED); + break; + case ENTEREDINERROR: + tgt.setValue(ListResource.ListStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(ListResource.ListStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertListStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.List_.ListStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case CURRENT: - tgt.setValue(org.hl7.fhir.dstu2.model.List_.ListStatus.CURRENT); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.dstu2.model.List_.ListStatus.RETIRED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.List_.ListStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.List_.ListStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new List_.ListStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CURRENT: + tgt.setValue(List_.ListStatus.CURRENT); + break; + case RETIRED: + tgt.setValue(List_.ListStatus.RETIRED); + break; + case ENTEREDINERROR: + tgt.setValue(List_.ListStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(List_.ListStatus.NULL); + break; + } + } + return tgt; } public static void copyBackboneElement(org.hl7.fhir.dstu2.model.BackboneElement src, org.hl7.fhir.r5.model.BackboneElement tgt) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Location10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Location10_50.java index 32fca2e8ca..166bc96ef3 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Location10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Location10_50.java @@ -10,7 +10,9 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.String10_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.ContactPoint; +import org.hl7.fhir.r5.model.Enumeration; import org.hl7.fhir.r5.model.ExtendedContactDetail; +import org.hl7.fhir.r5.model.Location; public class Location10_50 { @@ -80,41 +82,49 @@ public static org.hl7.fhir.r5.model.Location convertLocation(org.hl7.fhir.dstu2. } static public org.hl7.fhir.r5.model.Enumeration convertLocationMode(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Location.LocationModeEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.r5.model.Location.LocationMode.INSTANCE); - break; - case KIND: - tgt.setValue(org.hl7.fhir.r5.model.Location.LocationMode.KIND); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Location.LocationMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Location.LocationModeEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(Location.LocationMode.INSTANCE); + break; + case KIND: + tgt.setValue(Location.LocationMode.KIND); + break; + default: + tgt.setValue(Location.LocationMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertLocationMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Location.LocationModeEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.dstu2.model.Location.LocationMode.INSTANCE); - break; - case KIND: - tgt.setValue(org.hl7.fhir.dstu2.model.Location.LocationMode.KIND); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Location.LocationMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Location.LocationModeEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(org.hl7.fhir.dstu2.model.Location.LocationMode.INSTANCE); + break; + case KIND: + tgt.setValue(org.hl7.fhir.dstu2.model.Location.LocationMode.KIND); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Location.LocationMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Location.LocationPositionComponent convertLocationPositionComponent(org.hl7.fhir.dstu2.model.Location.LocationPositionComponent src) throws FHIRException { @@ -146,46 +156,54 @@ public static org.hl7.fhir.dstu2.model.Location.LocationPositionComponent conver } static public org.hl7.fhir.dstu2.model.Enumeration convertLocationStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Location.LocationStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.Location.LocationStatus.ACTIVE); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.dstu2.model.Location.LocationStatus.SUSPENDED); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.Location.LocationStatus.INACTIVE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Location.LocationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Location.LocationStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu2.model.Location.LocationStatus.ACTIVE); + break; + case SUSPENDED: + tgt.setValue(org.hl7.fhir.dstu2.model.Location.LocationStatus.SUSPENDED); + break; + case INACTIVE: + tgt.setValue(org.hl7.fhir.dstu2.model.Location.LocationStatus.INACTIVE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Location.LocationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertLocationStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Location.LocationStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Location.LocationStatus.ACTIVE); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.r5.model.Location.LocationStatus.SUSPENDED); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Location.LocationStatus.INACTIVE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Location.LocationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Location.LocationStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Location.LocationStatus.ACTIVE); + break; + case SUSPENDED: + tgt.setValue(Location.LocationStatus.SUSPENDED); + break; + case INACTIVE: + tgt.setValue(Location.LocationStatus.INACTIVE); + break; + default: + tgt.setValue(Location.LocationStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/MedicationDispense10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/MedicationDispense10_50.java index 8309badfc4..b947a3ac30 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/MedicationDispense10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/MedicationDispense10_50.java @@ -13,6 +13,8 @@ import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.Dosage; import org.hl7.fhir.r5.model.Dosage.DosageDoseAndRateComponent; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.MedicationDispense; import org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodesEnumFactory; public class MedicationDispense10_50 { @@ -144,59 +146,67 @@ public static org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseDosa } public static org.hl7.fhir.r5.model.Enumeration convertMedicationDispenseStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new MedicationDispenseStatusCodesEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.ENTEREDINERROR); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.INPROGRESS); - break; - case NULL: - tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.NULL); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.ONHOLD); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.STOPPED); - break; - } - return tgt; + if (src == null) + return null; + Enumeration tgt = new Enumeration<>(new MedicationDispenseStatusCodesEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case COMPLETED: + tgt.setValue(MedicationDispense.MedicationDispenseStatusCodes.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(MedicationDispense.MedicationDispenseStatusCodes.ENTEREDINERROR); + break; + case INPROGRESS: + tgt.setValue(MedicationDispense.MedicationDispenseStatusCodes.INPROGRESS); + break; + case NULL: + tgt.setValue(MedicationDispense.MedicationDispenseStatusCodes.NULL); + break; + case ONHOLD: + tgt.setValue(MedicationDispense.MedicationDispenseStatusCodes.ONHOLD); + break; + case STOPPED: + tgt.setValue(MedicationDispense.MedicationDispenseStatusCodes.STOPPED); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2.model.Enumeration convertMedicationDispenseStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration(new org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatus.ENTEREDINERROR); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatus.INPROGRESS); - break; - case NULL: - tgt.setValue(org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatus.NULL); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatus.ONHOLD); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatus.STOPPED); - break; - } - return tgt; + if (src == null) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration(new org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case COMPLETED: + tgt.setValue(org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatus.ENTEREDINERROR); + break; + case INPROGRESS: + tgt.setValue(org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatus.INPROGRESS); + break; + case NULL: + tgt.setValue(org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatus.NULL); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatus.ONHOLD); + break; + case STOPPED: + tgt.setValue(org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatus.STOPPED); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseSubstitutionComponent convertMedicationDispenseSubstitutionComponent(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseSubstitutionComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/MedicationStatement10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/MedicationStatement10_50.java index bca217c843..deffdbe59e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/MedicationStatement10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/MedicationStatement10_50.java @@ -11,6 +11,8 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.String10_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.Dosage.DosageDoseAndRateComponent; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.MedicationStatement; public class MedicationStatement10_50 { @@ -128,52 +130,60 @@ public static org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementDo } static public org.hl7.fhir.r5.model.Enumeration convertMedicationStatementStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodesEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodes.RECORDED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodes.RECORDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodes.ENTEREDINERROR); - break; - case INTENDED: - tgt.setValue(org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodes.RECORDED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new MedicationStatement.MedicationStatementStatusCodesEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(MedicationStatement.MedicationStatementStatusCodes.RECORDED); + break; + case COMPLETED: + tgt.setValue(MedicationStatement.MedicationStatementStatusCodes.RECORDED); + break; + case ENTEREDINERROR: + tgt.setValue(MedicationStatement.MedicationStatementStatusCodes.ENTEREDINERROR); + break; + case INTENDED: + tgt.setValue(MedicationStatement.MedicationStatementStatusCodes.RECORDED); + break; + default: + tgt.setValue(MedicationStatement.MedicationStatementStatusCodes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertMedicationStatementStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { -// case ACTIVE: + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + // case ACTIVE: // tgt.setValue(org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementStatus.ACTIVE); // break; - case RECORDED: - tgt.setValue(org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementStatus.ENTEREDINERROR); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementStatus.ACTIVE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementStatus.NULL); - break; - } - return tgt; + case RECORDED: + tgt.setValue(org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementStatus.ENTEREDINERROR); + break; + case DRAFT: + tgt.setValue(org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementStatus.ACTIVE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/MessageHeader10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/MessageHeader10_50.java index 6de2f189de..2d6b74f22d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/MessageHeader10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/MessageHeader10_50.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.String10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.Uri10_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.MessageHeader; public class MessageHeader10_50 { @@ -154,46 +156,54 @@ public static org.hl7.fhir.r5.model.MessageHeader.MessageSourceComponent convert } static public org.hl7.fhir.r5.model.Enumeration convertResponseType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.MessageHeader.ResponseTypeEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case OK: - tgt.setValue(org.hl7.fhir.r5.model.MessageHeader.ResponseType.OK); - break; - case TRANSIENTERROR: - tgt.setValue(org.hl7.fhir.r5.model.MessageHeader.ResponseType.TRANSIENTERROR); - break; - case FATALERROR: - tgt.setValue(org.hl7.fhir.r5.model.MessageHeader.ResponseType.FATALERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.MessageHeader.ResponseType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new MessageHeader.ResponseTypeEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OK: + tgt.setValue(MessageHeader.ResponseType.OK); + break; + case TRANSIENTERROR: + tgt.setValue(MessageHeader.ResponseType.TRANSIENTERROR); + break; + case FATALERROR: + tgt.setValue(MessageHeader.ResponseType.FATALERROR); + break; + default: + tgt.setValue(MessageHeader.ResponseType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertResponseType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.MessageHeader.ResponseTypeEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case OK: - tgt.setValue(org.hl7.fhir.dstu2.model.MessageHeader.ResponseType.OK); - break; - case TRANSIENTERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.MessageHeader.ResponseType.TRANSIENTERROR); - break; - case FATALERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.MessageHeader.ResponseType.FATALERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.MessageHeader.ResponseType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.MessageHeader.ResponseTypeEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OK: + tgt.setValue(org.hl7.fhir.dstu2.model.MessageHeader.ResponseType.OK); + break; + case TRANSIENTERROR: + tgt.setValue(org.hl7.fhir.dstu2.model.MessageHeader.ResponseType.TRANSIENTERROR); + break; + case FATALERROR: + tgt.setValue(org.hl7.fhir.dstu2.model.MessageHeader.ResponseType.FATALERROR); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.MessageHeader.ResponseType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/NamingSystem10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/NamingSystem10_50.java index d8c60f16b2..1c260d8752 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/NamingSystem10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/NamingSystem10_50.java @@ -14,6 +14,8 @@ import org.hl7.fhir.dstu2.model.StringType; import org.hl7.fhir.dstu2.model.UriType; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.NamingSystem; public class NamingSystem10_50 { @@ -129,97 +131,113 @@ public static org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemContactComponent } static public org.hl7.fhir.r5.model.Enumeration convertNamingSystemIdentifierType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierTypeEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case OID: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierType.OID); - break; - case UUID: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierType.UUID); - break; - case URI: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierType.URI); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierType.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new NamingSystem.NamingSystemIdentifierTypeEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OID: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.OID); + break; + case UUID: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.UUID); + break; + case URI: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.URI); + break; + case OTHER: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.OTHER); + break; + default: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertNamingSystemIdentifierType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemIdentifierTypeEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case OID: - tgt.setValue(org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemIdentifierType.OID); - break; - case UUID: - tgt.setValue(org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemIdentifierType.UUID); - break; - case URI: - tgt.setValue(org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemIdentifierType.URI); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemIdentifierType.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemIdentifierType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemIdentifierTypeEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OID: + tgt.setValue(org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemIdentifierType.OID); + break; + case UUID: + tgt.setValue(org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemIdentifierType.UUID); + break; + case URI: + tgt.setValue(org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemIdentifierType.URI); + break; + case OTHER: + tgt.setValue(org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemIdentifierType.OTHER); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemIdentifierType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertNamingSystemType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemTypeEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case CODESYSTEM: - tgt.setValue(org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemType.CODESYSTEM); - break; - case IDENTIFIER: - tgt.setValue(org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemType.IDENTIFIER); - break; - case ROOT: - tgt.setValue(org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemType.ROOT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemTypeEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CODESYSTEM: + tgt.setValue(org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemType.CODESYSTEM); + break; + case IDENTIFIER: + tgt.setValue(org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemType.IDENTIFIER); + break; + case ROOT: + tgt.setValue(org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemType.ROOT); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertNamingSystemType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.NamingSystem.NamingSystemTypeEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case CODESYSTEM: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemType.CODESYSTEM); - break; - case IDENTIFIER: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemType.IDENTIFIER); - break; - case ROOT: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemType.ROOT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new NamingSystem.NamingSystemTypeEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CODESYSTEM: + tgt.setValue(NamingSystem.NamingSystemType.CODESYSTEM); + break; + case IDENTIFIER: + tgt.setValue(NamingSystem.NamingSystemType.IDENTIFIER); + break; + case ROOT: + tgt.setValue(NamingSystem.NamingSystemType.ROOT); + break; + default: + tgt.setValue(NamingSystem.NamingSystemType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.NamingSystem.NamingSystemUniqueIdComponent convertNamingSystemUniqueIdComponent(org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemUniqueIdComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Observation10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Observation10_50.java index 59b96250a8..060464c116 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Observation10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Observation10_50.java @@ -8,7 +8,10 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.complextypes10_50.SimpleQuantity10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.Instant10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.String10_50; +import org.hl7.fhir.dstu2.model.Observation; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; public class Observation10_50 { @@ -197,70 +200,78 @@ public static org.hl7.fhir.dstu2.model.Observation.ObservationRelatedComponent c } static public org.hl7.fhir.r5.model.Enumeration convertObservationStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ObservationStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.REGISTERED); - break; - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.AMENDED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ObservationStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(Enumerations.ObservationStatus.REGISTERED); + break; + case PRELIMINARY: + tgt.setValue(Enumerations.ObservationStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(Enumerations.ObservationStatus.FINAL); + break; + case AMENDED: + tgt.setValue(Enumerations.ObservationStatus.AMENDED); + break; + case CANCELLED: + tgt.setValue(Enumerations.ObservationStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.ObservationStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Enumerations.ObservationStatus.UNKNOWN); + break; + default: + tgt.setValue(Enumerations.ObservationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertObservationStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Observation.ObservationStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationStatus.REGISTERED); - break; - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationStatus.AMENDED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Observation.ObservationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new Observation.ObservationStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(Observation.ObservationStatus.REGISTERED); + break; + case PRELIMINARY: + tgt.setValue(Observation.ObservationStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(Observation.ObservationStatus.FINAL); + break; + case AMENDED: + tgt.setValue(Observation.ObservationStatus.AMENDED); + break; + case CANCELLED: + tgt.setValue(Observation.ObservationStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(Observation.ObservationStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Observation.ObservationStatus.UNKNOWN); + break; + default: + tgt.setValue(Observation.ObservationStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/OperationDefinition10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/OperationDefinition10_50.java index 48dd8a3e06..877c94db20 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/OperationDefinition10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/OperationDefinition10_50.java @@ -18,6 +18,7 @@ import org.hl7.fhir.r5.model.Enumerations.SearchParamType; import org.hl7.fhir.r5.model.Enumerations.VersionIndependentResourceTypesAll; import org.hl7.fhir.r5.model.Enumerations.VersionIndependentResourceTypesAllEnumFactory; +import org.hl7.fhir.r5.model.OperationDefinition; import org.hl7.fhir.utilities.Utilities; public class OperationDefinition10_50 { @@ -231,78 +232,94 @@ public static org.hl7.fhir.dstu2.model.OperationDefinition.OperationDefinitionPa } static public org.hl7.fhir.r5.model.Enumeration convertOperationKind(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.OperationDefinition.OperationKindEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case OPERATION: - tgt.setValue(org.hl7.fhir.r5.model.OperationDefinition.OperationKind.OPERATION); - break; - case QUERY: - tgt.setValue(org.hl7.fhir.r5.model.OperationDefinition.OperationKind.QUERY); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.OperationDefinition.OperationKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new OperationDefinition.OperationKindEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OPERATION: + tgt.setValue(OperationDefinition.OperationKind.OPERATION); + break; + case QUERY: + tgt.setValue(OperationDefinition.OperationKind.QUERY); + break; + default: + tgt.setValue(OperationDefinition.OperationKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertOperationKind(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.OperationDefinition.OperationKindEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case OPERATION: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationDefinition.OperationKind.OPERATION); - break; - case QUERY: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationDefinition.OperationKind.QUERY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationDefinition.OperationKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.OperationDefinition.OperationKindEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OPERATION: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationDefinition.OperationKind.OPERATION); + break; + case QUERY: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationDefinition.OperationKind.QUERY); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationDefinition.OperationKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertOperationParameterUse(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.OperationParameterUseEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case IN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.OperationParameterUse.IN); - break; - case OUT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.OperationParameterUse.OUT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.OperationParameterUse.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.OperationParameterUseEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case IN: + tgt.setValue(Enumerations.OperationParameterUse.IN); + break; + case OUT: + tgt.setValue(Enumerations.OperationParameterUse.OUT); + break; + default: + tgt.setValue(Enumerations.OperationParameterUse.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertOperationParameterUse(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.OperationDefinition.OperationParameterUseEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case IN: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationDefinition.OperationParameterUse.IN); - break; - case OUT: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationDefinition.OperationParameterUse.OUT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationDefinition.OperationParameterUse.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.OperationDefinition.OperationParameterUseEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case IN: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationDefinition.OperationParameterUse.IN); + break; + case OUT: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationDefinition.OperationParameterUse.OUT); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationDefinition.OperationParameterUse.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/OperationOutcome10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/OperationOutcome10_50.java index 21f965f573..6d4bfd243c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/OperationOutcome10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/OperationOutcome10_50.java @@ -4,257 +4,275 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.complextypes10_50.CodeableConcept10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.String10_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.OperationOutcome; public class OperationOutcome10_50 { static public org.hl7.fhir.r5.model.Enumeration convertIssueSeverity(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.OperationOutcome.IssueSeverityEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case FATAL: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.FATAL); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.ERROR); - break; - case WARNING: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.WARNING); - break; - case INFORMATION: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.INFORMATION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new OperationOutcome.IssueSeverityEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FATAL: + tgt.setValue(OperationOutcome.IssueSeverity.FATAL); + break; + case ERROR: + tgt.setValue(OperationOutcome.IssueSeverity.ERROR); + break; + case WARNING: + tgt.setValue(OperationOutcome.IssueSeverity.WARNING); + break; + case INFORMATION: + tgt.setValue(OperationOutcome.IssueSeverity.INFORMATION); + break; + default: + tgt.setValue(OperationOutcome.IssueSeverity.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertIssueSeverity(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverityEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case FATAL: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverity.FATAL); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverity.ERROR); - break; - case WARNING: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverity.WARNING); - break; - case INFORMATION: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverity.INFORMATION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverity.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverityEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FATAL: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverity.FATAL); + break; + case ERROR: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverity.ERROR); + break; + case WARNING: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverity.WARNING); + break; + case INFORMATION: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverity.INFORMATION); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueSeverity.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertIssueType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.OperationOutcome.IssueTypeEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case INVALID: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.INVALID); - break; - case STRUCTURE: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.STRUCTURE); - break; - case REQUIRED: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.REQUIRED); - break; - case VALUE: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.VALUE); - break; - case INVARIANT: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.INVARIANT); - break; - case SECURITY: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.SECURITY); - break; - case LOGIN: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.LOGIN); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.UNKNOWN); - break; - case EXPIRED: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.EXPIRED); - break; - case FORBIDDEN: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.FORBIDDEN); - break; - case SUPPRESSED: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.SUPPRESSED); - break; - case PROCESSING: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.PROCESSING); - break; - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.NOTSUPPORTED); - break; - case DUPLICATE: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.DUPLICATE); - break; - case NOTFOUND: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.NOTFOUND); - break; - case TOOLONG: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.TOOLONG); - break; - case CODEINVALID: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.CODEINVALID); - break; - case EXTENSION: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.EXTENSION); - break; - case TOOCOSTLY: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.TOOCOSTLY); - break; - case BUSINESSRULE: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.BUSINESSRULE); - break; - case CONFLICT: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.CONFLICT); - break; - case INCOMPLETE: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.INCOMPLETE); - break; - case TRANSIENT: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.TRANSIENT); - break; - case LOCKERROR: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.LOCKERROR); - break; - case NOSTORE: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.NOSTORE); - break; - case EXCEPTION: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.EXCEPTION); - break; - case TIMEOUT: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.TIMEOUT); - break; - case THROTTLED: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.THROTTLED); - break; - case INFORMATIONAL: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.INFORMATIONAL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new OperationOutcome.IssueTypeEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INVALID: + tgt.setValue(OperationOutcome.IssueType.INVALID); + break; + case STRUCTURE: + tgt.setValue(OperationOutcome.IssueType.STRUCTURE); + break; + case REQUIRED: + tgt.setValue(OperationOutcome.IssueType.REQUIRED); + break; + case VALUE: + tgt.setValue(OperationOutcome.IssueType.VALUE); + break; + case INVARIANT: + tgt.setValue(OperationOutcome.IssueType.INVARIANT); + break; + case SECURITY: + tgt.setValue(OperationOutcome.IssueType.SECURITY); + break; + case LOGIN: + tgt.setValue(OperationOutcome.IssueType.LOGIN); + break; + case UNKNOWN: + tgt.setValue(OperationOutcome.IssueType.UNKNOWN); + break; + case EXPIRED: + tgt.setValue(OperationOutcome.IssueType.EXPIRED); + break; + case FORBIDDEN: + tgt.setValue(OperationOutcome.IssueType.FORBIDDEN); + break; + case SUPPRESSED: + tgt.setValue(OperationOutcome.IssueType.SUPPRESSED); + break; + case PROCESSING: + tgt.setValue(OperationOutcome.IssueType.PROCESSING); + break; + case NOTSUPPORTED: + tgt.setValue(OperationOutcome.IssueType.NOTSUPPORTED); + break; + case DUPLICATE: + tgt.setValue(OperationOutcome.IssueType.DUPLICATE); + break; + case NOTFOUND: + tgt.setValue(OperationOutcome.IssueType.NOTFOUND); + break; + case TOOLONG: + tgt.setValue(OperationOutcome.IssueType.TOOLONG); + break; + case CODEINVALID: + tgt.setValue(OperationOutcome.IssueType.CODEINVALID); + break; + case EXTENSION: + tgt.setValue(OperationOutcome.IssueType.EXTENSION); + break; + case TOOCOSTLY: + tgt.setValue(OperationOutcome.IssueType.TOOCOSTLY); + break; + case BUSINESSRULE: + tgt.setValue(OperationOutcome.IssueType.BUSINESSRULE); + break; + case CONFLICT: + tgt.setValue(OperationOutcome.IssueType.CONFLICT); + break; + case INCOMPLETE: + tgt.setValue(OperationOutcome.IssueType.INCOMPLETE); + break; + case TRANSIENT: + tgt.setValue(OperationOutcome.IssueType.TRANSIENT); + break; + case LOCKERROR: + tgt.setValue(OperationOutcome.IssueType.LOCKERROR); + break; + case NOSTORE: + tgt.setValue(OperationOutcome.IssueType.NOSTORE); + break; + case EXCEPTION: + tgt.setValue(OperationOutcome.IssueType.EXCEPTION); + break; + case TIMEOUT: + tgt.setValue(OperationOutcome.IssueType.TIMEOUT); + break; + case THROTTLED: + tgt.setValue(OperationOutcome.IssueType.THROTTLED); + break; + case INFORMATIONAL: + tgt.setValue(OperationOutcome.IssueType.INFORMATIONAL); + break; + default: + tgt.setValue(OperationOutcome.IssueType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertIssueType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.OperationOutcome.IssueTypeEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case INVALID: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.INVALID); - break; - case STRUCTURE: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.STRUCTURE); - break; - case REQUIRED: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.REQUIRED); - break; - case VALUE: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.VALUE); - break; - case INVARIANT: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.INVARIANT); - break; - case SECURITY: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.SECURITY); - break; - case LOGIN: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.LOGIN); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.UNKNOWN); - break; - case EXPIRED: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.EXPIRED); - break; - case FORBIDDEN: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.FORBIDDEN); - break; - case SUPPRESSED: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.SUPPRESSED); - break; - case PROCESSING: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.PROCESSING); - break; - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.NOTSUPPORTED); - break; - case DUPLICATE: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.DUPLICATE); - break; - case NOTFOUND: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.NOTFOUND); - break; - case TOOLONG: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.TOOLONG); - break; - case CODEINVALID: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.CODEINVALID); - break; - case EXTENSION: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.EXTENSION); - break; - case TOOCOSTLY: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.TOOCOSTLY); - break; - case BUSINESSRULE: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.BUSINESSRULE); - break; - case CONFLICT: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.CONFLICT); - break; - case INCOMPLETE: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.INCOMPLETE); - break; - case TRANSIENT: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.TRANSIENT); - break; - case LOCKERROR: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.LOCKERROR); - break; - case NOSTORE: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.NOSTORE); - break; - case EXCEPTION: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.EXCEPTION); - break; - case TIMEOUT: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.TIMEOUT); - break; - case THROTTLED: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.THROTTLED); - break; - case INFORMATIONAL: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.INFORMATIONAL); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.OperationOutcome.IssueTypeEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INVALID: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.INVALID); + break; + case STRUCTURE: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.STRUCTURE); + break; + case REQUIRED: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.REQUIRED); + break; + case VALUE: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.VALUE); + break; + case INVARIANT: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.INVARIANT); + break; + case SECURITY: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.SECURITY); + break; + case LOGIN: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.LOGIN); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.UNKNOWN); + break; + case EXPIRED: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.EXPIRED); + break; + case FORBIDDEN: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.FORBIDDEN); + break; + case SUPPRESSED: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.SUPPRESSED); + break; + case PROCESSING: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.PROCESSING); + break; + case NOTSUPPORTED: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.NOTSUPPORTED); + break; + case DUPLICATE: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.DUPLICATE); + break; + case NOTFOUND: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.NOTFOUND); + break; + case TOOLONG: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.TOOLONG); + break; + case CODEINVALID: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.CODEINVALID); + break; + case EXTENSION: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.EXTENSION); + break; + case TOOCOSTLY: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.TOOCOSTLY); + break; + case BUSINESSRULE: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.BUSINESSRULE); + break; + case CONFLICT: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.CONFLICT); + break; + case INCOMPLETE: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.INCOMPLETE); + break; + case TRANSIENT: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.TRANSIENT); + break; + case LOCKERROR: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.LOCKERROR); + break; + case NOSTORE: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.NOSTORE); + break; + case EXCEPTION: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.EXCEPTION); + break; + case TIMEOUT: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.TIMEOUT); + break; + case THROTTLED: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.THROTTLED); + break; + case INFORMATIONAL: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.INFORMATIONAL); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.OperationOutcome.IssueType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.OperationOutcome convertOperationOutcome(org.hl7.fhir.dstu2.model.OperationOutcome src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Patient10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Patient10_50.java index 26e1b863ec..9f385cf58b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Patient10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Patient10_50.java @@ -12,6 +12,8 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.Boolean10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.Date10_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Patient; public class Patient10_50 { @@ -89,50 +91,58 @@ public static org.hl7.fhir.dstu2.model.Patient.ContactComponent convertContactCo } static public org.hl7.fhir.r5.model.Enumeration convertLinkType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Patient.LinkTypeEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case REPLACE: - tgt.setValue(org.hl7.fhir.r5.model.Patient.LinkType.REPLACEDBY); - break; - case REFER: - tgt.setValue(org.hl7.fhir.r5.model.Patient.LinkType.REFER); - break; - case SEEALSO: - tgt.setValue(org.hl7.fhir.r5.model.Patient.LinkType.SEEALSO); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Patient.LinkType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Patient.LinkTypeEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REPLACE: + tgt.setValue(Patient.LinkType.REPLACEDBY); + break; + case REFER: + tgt.setValue(Patient.LinkType.REFER); + break; + case SEEALSO: + tgt.setValue(Patient.LinkType.SEEALSO); + break; + default: + tgt.setValue(Patient.LinkType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertLinkType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Patient.LinkTypeEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case REPLACEDBY: - tgt.setValue(org.hl7.fhir.dstu2.model.Patient.LinkType.REPLACE); - break; - case REPLACES: - tgt.setValue(org.hl7.fhir.dstu2.model.Patient.LinkType.REPLACE); - break; - case REFER: - tgt.setValue(org.hl7.fhir.dstu2.model.Patient.LinkType.REFER); - break; - case SEEALSO: - tgt.setValue(org.hl7.fhir.dstu2.model.Patient.LinkType.SEEALSO); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Patient.LinkType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Patient.LinkTypeEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REPLACEDBY: + tgt.setValue(org.hl7.fhir.dstu2.model.Patient.LinkType.REPLACE); + break; + case REPLACES: + tgt.setValue(org.hl7.fhir.dstu2.model.Patient.LinkType.REPLACE); + break; + case REFER: + tgt.setValue(org.hl7.fhir.dstu2.model.Patient.LinkType.REFER); + break; + case SEEALSO: + tgt.setValue(org.hl7.fhir.dstu2.model.Patient.LinkType.SEEALSO); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Patient.LinkType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Patient convertPatient(org.hl7.fhir.dstu2.model.Patient src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Person10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Person10_50.java index 5a745cc9b9..38c1949e31 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Person10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Person10_50.java @@ -10,57 +10,67 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.Boolean10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.Date10_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Person; public class Person10_50 { static public org.hl7.fhir.r5.model.Enumeration convertIdentityAssuranceLevel(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Person.IdentityAssuranceLevelEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case LEVEL1: - tgt.setValue(org.hl7.fhir.r5.model.Person.IdentityAssuranceLevel.LEVEL1); - break; - case LEVEL2: - tgt.setValue(org.hl7.fhir.r5.model.Person.IdentityAssuranceLevel.LEVEL2); - break; - case LEVEL3: - tgt.setValue(org.hl7.fhir.r5.model.Person.IdentityAssuranceLevel.LEVEL3); - break; - case LEVEL4: - tgt.setValue(org.hl7.fhir.r5.model.Person.IdentityAssuranceLevel.LEVEL4); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Person.IdentityAssuranceLevel.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Person.IdentityAssuranceLevelEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case LEVEL1: + tgt.setValue(Person.IdentityAssuranceLevel.LEVEL1); + break; + case LEVEL2: + tgt.setValue(Person.IdentityAssuranceLevel.LEVEL2); + break; + case LEVEL3: + tgt.setValue(Person.IdentityAssuranceLevel.LEVEL3); + break; + case LEVEL4: + tgt.setValue(Person.IdentityAssuranceLevel.LEVEL4); + break; + default: + tgt.setValue(Person.IdentityAssuranceLevel.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertIdentityAssuranceLevel(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Person.IdentityAssuranceLevelEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case LEVEL1: - tgt.setValue(org.hl7.fhir.dstu2.model.Person.IdentityAssuranceLevel.LEVEL1); - break; - case LEVEL2: - tgt.setValue(org.hl7.fhir.dstu2.model.Person.IdentityAssuranceLevel.LEVEL2); - break; - case LEVEL3: - tgt.setValue(org.hl7.fhir.dstu2.model.Person.IdentityAssuranceLevel.LEVEL3); - break; - case LEVEL4: - tgt.setValue(org.hl7.fhir.dstu2.model.Person.IdentityAssuranceLevel.LEVEL4); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Person.IdentityAssuranceLevel.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Person.IdentityAssuranceLevelEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case LEVEL1: + tgt.setValue(org.hl7.fhir.dstu2.model.Person.IdentityAssuranceLevel.LEVEL1); + break; + case LEVEL2: + tgt.setValue(org.hl7.fhir.dstu2.model.Person.IdentityAssuranceLevel.LEVEL2); + break; + case LEVEL3: + tgt.setValue(org.hl7.fhir.dstu2.model.Person.IdentityAssuranceLevel.LEVEL3); + break; + case LEVEL4: + tgt.setValue(org.hl7.fhir.dstu2.model.Person.IdentityAssuranceLevel.LEVEL4); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Person.IdentityAssuranceLevel.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Person convertPerson(org.hl7.fhir.dstu2.model.Person src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Provenance10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Provenance10_50.java index dfe923723a..0189027909 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Provenance10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Provenance10_50.java @@ -11,6 +11,8 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.Uri10_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Provenance; import org.hl7.fhir.utilities.Utilities; /* @@ -153,52 +155,60 @@ public static org.hl7.fhir.dstu2.model.Provenance.ProvenanceEntityComponent conv } static public org.hl7.fhir.r5.model.Enumeration convertProvenanceEntityRole(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRoleEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case DERIVATION: - tgt.setValue(org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRole.INSTANTIATES); - break; - case REVISION: - tgt.setValue(org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRole.REVISION); - break; - case QUOTATION: - tgt.setValue(org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRole.QUOTATION); - break; - case SOURCE: - tgt.setValue(org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRole.SOURCE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRole.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Provenance.ProvenanceEntityRoleEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DERIVATION: + tgt.setValue(Provenance.ProvenanceEntityRole.INSTANTIATES); + break; + case REVISION: + tgt.setValue(Provenance.ProvenanceEntityRole.REVISION); + break; + case QUOTATION: + tgt.setValue(Provenance.ProvenanceEntityRole.QUOTATION); + break; + case SOURCE: + tgt.setValue(Provenance.ProvenanceEntityRole.SOURCE); + break; + default: + tgt.setValue(Provenance.ProvenanceEntityRole.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertProvenanceEntityRole(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Provenance.ProvenanceEntityRoleEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANTIATES: - tgt.setValue(org.hl7.fhir.dstu2.model.Provenance.ProvenanceEntityRole.DERIVATION); - break; - case REVISION: - tgt.setValue(org.hl7.fhir.dstu2.model.Provenance.ProvenanceEntityRole.REVISION); - break; - case QUOTATION: - tgt.setValue(org.hl7.fhir.dstu2.model.Provenance.ProvenanceEntityRole.QUOTATION); - break; - case SOURCE: - tgt.setValue(org.hl7.fhir.dstu2.model.Provenance.ProvenanceEntityRole.SOURCE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Provenance.ProvenanceEntityRole.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Provenance.ProvenanceEntityRoleEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANTIATES: + tgt.setValue(org.hl7.fhir.dstu2.model.Provenance.ProvenanceEntityRole.DERIVATION); + break; + case REVISION: + tgt.setValue(org.hl7.fhir.dstu2.model.Provenance.ProvenanceEntityRole.REVISION); + break; + case QUOTATION: + tgt.setValue(org.hl7.fhir.dstu2.model.Provenance.ProvenanceEntityRole.QUOTATION); + break; + case SOURCE: + tgt.setValue(org.hl7.fhir.dstu2.model.Provenance.ProvenanceEntityRole.SOURCE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Provenance.ProvenanceEntityRole.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Questionnaire10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Questionnaire10_50.java index 0fe82d209a..45db4aed88 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Questionnaire10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Questionnaire10_50.java @@ -12,8 +12,7 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.String10_50; import org.hl7.fhir.dstu2.model.Questionnaire.AnswerFormat; import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.r5.model.CodeType; -import org.hl7.fhir.r5.model.ContactDetail; +import org.hl7.fhir.r5.model.*; import org.hl7.fhir.r5.model.Questionnaire.QuestionnaireAnswerConstraint; import org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemAnswerOptionComponent; @@ -137,53 +136,57 @@ static public org.hl7.fhir.dstu2.model.Enumeration convertQuestionnaireQuestionType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemTypeEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - tgt.addExtension(VersionConvertorConstants.EXT_QUESTIONNAIRE_ITEM_TYPE_ORIGINAL, new CodeType(src.getValueAsString())); - switch (src.getValue()) { - case BOOLEAN: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.BOOLEAN); - break; - case DECIMAL: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.DECIMAL); - break; - case INTEGER: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.INTEGER); - break; - case DATE: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.DATE); - break; - case DATETIME: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.DATETIME); - break; - case INSTANT: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.DATETIME); - break; - case TIME: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.TIME); - break; - case STRING: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.STRING); - break; - case TEXT: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.TEXT); - break; - case URL: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.URL); - break; - case CHOICE: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.CODING); - break; - case OPENCHOICE: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.CODING); - break; - case ATTACHMENT: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.ATTACHMENT); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.REFERENCE); - break; - case QUANTITY: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.QUANTITY); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Questionnaire.QuestionnaireItemTypeEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + tgt.addExtension(VersionConvertorConstants.EXT_QUESTIONNAIRE_ITEM_TYPE_ORIGINAL, new CodeType(src.getValueAsString())); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case BOOLEAN: + tgt.setValue(Questionnaire.QuestionnaireItemType.BOOLEAN); + break; + case DECIMAL: + tgt.setValue(Questionnaire.QuestionnaireItemType.DECIMAL); + break; + case INTEGER: + tgt.setValue(Questionnaire.QuestionnaireItemType.INTEGER); + break; + case DATE: + tgt.setValue(Questionnaire.QuestionnaireItemType.DATE); + break; + case DATETIME: + tgt.setValue(Questionnaire.QuestionnaireItemType.DATETIME); + break; + case INSTANT: + tgt.setValue(Questionnaire.QuestionnaireItemType.DATETIME); + break; + case TIME: + tgt.setValue(Questionnaire.QuestionnaireItemType.TIME); + break; + case STRING: + tgt.setValue(Questionnaire.QuestionnaireItemType.STRING); + break; + case TEXT: + tgt.setValue(Questionnaire.QuestionnaireItemType.TEXT); + break; + case URL: + tgt.setValue(Questionnaire.QuestionnaireItemType.URL); + break; + case CHOICE: + tgt.setValue(Questionnaire.QuestionnaireItemType.CODING); + break; + case OPENCHOICE: + tgt.setValue(Questionnaire.QuestionnaireItemType.CODING); + break; + case ATTACHMENT: + tgt.setValue(Questionnaire.QuestionnaireItemType.ATTACHMENT); + break; + case REFERENCE: + tgt.setValue(Questionnaire.QuestionnaireItemType.REFERENCE); + break; + case QUANTITY: + tgt.setValue(Questionnaire.QuestionnaireItemType.QUANTITY); + break; + default: + tgt.setValue(Questionnaire.QuestionnaireItemType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertQuestionnaireStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Questionnaire.QuestionnaireStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.QuestionnaireStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.QuestionnaireStatus.PUBLISHED); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.QuestionnaireStatus.RETIRED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.QuestionnaireStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Questionnaire.QuestionnaireStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.QuestionnaireStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.QuestionnaireStatus.PUBLISHED); + break; + case RETIRED: + tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.QuestionnaireStatus.RETIRED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Questionnaire.QuestionnaireStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertQuestionnaireStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.PublicationStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.DRAFT); - break; - case PUBLISHED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.ACTIVE); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.RETIRED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.PublicationStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(Enumerations.PublicationStatus.DRAFT); + break; + case PUBLISHED: + tgt.setValue(Enumerations.PublicationStatus.ACTIVE); + break; + case RETIRED: + tgt.setValue(Enumerations.PublicationStatus.RETIRED); + break; + default: + tgt.setValue(Enumerations.PublicationStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/QuestionnaireResponse10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/QuestionnaireResponse10_50.java index fc45dceaf1..b8258bdf9f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/QuestionnaireResponse10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/QuestionnaireResponse10_50.java @@ -6,6 +6,8 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.DateTime10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.String10_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.QuestionnaireResponse; public class QuestionnaireResponse10_50 { @@ -148,46 +150,54 @@ public static org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseI } static public org.hl7.fhir.r5.model.Enumeration convertQuestionnaireResponseStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED); + break; + case AMENDED: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED); + break; + default: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertQuestionnaireResponseStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionnaireResponseStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED); + break; + case AMENDED: + tgt.setValue(org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionnaireResponseStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/SearchParameter10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/SearchParameter10_50.java index 1ad5b016c2..cc565fe02d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/SearchParameter10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/SearchParameter10_50.java @@ -12,6 +12,7 @@ import org.hl7.fhir.r5.model.Enumeration; import org.hl7.fhir.r5.model.Enumerations.VersionIndependentResourceTypesAll; import org.hl7.fhir.r5.model.Enumerations.VersionIndependentResourceTypesAllEnumFactory; +import org.hl7.fhir.r5.model.SearchParameter; public class SearchParameter10_50 { @@ -114,52 +115,60 @@ public static org.hl7.fhir.r5.model.ContactDetail convertSearchParameterContactC } static public org.hl7.fhir.r5.model.Enumeration convertXPathUsageType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeTypeEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case NORMAL: - tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.NORMAL); - break; - case PHONETIC: - tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.PHONETIC); - break; - case NEARBY: - tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.OTHER); - break; - case DISTANCE: - tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.OTHER); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new SearchParameter.SearchProcessingModeTypeEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NORMAL: + tgt.setValue(SearchParameter.SearchProcessingModeType.NORMAL); + break; + case PHONETIC: + tgt.setValue(SearchParameter.SearchProcessingModeType.PHONETIC); + break; + case NEARBY: + tgt.setValue(SearchParameter.SearchProcessingModeType.OTHER); + break; + case DISTANCE: + tgt.setValue(SearchParameter.SearchProcessingModeType.OTHER); + break; + case OTHER: + tgt.setValue(SearchParameter.SearchProcessingModeType.OTHER); + break; + default: + tgt.setValue(SearchParameter.SearchProcessingModeType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertXPathUsageType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.SearchParameter.XPathUsageTypeEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case NORMAL: - tgt.setValue(org.hl7.fhir.dstu2.model.SearchParameter.XPathUsageType.NORMAL); - break; - case PHONETIC: - tgt.setValue(org.hl7.fhir.dstu2.model.SearchParameter.XPathUsageType.PHONETIC); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.dstu2.model.SearchParameter.XPathUsageType.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.SearchParameter.XPathUsageType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.SearchParameter.XPathUsageTypeEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NORMAL: + tgt.setValue(org.hl7.fhir.dstu2.model.SearchParameter.XPathUsageType.NORMAL); + break; + case PHONETIC: + tgt.setValue(org.hl7.fhir.dstu2.model.SearchParameter.XPathUsageType.PHONETIC); + break; + case OTHER: + tgt.setValue(org.hl7.fhir.dstu2.model.SearchParameter.XPathUsageType.OTHER); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.SearchParameter.XPathUsageType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Slot10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Slot10_50.java index 6f1d3269ee..c26bf76973 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Slot10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Slot10_50.java @@ -9,6 +9,7 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.String10_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Slot; public class Slot10_50 { @@ -62,26 +63,26 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Slot.SlotStatusEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Slot.SlotStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case BUSY: - tgt.setValue(org.hl7.fhir.r5.model.Slot.SlotStatus.BUSY); - break; - case FREE: - tgt.setValue(org.hl7.fhir.r5.model.Slot.SlotStatus.FREE); - break; - case BUSYUNAVAILABLE: - tgt.setValue(org.hl7.fhir.r5.model.Slot.SlotStatus.BUSYUNAVAILABLE); - break; - case BUSYTENTATIVE: - tgt.setValue(org.hl7.fhir.r5.model.Slot.SlotStatus.BUSYTENTATIVE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Slot.SlotStatus.NULL); - break; - } - } + tgt.setValue(Slot.SlotStatus.BUSY); + break; + case FREE: + tgt.setValue(Slot.SlotStatus.FREE); + break; + case BUSYUNAVAILABLE: + tgt.setValue(Slot.SlotStatus.BUSYUNAVAILABLE); + break; + case BUSYTENTATIVE: + tgt.setValue(Slot.SlotStatus.BUSYTENTATIVE); + break; + default: + tgt.setValue(Slot.SlotStatus.NULL); + break; + } +} return tgt; } @@ -90,26 +91,26 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Slot.SlotStatusEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.Slot.SlotStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case BUSY: - tgt.setValue(org.hl7.fhir.dstu2.model.Slot.SlotStatus.BUSY); - break; - case FREE: - tgt.setValue(org.hl7.fhir.dstu2.model.Slot.SlotStatus.FREE); - break; - case BUSYUNAVAILABLE: - tgt.setValue(org.hl7.fhir.dstu2.model.Slot.SlotStatus.BUSYUNAVAILABLE); - break; - case BUSYTENTATIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.Slot.SlotStatus.BUSYTENTATIVE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.Slot.SlotStatus.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.Slot.SlotStatus.BUSY); + break; + case FREE: + tgt.setValue(org.hl7.fhir.dstu2.model.Slot.SlotStatus.FREE); + break; + case BUSYUNAVAILABLE: + tgt.setValue(org.hl7.fhir.dstu2.model.Slot.SlotStatus.BUSYUNAVAILABLE); + break; + case BUSYTENTATIVE: + tgt.setValue(org.hl7.fhir.dstu2.model.Slot.SlotStatus.BUSYTENTATIVE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.Slot.SlotStatus.NULL); + break; + } +} return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/StructureDefinition10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/StructureDefinition10_50.java index 696fde75c0..78e8b62f0e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/StructureDefinition10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/StructureDefinition10_50.java @@ -17,6 +17,8 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.Uri10_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.ElementDefinition; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.StructureDefinition; import org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind; import org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule; import org.hl7.fhir.utilities.Utilities; @@ -24,52 +26,60 @@ public class StructureDefinition10_50 { static public org.hl7.fhir.r5.model.Enumeration convertExtensionContext(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextTypeEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case RESOURCE: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextType.ELEMENT); - break; - case DATATYPE: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextType.ELEMENT); - break; - case EXTENSION: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextType.EXTENSION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureDefinition.ExtensionContextTypeEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case RESOURCE: + tgt.setValue(StructureDefinition.ExtensionContextType.ELEMENT); + break; + case DATATYPE: + tgt.setValue(StructureDefinition.ExtensionContextType.ELEMENT); + break; + case EXTENSION: + tgt.setValue(StructureDefinition.ExtensionContextType.EXTENSION); + break; + default: + tgt.setValue(StructureDefinition.ExtensionContextType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertExtensionContext(org.hl7.fhir.r5.model.Enumeration src, String expression) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.StructureDefinition.ExtensionContextEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case FHIRPATH: - tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.ExtensionContext.RESOURCE); - break; - case ELEMENT: - String tn = expression.contains(".") ? expression.substring(0, expression.indexOf(".")) : expression; - if (isResource102(tn)) { - tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.ExtensionContext.RESOURCE); - } else { - tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.ExtensionContext.DATATYPE); - } - break; - case EXTENSION: - tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.ExtensionContext.EXTENSION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.ExtensionContext.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.StructureDefinition.ExtensionContextEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FHIRPATH: + tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.ExtensionContext.RESOURCE); + break; + case ELEMENT: + String tn = expression.contains(".") ? expression.substring(0, expression.indexOf(".")) : expression; + if (isResource102(tn)) { + tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.ExtensionContext.RESOURCE); + } else { + tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.ExtensionContext.DATATYPE); + } + break; + case EXTENSION: + tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.ExtensionContext.EXTENSION); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.ExtensionContext.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2.model.StructureDefinition convertStructureDefinition(org.hl7.fhir.r5.model.StructureDefinition src) throws FHIRException { @@ -272,56 +282,64 @@ public static org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionDiffe } public static org.hl7.fhir.r5.model.Enumeration convertStructureDefinitionKind(org.hl7.fhir.dstu2.model.Enumeration src, String dtName) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKindEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case DATATYPE: - if (Utilities.existsInList(dtName, "boolean", "integer", "integer64", "decimal", "base64Binary", - "instant", "string", "uri", "date", "dateTime", "time", "code", "oid", "uuid", "id", - "unsignedInt", "positiveInt", "markdown", "xhtml", "url", "canonical")) { - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind.PRIMITIVETYPE); - } else { - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind.COMPLEXTYPE); - } - break; - case RESOURCE: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind.RESOURCE); - break; - case LOGICAL: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind.LOGICAL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureDefinition.StructureDefinitionKindEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DATATYPE: + if (Utilities.existsInList(dtName, "boolean", "integer", "integer64", "decimal", "base64Binary", + "instant", "string", "uri", "date", "dateTime", "time", "code", "oid", "uuid", "id", + "unsignedInt", "positiveInt", "markdown", "xhtml", "url", "canonical")) { + tgt.setValue(StructureDefinitionKind.PRIMITIVETYPE); + } else { + tgt.setValue(StructureDefinitionKind.COMPLEXTYPE); + } + break; + case RESOURCE: + tgt.setValue(StructureDefinitionKind.RESOURCE); + break; + case LOGICAL: + tgt.setValue(StructureDefinitionKind.LOGICAL); + break; + default: + tgt.setValue(StructureDefinitionKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertStructureDefinitionKind(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionKindEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case PRIMITIVETYPE: - tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionKind.DATATYPE); - break; - case COMPLEXTYPE: - tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionKind.DATATYPE); - break; - case RESOURCE: - tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionKind.RESOURCE); - break; - case LOGICAL: - tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionKind.LOGICAL); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionKindEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRIMITIVETYPE: + tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionKind.DATATYPE); + break; + case COMPLEXTYPE: + tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionKind.DATATYPE); + break; + case RESOURCE: + tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionKind.RESOURCE); + break; + case LOGICAL: + tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionKind.LOGICAL); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionKind.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionMappingComponent convertStructureDefinitionMappingComponent(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionMappingComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/SupplyDelivery10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/SupplyDelivery10_50.java index 32a2dc3730..3df46c504b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/SupplyDelivery10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/SupplyDelivery10_50.java @@ -4,7 +4,10 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.Reference10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.complextypes10_50.CodeableConcept10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.complextypes10_50.Identifier10_50; +import org.hl7.fhir.dstu2.model.Enumeration; +import org.hl7.fhir.dstu2.model.SupplyDelivery; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.SupplyRequest; public class SupplyDelivery10_50 { @@ -51,47 +54,55 @@ public static org.hl7.fhir.r5.model.SupplyDelivery convertSupplyDelivery(org.hl7 } static public org.hl7.fhir.dstu2.model.Enumeration convertSupplyDeliveryStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.SupplyDelivery.SupplyDeliveryStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu2.model.SupplyDelivery.SupplyDeliveryStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu2.model.SupplyDelivery.SupplyDeliveryStatus.COMPLETED); - break; - case ABANDONED: - tgt.setValue(org.hl7.fhir.dstu2.model.SupplyDelivery.SupplyDeliveryStatus.ABANDONED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.SupplyDelivery.SupplyDeliveryStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new SupplyDelivery.SupplyDeliveryStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(SupplyDelivery.SupplyDeliveryStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(SupplyDelivery.SupplyDeliveryStatus.COMPLETED); + break; + case ABANDONED: + tgt.setValue(SupplyDelivery.SupplyDeliveryStatus.ABANDONED); + break; + default: + tgt.setValue(SupplyDelivery.SupplyDeliveryStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertSupplyDeliveryStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatusEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus.COMPLETED); - break; - case ABANDONED: - tgt.setValue(org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus.ABANDONED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatusEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus.COMPLETED); + break; + case ABANDONED: + tgt.setValue(org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus.ABANDONED); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertSupplyRequestStatus(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { @@ -99,26 +110,26 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatusEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case REQUESTED: - tgt.setValue(org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus.ACTIVE); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus.COMPLETED); - break; - case FAILED: - tgt.setValue(org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus.CANCELLED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus.CANCELLED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus.NULL); - break; - } - } + tgt.setValue(SupplyRequest.SupplyRequestStatus.ACTIVE); + break; + case COMPLETED: + tgt.setValue(SupplyRequest.SupplyRequestStatus.COMPLETED); + break; + case FAILED: + tgt.setValue(SupplyRequest.SupplyRequestStatus.CANCELLED); + break; + case CANCELLED: + tgt.setValue(SupplyRequest.SupplyRequestStatus.CANCELLED); + break; + default: + tgt.setValue(SupplyRequest.SupplyRequestStatus.NULL); + break; + } +} return tgt; } @@ -127,23 +138,23 @@ static public org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.SupplyRequest.SupplyRequestStatusEnumFactory()); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2.model.SupplyRequest.SupplyRequestStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu2.model.SupplyRequest.SupplyRequestStatus.REQUESTED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu2.model.SupplyRequest.SupplyRequestStatus.COMPLETED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu2.model.SupplyRequest.SupplyRequestStatus.CANCELLED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.SupplyRequest.SupplyRequestStatus.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2.model.SupplyRequest.SupplyRequestStatus.REQUESTED); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.dstu2.model.SupplyRequest.SupplyRequestStatus.COMPLETED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.dstu2.model.SupplyRequest.SupplyRequestStatus.CANCELLED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2.model.SupplyRequest.SupplyRequestStatus.NULL); + break; + } +} return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/TestScript10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/TestScript10_50.java index 6546c5c5d1..c01bbbe667 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/TestScript10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/TestScript10_50.java @@ -13,231 +13,257 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.Integer10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.String10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.Uri10_50; +import org.hl7.fhir.dstu2.model.Enumeration; +import org.hl7.fhir.dstu2.model.TestScript; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CanonicalType; public class TestScript10_50 { static public org.hl7.fhir.dstu2.model.Enumeration convertAssertionDirectionType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.TestScript.AssertionDirectionTypeEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case RESPONSE: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionDirectionType.RESPONSE); - break; - case REQUEST: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionDirectionType.REQUEST); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionDirectionType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new TestScript.AssertionDirectionTypeEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case RESPONSE: + tgt.setValue(TestScript.AssertionDirectionType.RESPONSE); + break; + case REQUEST: + tgt.setValue(TestScript.AssertionDirectionType.REQUEST); + break; + default: + tgt.setValue(TestScript.AssertionDirectionType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertAssertionDirectionType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TestScript.AssertionDirectionTypeEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case RESPONSE: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionDirectionType.RESPONSE); - break; - case REQUEST: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionDirectionType.REQUEST); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionDirectionType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TestScript.AssertionDirectionTypeEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case RESPONSE: + tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionDirectionType.RESPONSE); + break; + case REQUEST: + tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionDirectionType.REQUEST); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionDirectionType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertAssertionOperatorType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorTypeEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case EQUALS: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.EQUALS); - break; - case NOTEQUALS: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.NOTEQUALS); - break; - case IN: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.NOTIN); - break; - case GREATERTHAN: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.GREATERTHAN); - break; - case LESSTHAN: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.LESSTHAN); - break; - case EMPTY: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.EMPTY); - break; - case NOTEMPTY: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.NOTEMPTY); - break; - case CONTAINS: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.CONTAINS); - break; - case NOTCONTAINS: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.NOTCONTAINS); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new TestScript.AssertionOperatorTypeEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUALS: + tgt.setValue(TestScript.AssertionOperatorType.EQUALS); + break; + case NOTEQUALS: + tgt.setValue(TestScript.AssertionOperatorType.NOTEQUALS); + break; + case IN: + tgt.setValue(TestScript.AssertionOperatorType.IN); + break; + case NOTIN: + tgt.setValue(TestScript.AssertionOperatorType.NOTIN); + break; + case GREATERTHAN: + tgt.setValue(TestScript.AssertionOperatorType.GREATERTHAN); + break; + case LESSTHAN: + tgt.setValue(TestScript.AssertionOperatorType.LESSTHAN); + break; + case EMPTY: + tgt.setValue(TestScript.AssertionOperatorType.EMPTY); + break; + case NOTEMPTY: + tgt.setValue(TestScript.AssertionOperatorType.NOTEMPTY); + break; + case CONTAINS: + tgt.setValue(TestScript.AssertionOperatorType.CONTAINS); + break; + case NOTCONTAINS: + tgt.setValue(TestScript.AssertionOperatorType.NOTCONTAINS); + break; + default: + tgt.setValue(TestScript.AssertionOperatorType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertAssertionOperatorType(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TestScript.AssertionOperatorTypeEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case EQUALS: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.EQUALS); - break; - case NOTEQUALS: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NOTEQUALS); - break; - case IN: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NOTIN); - break; - case GREATERTHAN: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.GREATERTHAN); - break; - case LESSTHAN: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.LESSTHAN); - break; - case EMPTY: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.EMPTY); - break; - case NOTEMPTY: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NOTEMPTY); - break; - case CONTAINS: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.CONTAINS); - break; - case NOTCONTAINS: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NOTCONTAINS); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TestScript.AssertionOperatorTypeEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUALS: + tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.EQUALS); + break; + case NOTEQUALS: + tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NOTEQUALS); + break; + case IN: + tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.IN); + break; + case NOTIN: + tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NOTIN); + break; + case GREATERTHAN: + tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.GREATERTHAN); + break; + case LESSTHAN: + tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.LESSTHAN); + break; + case EMPTY: + tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.EMPTY); + break; + case NOTEMPTY: + tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NOTEMPTY); + break; + case CONTAINS: + tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.CONTAINS); + break; + case NOTCONTAINS: + tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NOTCONTAINS); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertAssertionResponseTypes(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TestScript.AssertionResponseTypesEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case OKAY: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.OKAY); - break; - case CREATED: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.CREATED); - break; - case NOCONTENT: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.NOCONTENT); - break; - case NOTMODIFIED: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.NOTMODIFIED); - break; - case BAD: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.BADREQUEST); - break; - case FORBIDDEN: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.FORBIDDEN); - break; - case NOTFOUND: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.NOTFOUND); - break; - case METHODNOTALLOWED: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.METHODNOTALLOWED); - break; - case CONFLICT: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.CONFLICT); - break; - case GONE: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.GONE); - break; - case PRECONDITIONFAILED: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.PRECONDITIONFAILED); - break; - case UNPROCESSABLE: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.UNPROCESSABLECONTENT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TestScript.AssertionResponseTypesEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OKAY: + tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.OKAY); + break; + case CREATED: + tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.CREATED); + break; + case NOCONTENT: + tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.NOCONTENT); + break; + case NOTMODIFIED: + tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.NOTMODIFIED); + break; + case BAD: + tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.BADREQUEST); + break; + case FORBIDDEN: + tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.FORBIDDEN); + break; + case NOTFOUND: + tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.NOTFOUND); + break; + case METHODNOTALLOWED: + tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.METHODNOTALLOWED); + break; + case CONFLICT: + tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.CONFLICT); + break; + case GONE: + tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.GONE); + break; + case PRECONDITIONFAILED: + tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.PRECONDITIONFAILED); + break; + case UNPROCESSABLE: + tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.UNPROCESSABLECONTENT); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2.model.Enumeration convertAssertionResponseTypes(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypesEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case OKAY: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.OKAY); - break; - case CREATED: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.CREATED); - break; - case NOCONTENT: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.NOCONTENT); - break; - case NOTMODIFIED: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.NOTMODIFIED); - break; - case BADREQUEST: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.BAD); - break; - case FORBIDDEN: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.FORBIDDEN); - break; - case NOTFOUND: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.NOTFOUND); - break; - case METHODNOTALLOWED: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.METHODNOTALLOWED); - break; - case CONFLICT: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.CONFLICT); - break; - case GONE: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.GONE); - break; - case PRECONDITIONFAILED: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.PRECONDITIONFAILED); - break; - case UNPROCESSABLECONTENT: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.UNPROCESSABLE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new TestScript.AssertionResponseTypesEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OKAY: + tgt.setValue(TestScript.AssertionResponseTypes.OKAY); + break; + case CREATED: + tgt.setValue(TestScript.AssertionResponseTypes.CREATED); + break; + case NOCONTENT: + tgt.setValue(TestScript.AssertionResponseTypes.NOCONTENT); + break; + case NOTMODIFIED: + tgt.setValue(TestScript.AssertionResponseTypes.NOTMODIFIED); + break; + case BADREQUEST: + tgt.setValue(TestScript.AssertionResponseTypes.BAD); + break; + case FORBIDDEN: + tgt.setValue(TestScript.AssertionResponseTypes.FORBIDDEN); + break; + case NOTFOUND: + tgt.setValue(TestScript.AssertionResponseTypes.NOTFOUND); + break; + case METHODNOTALLOWED: + tgt.setValue(TestScript.AssertionResponseTypes.METHODNOTALLOWED); + break; + case CONFLICT: + tgt.setValue(TestScript.AssertionResponseTypes.CONFLICT); + break; + case GONE: + tgt.setValue(TestScript.AssertionResponseTypes.GONE); + break; + case PRECONDITIONFAILED: + tgt.setValue(TestScript.AssertionResponseTypes.PRECONDITIONFAILED); + break; + case UNPROCESSABLECONTENT: + tgt.setValue(TestScript.AssertionResponseTypes.UNPROCESSABLE); + break; + default: + tgt.setValue(TestScript.AssertionResponseTypes.NULL); + break; + } + } + return tgt; } static public String convertContentType(org.hl7.fhir.dstu2.model.TestScript.ContentType src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/ValueSet10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/ValueSet10_50.java index eb9a8ea16d..43585fb255 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/ValueSet10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/ValueSet10_50.java @@ -15,11 +15,13 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.Integer10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.String10_50; import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.Uri10_50; +import org.hl7.fhir.dstu2.model.Enumeration; import org.hl7.fhir.dstu2.model.ValueSet; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.BooleanType; import org.hl7.fhir.r5.model.CodeSystem; import org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent; +import org.hl7.fhir.r5.model.Enumerations; import org.hl7.fhir.r5.model.Enumerations.CodeSystemContentMode; import org.hl7.fhir.r5.terminologies.CodeSystemUtilities; @@ -142,65 +144,73 @@ public static org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent convertCo } static public org.hl7.fhir.dstu2.model.Enumeration convertFilterOperator(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2.model.Enumeration tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ValueSet.FilterOperatorEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case EQUAL: - tgt.setValue(org.hl7.fhir.dstu2.model.ValueSet.FilterOperator.EQUAL); - break; - case ISA: - tgt.setValue(org.hl7.fhir.dstu2.model.ValueSet.FilterOperator.ISA); - break; - case ISNOTA: - tgt.setValue(org.hl7.fhir.dstu2.model.ValueSet.FilterOperator.ISNOTA); - break; - case REGEX: - tgt.setValue(org.hl7.fhir.dstu2.model.ValueSet.FilterOperator.REGEX); - break; - case IN: - tgt.setValue(org.hl7.fhir.dstu2.model.ValueSet.FilterOperator.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.dstu2.model.ValueSet.FilterOperator.NOTIN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2.model.ValueSet.FilterOperator.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ValueSet.FilterOperatorEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUAL: + tgt.setValue(ValueSet.FilterOperator.EQUAL); + break; + case ISA: + tgt.setValue(ValueSet.FilterOperator.ISA); + break; + case ISNOTA: + tgt.setValue(ValueSet.FilterOperator.ISNOTA); + break; + case REGEX: + tgt.setValue(ValueSet.FilterOperator.REGEX); + break; + case IN: + tgt.setValue(ValueSet.FilterOperator.IN); + break; + case NOTIN: + tgt.setValue(ValueSet.FilterOperator.NOTIN); + break; + default: + tgt.setValue(ValueSet.FilterOperator.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertFilterOperator(org.hl7.fhir.dstu2.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.FilterOperatorEnumFactory()); - ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); - switch (src.getValue()) { - case EQUAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.EQUAL); - break; - case ISA: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.ISA); - break; - case ISNOTA: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.ISNOTA); - break; - case REGEX: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.REGEX); - break; - case IN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.NOTIN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new Enumerations.FilterOperatorEnumFactory()); + ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUAL: + tgt.setValue(Enumerations.FilterOperator.EQUAL); + break; + case ISA: + tgt.setValue(Enumerations.FilterOperator.ISA); + break; + case ISNOTA: + tgt.setValue(Enumerations.FilterOperator.ISNOTA); + break; + case REGEX: + tgt.setValue(Enumerations.FilterOperator.REGEX); + break; + case IN: + tgt.setValue(Enumerations.FilterOperator.IN); + break; + case NOTIN: + tgt.setValue(Enumerations.FilterOperator.NOTIN); + break; + default: + tgt.setValue(Enumerations.FilterOperator.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2.model.ValueSet convertValueSet(org.hl7.fhir.r5.model.ValueSet src, BaseAdvisor_10_50 advisor) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/datatypes14_30/ElementDefinition14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/datatypes14_30/ElementDefinition14_30.java index ab17d2daf2..d32b6c3496 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/datatypes14_30/ElementDefinition14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/datatypes14_30/ElementDefinition14_30.java @@ -120,26 +120,26 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentationEnumFactory()); ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case XMLATTR: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation.XMLATTR); - break; - case XMLTEXT: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation.XMLTEXT); - break; - case TYPEATTR: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation.TYPEATTR); - break; - case CDATEXT: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation.CDATEXT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation.NULL); - break; - } - } + tgt.setValue(ElementDefinition.PropertyRepresentation.XMLATTR); + break; + case XMLTEXT: + tgt.setValue(ElementDefinition.PropertyRepresentation.XMLTEXT); + break; + case TYPEATTR: + tgt.setValue(ElementDefinition.PropertyRepresentation.TYPEATTR); + break; + case CDATEXT: + tgt.setValue(ElementDefinition.PropertyRepresentation.CDATEXT); + break; + default: + tgt.setValue(ElementDefinition.PropertyRepresentation.NULL); + break; + } +} return tgt; } @@ -148,26 +148,26 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.ElementDefinition.PropertyRepresentationEnumFactory()); ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.PropertyRepresentation.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case XMLATTR: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.PropertyRepresentation.XMLATTR); - break; - case XMLTEXT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.PropertyRepresentation.XMLTEXT); - break; - case TYPEATTR: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.PropertyRepresentation.TYPEATTR); - break; - case CDATEXT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.PropertyRepresentation.CDATEXT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.PropertyRepresentation.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.PropertyRepresentation.XMLATTR); + break; + case XMLTEXT: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.PropertyRepresentation.XMLTEXT); + break; + case TYPEATTR: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.PropertyRepresentation.TYPEATTR); + break; + case CDATEXT: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.PropertyRepresentation.CDATEXT); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.PropertyRepresentation.NULL); + break; + } +} return tgt; } @@ -200,23 +200,23 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new ElementDefinition.SlicingRulesEnumFactory()); ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(ElementDefinition.SlicingRules.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CLOSED: - tgt.setValue(ElementDefinition.SlicingRules.CLOSED); - break; - case OPEN: - tgt.setValue(ElementDefinition.SlicingRules.OPEN); - break; - case OPENATEND: - tgt.setValue(ElementDefinition.SlicingRules.OPENATEND); - break; - default: - tgt.setValue(ElementDefinition.SlicingRules.NULL); - break; - } - } + tgt.setValue(ElementDefinition.SlicingRules.CLOSED); + break; + case OPEN: + tgt.setValue(ElementDefinition.SlicingRules.OPEN); + break; + case OPENATEND: + tgt.setValue(ElementDefinition.SlicingRules.OPENATEND); + break; + default: + tgt.setValue(ElementDefinition.SlicingRules.NULL); + break; + } +} return tgt; } @@ -225,23 +225,23 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.ElementDefinition.SlicingRulesEnumFactory()); ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.SlicingRules.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CLOSED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.SlicingRules.CLOSED); - break; - case OPEN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.SlicingRules.OPEN); - break; - case OPENATEND: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.SlicingRules.OPENATEND); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.SlicingRules.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.SlicingRules.CLOSED); + break; + case OPEN: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.SlicingRules.OPEN); + break; + case OPENATEND: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.SlicingRules.OPENATEND); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.SlicingRules.NULL); + break; + } +} return tgt; } @@ -310,23 +310,23 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new ElementDefinition.AggregationModeEnumFactory()); ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(ElementDefinition.AggregationMode.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CONTAINED: - tgt.setValue(ElementDefinition.AggregationMode.CONTAINED); - break; - case REFERENCED: - tgt.setValue(ElementDefinition.AggregationMode.REFERENCED); - break; - case BUNDLED: - tgt.setValue(ElementDefinition.AggregationMode.BUNDLED); - break; - default: - tgt.setValue(ElementDefinition.AggregationMode.NULL); - break; - } - } + tgt.setValue(ElementDefinition.AggregationMode.CONTAINED); + break; + case REFERENCED: + tgt.setValue(ElementDefinition.AggregationMode.REFERENCED); + break; + case BUNDLED: + tgt.setValue(ElementDefinition.AggregationMode.BUNDLED); + break; + default: + tgt.setValue(ElementDefinition.AggregationMode.NULL); + break; + } +} return tgt; } @@ -335,23 +335,23 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.ElementDefinition.AggregationModeEnumFactory()); ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.AggregationMode.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CONTAINED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.AggregationMode.CONTAINED); - break; - case REFERENCED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.AggregationMode.REFERENCED); - break; - case BUNDLED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.AggregationMode.BUNDLED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.AggregationMode.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.AggregationMode.CONTAINED); + break; + case REFERENCED: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.AggregationMode.REFERENCED); + break; + case BUNDLED: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.AggregationMode.BUNDLED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.AggregationMode.NULL); + break; + } +} return tgt; } @@ -360,23 +360,23 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new ElementDefinition.ReferenceVersionRulesEnumFactory()); ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(ElementDefinition.ReferenceVersionRules.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case EITHER: - tgt.setValue(ElementDefinition.ReferenceVersionRules.EITHER); - break; - case INDEPENDENT: - tgt.setValue(ElementDefinition.ReferenceVersionRules.INDEPENDENT); - break; - case SPECIFIC: - tgt.setValue(ElementDefinition.ReferenceVersionRules.SPECIFIC); - break; - default: - tgt.setValue(ElementDefinition.ReferenceVersionRules.NULL); - break; - } - } + tgt.setValue(ElementDefinition.ReferenceVersionRules.EITHER); + break; + case INDEPENDENT: + tgt.setValue(ElementDefinition.ReferenceVersionRules.INDEPENDENT); + break; + case SPECIFIC: + tgt.setValue(ElementDefinition.ReferenceVersionRules.SPECIFIC); + break; + default: + tgt.setValue(ElementDefinition.ReferenceVersionRules.NULL); + break; + } +} return tgt; } @@ -385,23 +385,23 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.ElementDefinition.ReferenceVersionRulesEnumFactory()); ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.ReferenceVersionRules.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case EITHER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.ReferenceVersionRules.EITHER); - break; - case INDEPENDENT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.ReferenceVersionRules.INDEPENDENT); - break; - case SPECIFIC: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.ReferenceVersionRules.SPECIFIC); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.ReferenceVersionRules.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.ReferenceVersionRules.EITHER); + break; + case INDEPENDENT: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.ReferenceVersionRules.INDEPENDENT); + break; + case SPECIFIC: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.ReferenceVersionRules.SPECIFIC); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.ReferenceVersionRules.NULL); + break; + } +} return tgt; } @@ -436,20 +436,20 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new ElementDefinition.ConstraintSeverityEnumFactory()); ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(ElementDefinition.ConstraintSeverity.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case ERROR: - tgt.setValue(ElementDefinition.ConstraintSeverity.ERROR); - break; - case WARNING: - tgt.setValue(ElementDefinition.ConstraintSeverity.WARNING); - break; - default: - tgt.setValue(ElementDefinition.ConstraintSeverity.NULL); - break; - } - } + tgt.setValue(ElementDefinition.ConstraintSeverity.ERROR); + break; + case WARNING: + tgt.setValue(ElementDefinition.ConstraintSeverity.WARNING); + break; + default: + tgt.setValue(ElementDefinition.ConstraintSeverity.NULL); + break; + } +} return tgt; } @@ -458,20 +458,20 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.ElementDefinition.ConstraintSeverityEnumFactory()); ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.ConstraintSeverity.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case ERROR: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.ConstraintSeverity.ERROR); - break; - case WARNING: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.ConstraintSeverity.WARNING); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.ConstraintSeverity.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.ConstraintSeverity.ERROR); + break; + case WARNING: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.ConstraintSeverity.WARNING); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ElementDefinition.ConstraintSeverity.NULL); + break; + } +} return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/datatypes14_30/Narrative14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/datatypes14_30/Narrative14_30.java index 387984c8bd..1461f35aa1 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/datatypes14_30/Narrative14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/datatypes14_30/Narrative14_30.java @@ -1,6 +1,7 @@ package org.hl7.fhir.convertors.conv14_30.datatypes14_30; import org.hl7.fhir.convertors.context.ConversionContext14_30; +import org.hl7.fhir.dstu3.model.Narrative; import org.hl7.fhir.exceptions.FHIRException; public class Narrative14_30 { @@ -27,26 +28,26 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Narrative.NarrativeStatusEnumFactory()); ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case GENERATED: - tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.GENERATED); - break; - case EXTENSIONS: - tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.EXTENSIONS); - break; - case ADDITIONAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.ADDITIONAL); - break; - case EMPTY: - tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.EMPTY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.NULL); - break; - } - } + tgt.setValue(Narrative.NarrativeStatus.GENERATED); + break; + case EXTENSIONS: + tgt.setValue(Narrative.NarrativeStatus.EXTENSIONS); + break; + case ADDITIONAL: + tgt.setValue(Narrative.NarrativeStatus.ADDITIONAL); + break; + case EMPTY: + tgt.setValue(Narrative.NarrativeStatus.EMPTY); + break; + default: + tgt.setValue(Narrative.NarrativeStatus.NULL); + break; + } +} return tgt; } @@ -55,26 +56,26 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Narrative.NarrativeStatusEnumFactory()); ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.Narrative.NarrativeStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case GENERATED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Narrative.NarrativeStatus.GENERATED); - break; - case EXTENSIONS: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Narrative.NarrativeStatus.EXTENSIONS); - break; - case ADDITIONAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Narrative.NarrativeStatus.ADDITIONAL); - break; - case EMPTY: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Narrative.NarrativeStatus.EMPTY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Narrative.NarrativeStatus.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.Narrative.NarrativeStatus.GENERATED); + break; + case EXTENSIONS: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Narrative.NarrativeStatus.EXTENSIONS); + break; + case ADDITIONAL: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Narrative.NarrativeStatus.ADDITIONAL); + break; + case EMPTY: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Narrative.NarrativeStatus.EMPTY); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Narrative.NarrativeStatus.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/datatypes14_30/complextypes14_30/Address14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/datatypes14_30/complextypes14_30/Address14_30.java index 65751b0410..bbb6a226e2 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/datatypes14_30/complextypes14_30/Address14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/datatypes14_30/complextypes14_30/Address14_30.java @@ -2,6 +2,7 @@ import org.hl7.fhir.convertors.context.ConversionContext14_30; import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.String14_30; +import org.hl7.fhir.dstu3.model.Address; import org.hl7.fhir.exceptions.FHIRException; public class Address14_30 { @@ -44,26 +45,26 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Address.AddressUseEnumFactory()); ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HOME: - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.HOME); - break; - case WORK: - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.WORK); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.OLD); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.NULL); - break; - } - } + tgt.setValue(Address.AddressUse.HOME); + break; + case WORK: + tgt.setValue(Address.AddressUse.WORK); + break; + case TEMP: + tgt.setValue(Address.AddressUse.TEMP); + break; + case OLD: + tgt.setValue(Address.AddressUse.OLD); + break; + default: + tgt.setValue(Address.AddressUse.NULL); + break; + } +} return tgt; } @@ -72,26 +73,26 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Address.AddressUseEnumFactory()); ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HOME: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressUse.HOME); - break; - case WORK: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressUse.WORK); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressUse.OLD); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressUse.HOME); + break; + case WORK: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressUse.WORK); + break; + case TEMP: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressUse.TEMP); + break; + case OLD: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressUse.OLD); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressUse.NULL); + break; + } +} return tgt; } @@ -100,23 +101,23 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Address.AddressTypeEnumFactory()); ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case POSTAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressType.POSTAL); - break; - case PHYSICAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressType.PHYSICAL); - break; - case BOTH: - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressType.BOTH); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressType.NULL); - break; - } - } + tgt.setValue(Address.AddressType.POSTAL); + break; + case PHYSICAL: + tgt.setValue(Address.AddressType.PHYSICAL); + break; + case BOTH: + tgt.setValue(Address.AddressType.BOTH); + break; + default: + tgt.setValue(Address.AddressType.NULL); + break; + } +} return tgt; } @@ -125,23 +126,23 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Address.AddressTypeEnumFactory()); ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case POSTAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressType.POSTAL); - break; - case PHYSICAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressType.PHYSICAL); - break; - case BOTH: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressType.BOTH); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressType.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressType.POSTAL); + break; + case PHYSICAL: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressType.PHYSICAL); + break; + case BOTH: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressType.BOTH); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressType.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/datatypes14_30/complextypes14_30/ContactPoint14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/datatypes14_30/complextypes14_30/ContactPoint14_30.java index 912542dc4a..87f252b060 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/datatypes14_30/complextypes14_30/ContactPoint14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/datatypes14_30/complextypes14_30/ContactPoint14_30.java @@ -3,6 +3,7 @@ import org.hl7.fhir.convertors.context.ConversionContext14_30; import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.PositiveInt14_30; import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.String14_30; +import org.hl7.fhir.dstu3.model.ContactPoint; import org.hl7.fhir.exceptions.FHIRException; public class ContactPoint14_30 { @@ -35,29 +36,29 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystemEnumFactory()); ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case PHONE: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.PHONE); - break; - case FAX: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.FAX); - break; - case EMAIL: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.EMAIL); - break; - case PAGER: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.PAGER); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.URL); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.NULL); - break; - } - } + tgt.setValue(ContactPoint.ContactPointSystem.PHONE); + break; + case FAX: + tgt.setValue(ContactPoint.ContactPointSystem.FAX); + break; + case EMAIL: + tgt.setValue(ContactPoint.ContactPointSystem.EMAIL); + break; + case PAGER: + tgt.setValue(ContactPoint.ContactPointSystem.PAGER); + break; + case OTHER: + tgt.setValue(ContactPoint.ContactPointSystem.URL); + break; + default: + tgt.setValue(ContactPoint.ContactPointSystem.NULL); + break; + } +} return tgt; } @@ -66,29 +67,29 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystemEnumFactory()); ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case PHONE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem.PHONE); - break; - case FAX: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem.FAX); - break; - case EMAIL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem.EMAIL); - break; - case PAGER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem.PAGER); - break; - case URL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem.PHONE); + break; + case FAX: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem.FAX); + break; + case EMAIL: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem.EMAIL); + break; + case PAGER: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem.PAGER); + break; + case URL: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem.OTHER); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem.NULL); + break; + } +} return tgt; } @@ -97,29 +98,29 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUseEnumFactory()); ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HOME: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.HOME); - break; - case WORK: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.WORK); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.OLD); - break; - case MOBILE: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.MOBILE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.NULL); - break; - } - } + tgt.setValue(ContactPoint.ContactPointUse.HOME); + break; + case WORK: + tgt.setValue(ContactPoint.ContactPointUse.WORK); + break; + case TEMP: + tgt.setValue(ContactPoint.ContactPointUse.TEMP); + break; + case OLD: + tgt.setValue(ContactPoint.ContactPointUse.OLD); + break; + case MOBILE: + tgt.setValue(ContactPoint.ContactPointUse.MOBILE); + break; + default: + tgt.setValue(ContactPoint.ContactPointUse.NULL); + break; + } +} return tgt; } @@ -128,29 +129,29 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUseEnumFactory()); ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HOME: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUse.HOME); - break; - case WORK: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUse.WORK); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUse.OLD); - break; - case MOBILE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUse.MOBILE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUse.HOME); + break; + case WORK: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUse.WORK); + break; + case TEMP: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUse.TEMP); + break; + case OLD: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUse.OLD); + break; + case MOBILE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUse.MOBILE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUse.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/datatypes14_30/complextypes14_30/HumanName14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/datatypes14_30/complextypes14_30/HumanName14_30.java index 7f16bc7c35..c493f3c795 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/datatypes14_30/complextypes14_30/HumanName14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/datatypes14_30/complextypes14_30/HumanName14_30.java @@ -2,6 +2,7 @@ import org.hl7.fhir.convertors.context.ConversionContext14_30; import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.String14_30; +import org.hl7.fhir.dstu3.model.HumanName; import org.hl7.fhir.exceptions.FHIRException; public class HumanName14_30 { @@ -38,35 +39,35 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.HumanName.NameUseEnumFactory()); ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case USUAL: - tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.USUAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.OFFICIAL); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.TEMP); - break; - case NICKNAME: - tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.NICKNAME); - break; - case ANONYMOUS: - tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.ANONYMOUS); - break; - case OLD: - tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.OLD); - break; - case MAIDEN: - tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.MAIDEN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.NULL); - break; - } - } + tgt.setValue(HumanName.NameUse.USUAL); + break; + case OFFICIAL: + tgt.setValue(HumanName.NameUse.OFFICIAL); + break; + case TEMP: + tgt.setValue(HumanName.NameUse.TEMP); + break; + case NICKNAME: + tgt.setValue(HumanName.NameUse.NICKNAME); + break; + case ANONYMOUS: + tgt.setValue(HumanName.NameUse.ANONYMOUS); + break; + case OLD: + tgt.setValue(HumanName.NameUse.OLD); + break; + case MAIDEN: + tgt.setValue(HumanName.NameUse.MAIDEN); + break; + default: + tgt.setValue(HumanName.NameUse.NULL); + break; + } +} return tgt; } @@ -75,35 +76,35 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.HumanName.NameUseEnumFactory()); ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case USUAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.USUAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.OFFICIAL); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.TEMP); - break; - case NICKNAME: - tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.NICKNAME); - break; - case ANONYMOUS: - tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.ANONYMOUS); - break; - case OLD: - tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.OLD); - break; - case MAIDEN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.MAIDEN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.USUAL); + break; + case OFFICIAL: + tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.OFFICIAL); + break; + case TEMP: + tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.TEMP); + break; + case NICKNAME: + tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.NICKNAME); + break; + case ANONYMOUS: + tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.ANONYMOUS); + break; + case OLD: + tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.OLD); + break; + case MAIDEN: + tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.MAIDEN); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/datatypes14_30/complextypes14_30/Identifier14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/datatypes14_30/complextypes14_30/Identifier14_30.java index a3a05dbd2c..ffb09347af 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/datatypes14_30/complextypes14_30/Identifier14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/datatypes14_30/complextypes14_30/Identifier14_30.java @@ -4,6 +4,7 @@ import org.hl7.fhir.convertors.conv14_30.datatypes14_30.Reference14_30; import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.String14_30; import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.Uri14_30; +import org.hl7.fhir.dstu3.model.Identifier; import org.hl7.fhir.exceptions.FHIRException; public class Identifier14_30 { @@ -38,26 +39,26 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Identifier.IdentifierUseEnumFactory()); ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case USUAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.USUAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.OFFICIAL); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.TEMP); - break; - case SECONDARY: - tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.SECONDARY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.NULL); - break; - } - } + tgt.setValue(Identifier.IdentifierUse.USUAL); + break; + case OFFICIAL: + tgt.setValue(Identifier.IdentifierUse.OFFICIAL); + break; + case TEMP: + tgt.setValue(Identifier.IdentifierUse.TEMP); + break; + case SECONDARY: + tgt.setValue(Identifier.IdentifierUse.SECONDARY); + break; + default: + tgt.setValue(Identifier.IdentifierUse.NULL); + break; + } +} return tgt; } @@ -66,26 +67,26 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Identifier.IdentifierUseEnumFactory()); ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.Identifier.IdentifierUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case USUAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Identifier.IdentifierUse.USUAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Identifier.IdentifierUse.OFFICIAL); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Identifier.IdentifierUse.TEMP); - break; - case SECONDARY: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Identifier.IdentifierUse.SECONDARY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Identifier.IdentifierUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.Identifier.IdentifierUse.USUAL); + break; + case OFFICIAL: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Identifier.IdentifierUse.OFFICIAL); + break; + case TEMP: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Identifier.IdentifierUse.TEMP); + break; + case SECONDARY: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Identifier.IdentifierUse.SECONDARY); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Identifier.IdentifierUse.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/datatypes14_30/complextypes14_30/Quantity14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/datatypes14_30/complextypes14_30/Quantity14_30.java index f9aecfd2df..f094300176 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/datatypes14_30/complextypes14_30/Quantity14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/datatypes14_30/complextypes14_30/Quantity14_30.java @@ -5,6 +5,7 @@ import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.Decimal14_30; import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.String14_30; import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.Uri14_30; +import org.hl7.fhir.dstu3.model.Quantity; import org.hl7.fhir.exceptions.FHIRException; public class Quantity14_30 { @@ -37,26 +38,26 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Quantity.QuantityComparatorEnumFactory()); ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Quantity.QuantityComparator.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case LESS_THAN: - tgt.setValue(org.hl7.fhir.dstu3.model.Quantity.QuantityComparator.LESS_THAN); - break; - case LESS_OR_EQUAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Quantity.QuantityComparator.LESS_OR_EQUAL); - break; - case GREATER_OR_EQUAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Quantity.QuantityComparator.GREATER_OR_EQUAL); - break; - case GREATER_THAN: - tgt.setValue(org.hl7.fhir.dstu3.model.Quantity.QuantityComparator.GREATER_THAN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Quantity.QuantityComparator.NULL); - break; - } - } + tgt.setValue(Quantity.QuantityComparator.LESS_THAN); + break; + case LESS_OR_EQUAL: + tgt.setValue(Quantity.QuantityComparator.LESS_OR_EQUAL); + break; + case GREATER_OR_EQUAL: + tgt.setValue(Quantity.QuantityComparator.GREATER_OR_EQUAL); + break; + case GREATER_THAN: + tgt.setValue(Quantity.QuantityComparator.GREATER_THAN); + break; + default: + tgt.setValue(Quantity.QuantityComparator.NULL); + break; + } +} return tgt; } @@ -65,26 +66,26 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Quantity.QuantityComparatorEnumFactory()); ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.Quantity.QuantityComparator.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case LESS_THAN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Quantity.QuantityComparator.LESS_THAN); - break; - case LESS_OR_EQUAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Quantity.QuantityComparator.LESS_OR_EQUAL); - break; - case GREATER_OR_EQUAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Quantity.QuantityComparator.GREATER_OR_EQUAL); - break; - case GREATER_THAN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Quantity.QuantityComparator.GREATER_THAN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Quantity.QuantityComparator.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.Quantity.QuantityComparator.LESS_THAN); + break; + case LESS_OR_EQUAL: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Quantity.QuantityComparator.LESS_OR_EQUAL); + break; + case GREATER_OR_EQUAL: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Quantity.QuantityComparator.GREATER_OR_EQUAL); + break; + case GREATER_THAN: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Quantity.QuantityComparator.GREATER_THAN); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Quantity.QuantityComparator.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/datatypes14_30/complextypes14_30/Timing14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/datatypes14_30/complextypes14_30/Timing14_30.java index 2aa610ba69..77014cfd91 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/datatypes14_30/complextypes14_30/Timing14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/datatypes14_30/complextypes14_30/Timing14_30.java @@ -6,6 +6,7 @@ import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.Decimal14_30; import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.Integer14_30; import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.UnsignedInt14_30; +import org.hl7.fhir.dstu3.model.Timing; import org.hl7.fhir.exceptions.FHIRException; public class Timing14_30 { @@ -76,35 +77,35 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Timing.UnitsOfTimeEnumFactory()); ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case S: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.S); - break; - case MIN: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.MIN); - break; - case H: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.H); - break; - case D: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.D); - break; - case WK: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.WK); - break; - case MO: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.MO); - break; - case A: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.A); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.NULL); - break; - } - } + tgt.setValue(Timing.UnitsOfTime.S); + break; + case MIN: + tgt.setValue(Timing.UnitsOfTime.MIN); + break; + case H: + tgt.setValue(Timing.UnitsOfTime.H); + break; + case D: + tgt.setValue(Timing.UnitsOfTime.D); + break; + case WK: + tgt.setValue(Timing.UnitsOfTime.WK); + break; + case MO: + tgt.setValue(Timing.UnitsOfTime.MO); + break; + case A: + tgt.setValue(Timing.UnitsOfTime.A); + break; + default: + tgt.setValue(Timing.UnitsOfTime.NULL); + break; + } +} return tgt; } @@ -113,35 +114,35 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTimeEnumFactory()); ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case S: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.S); - break; - case MIN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.MIN); - break; - case H: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.H); - break; - case D: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.D); - break; - case WK: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.WK); - break; - case MO: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.MO); - break; - case A: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.A); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.S); + break; + case MIN: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.MIN); + break; + case H: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.H); + break; + case D: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.D); + break; + case WK: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.WK); + break; + case MO: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.MO); + break; + case A: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.A); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.NULL); + break; + } +} return tgt; } @@ -150,56 +151,56 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Timing.EventTimingEnumFactory()); ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HS: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.HS); - break; - case WAKE: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.WAKE); - break; - case C: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.C); - break; - case CM: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.CM); - break; - case CD: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.CD); - break; - case CV: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.CV); - break; - case AC: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.AC); - break; - case ACM: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.ACM); - break; - case ACD: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.ACD); - break; - case ACV: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.ACV); - break; - case PC: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.PC); - break; - case PCM: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.PCM); - break; - case PCD: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.PCD); - break; - case PCV: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.PCV); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.NULL); - break; - } - } + tgt.setValue(Timing.EventTiming.HS); + break; + case WAKE: + tgt.setValue(Timing.EventTiming.WAKE); + break; + case C: + tgt.setValue(Timing.EventTiming.C); + break; + case CM: + tgt.setValue(Timing.EventTiming.CM); + break; + case CD: + tgt.setValue(Timing.EventTiming.CD); + break; + case CV: + tgt.setValue(Timing.EventTiming.CV); + break; + case AC: + tgt.setValue(Timing.EventTiming.AC); + break; + case ACM: + tgt.setValue(Timing.EventTiming.ACM); + break; + case ACD: + tgt.setValue(Timing.EventTiming.ACD); + break; + case ACV: + tgt.setValue(Timing.EventTiming.ACV); + break; + case PC: + tgt.setValue(Timing.EventTiming.PC); + break; + case PCM: + tgt.setValue(Timing.EventTiming.PCM); + break; + case PCD: + tgt.setValue(Timing.EventTiming.PCD); + break; + case PCV: + tgt.setValue(Timing.EventTiming.PCV); + break; + default: + tgt.setValue(Timing.EventTiming.NULL); + break; + } +} return tgt; } @@ -208,56 +209,56 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Timing.EventTimingEnumFactory()); ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HS: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.HS); - break; - case WAKE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.WAKE); - break; - case C: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.C); - break; - case CM: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.CM); - break; - case CD: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.CD); - break; - case CV: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.CV); - break; - case AC: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.AC); - break; - case ACM: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.ACM); - break; - case ACD: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.ACD); - break; - case ACV: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.ACV); - break; - case PC: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.PC); - break; - case PCM: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.PCM); - break; - case PCD: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.PCD); - break; - case PCV: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.PCV); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.HS); + break; + case WAKE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.WAKE); + break; + case C: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.C); + break; + case CM: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.CM); + break; + case CD: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.CD); + break; + case CV: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.CV); + break; + case AC: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.AC); + break; + case ACM: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.ACM); + break; + case ACD: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.ACD); + break; + case ACV: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.ACV); + break; + case PC: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.PC); + break; + case PCM: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.PCM); + break; + case PCD: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.PCD); + break; + case PCV: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.PCV); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/Bundle14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/Bundle14_30.java index eeb1784529..0e3e8824ed 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/Bundle14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/Bundle14_30.java @@ -7,6 +7,8 @@ import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.String14_30; import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.UnsignedInt14_30; import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.Uri14_30; +import org.hl7.fhir.dstu3.model.Bundle; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; public class Bundle14_30 { @@ -208,176 +210,200 @@ public static org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent convertBundleL } static public org.hl7.fhir.dstu3.model.Enumeration convertBundleType(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Bundle.BundleTypeEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case DOCUMENT: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.DOCUMENT); - break; - case MESSAGE: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.MESSAGE); - break; - case TRANSACTION: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.TRANSACTION); - break; - case TRANSACTIONRESPONSE: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.TRANSACTIONRESPONSE); - break; - case BATCH: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.BATCH); - break; - case BATCHRESPONSE: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.BATCHRESPONSE); - break; - case HISTORY: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.HISTORY); - break; - case SEARCHSET: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.SEARCHSET); - break; - case COLLECTION: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.COLLECTION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Bundle.BundleTypeEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DOCUMENT: + tgt.setValue(Bundle.BundleType.DOCUMENT); + break; + case MESSAGE: + tgt.setValue(Bundle.BundleType.MESSAGE); + break; + case TRANSACTION: + tgt.setValue(Bundle.BundleType.TRANSACTION); + break; + case TRANSACTIONRESPONSE: + tgt.setValue(Bundle.BundleType.TRANSACTIONRESPONSE); + break; + case BATCH: + tgt.setValue(Bundle.BundleType.BATCH); + break; + case BATCHRESPONSE: + tgt.setValue(Bundle.BundleType.BATCHRESPONSE); + break; + case HISTORY: + tgt.setValue(Bundle.BundleType.HISTORY); + break; + case SEARCHSET: + tgt.setValue(Bundle.BundleType.SEARCHSET); + break; + case COLLECTION: + tgt.setValue(Bundle.BundleType.COLLECTION); + break; + default: + tgt.setValue(Bundle.BundleType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertBundleType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Bundle.BundleTypeEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case DOCUMENT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.DOCUMENT); - break; - case MESSAGE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.MESSAGE); - break; - case TRANSACTION: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.TRANSACTION); - break; - case TRANSACTIONRESPONSE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.TRANSACTIONRESPONSE); - break; - case BATCH: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.BATCH); - break; - case BATCHRESPONSE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.BATCHRESPONSE); - break; - case HISTORY: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.HISTORY); - break; - case SEARCHSET: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.SEARCHSET); - break; - case COLLECTION: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.COLLECTION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Bundle.BundleTypeEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DOCUMENT: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.DOCUMENT); + break; + case MESSAGE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.MESSAGE); + break; + case TRANSACTION: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.TRANSACTION); + break; + case TRANSACTIONRESPONSE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.TRANSACTIONRESPONSE); + break; + case BATCH: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.BATCH); + break; + case BATCHRESPONSE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.BATCHRESPONSE); + break; + case HISTORY: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.HISTORY); + break; + case SEARCHSET: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.SEARCHSET); + break; + case COLLECTION: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.COLLECTION); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertHTTPVerb(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Bundle.HTTPVerbEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case GET: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.HTTPVerb.GET); - break; - case POST: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.HTTPVerb.POST); - break; - case PUT: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.HTTPVerb.PUT); - break; - case DELETE: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.HTTPVerb.DELETE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.HTTPVerb.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Bundle.HTTPVerbEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case GET: + tgt.setValue(Bundle.HTTPVerb.GET); + break; + case POST: + tgt.setValue(Bundle.HTTPVerb.POST); + break; + case PUT: + tgt.setValue(Bundle.HTTPVerb.PUT); + break; + case DELETE: + tgt.setValue(Bundle.HTTPVerb.DELETE); + break; + default: + tgt.setValue(Bundle.HTTPVerb.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertHTTPVerb(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Bundle.HTTPVerbEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case GET: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.HTTPVerb.GET); - break; - case POST: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.HTTPVerb.POST); - break; - case PUT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.HTTPVerb.PUT); - break; - case DELETE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.HTTPVerb.DELETE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.HTTPVerb.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Bundle.HTTPVerbEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case GET: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.HTTPVerb.GET); + break; + case POST: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.HTTPVerb.POST); + break; + case PUT: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.HTTPVerb.PUT); + break; + case DELETE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.HTTPVerb.DELETE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.HTTPVerb.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertSearchEntryMode(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Bundle.SearchEntryModeEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case MATCH: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.SearchEntryMode.MATCH); - break; - case INCLUDE: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.SearchEntryMode.INCLUDE); - break; - case OUTCOME: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.SearchEntryMode.OUTCOME); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.SearchEntryMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Bundle.SearchEntryModeEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MATCH: + tgt.setValue(Bundle.SearchEntryMode.MATCH); + break; + case INCLUDE: + tgt.setValue(Bundle.SearchEntryMode.INCLUDE); + break; + case OUTCOME: + tgt.setValue(Bundle.SearchEntryMode.OUTCOME); + break; + default: + tgt.setValue(Bundle.SearchEntryMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertSearchEntryMode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Bundle.SearchEntryModeEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case MATCH: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.SearchEntryMode.MATCH); - break; - case INCLUDE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.SearchEntryMode.INCLUDE); - break; - case OUTCOME: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.SearchEntryMode.OUTCOME); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.SearchEntryMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Bundle.SearchEntryModeEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MATCH: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.SearchEntryMode.MATCH); + break; + case INCLUDE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.SearchEntryMode.INCLUDE); + break; + case OUTCOME: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.SearchEntryMode.OUTCOME); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.SearchEntryMode.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/CodeSystem14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/CodeSystem14_30.java index 1699684531..8e9e699795 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/CodeSystem14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/CodeSystem14_30.java @@ -154,53 +154,61 @@ public static org.hl7.fhir.dstu3.model.ContactDetail convertCodeSystemContactCom } static public org.hl7.fhir.dstu2016may.model.Enumeration convertCodeSystemContentMode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContentModeEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case NOTPRESENT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContentMode.NOTPRESENT); - break; - case EXAMPLE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContentMode.EXAMPLAR); - break; - case FRAGMENT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContentMode.FRAGMENT); - break; - case COMPLETE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContentMode.COMPLETE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContentMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContentModeEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTPRESENT: + tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContentMode.NOTPRESENT); + break; + case EXAMPLE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContentMode.EXAMPLAR); + break; + case FRAGMENT: + tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContentMode.FRAGMENT); + break; + case COMPLETE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContentMode.COMPLETE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContentMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertCodeSystemContentMode(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemContentModeEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case NOTPRESENT: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemContentMode.NOTPRESENT); - break; - case EXAMPLAR: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemContentMode.EXAMPLE); - break; - case FRAGMENT: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemContentMode.FRAGMENT); - break; - case COMPLETE: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemContentMode.COMPLETE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemContentMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CodeSystem.CodeSystemContentModeEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTPRESENT: + tgt.setValue(CodeSystem.CodeSystemContentMode.NOTPRESENT); + break; + case EXAMPLAR: + tgt.setValue(CodeSystem.CodeSystemContentMode.EXAMPLE); + break; + case FRAGMENT: + tgt.setValue(CodeSystem.CodeSystemContentMode.FRAGMENT); + break; + case COMPLETE: + tgt.setValue(CodeSystem.CodeSystemContentMode.COMPLETE); + break; + default: + tgt.setValue(CodeSystem.CodeSystemContentMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemFilterComponent convertCodeSystemFilterComponent(org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemFilterComponent src) throws FHIRException { @@ -358,64 +366,72 @@ public static org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemPropertyCompon } static public org.hl7.fhir.dstu3.model.Enumeration convertPropertyType(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CodeSystem.PropertyTypeEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case CODE: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.PropertyType.CODE); - break; - case CODING: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.PropertyType.CODING); - break; - case STRING: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.PropertyType.STRING); - break; - case INTEGER: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.PropertyType.INTEGER); - break; - case BOOLEAN: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.PropertyType.BOOLEAN); - break; - case DATETIME: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.PropertyType.DATETIME); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.PropertyType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CodeSystem.PropertyTypeEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CODE: + tgt.setValue(CodeSystem.PropertyType.CODE); + break; + case CODING: + tgt.setValue(CodeSystem.PropertyType.CODING); + break; + case STRING: + tgt.setValue(CodeSystem.PropertyType.STRING); + break; + case INTEGER: + tgt.setValue(CodeSystem.PropertyType.INTEGER); + break; + case BOOLEAN: + tgt.setValue(CodeSystem.PropertyType.BOOLEAN); + break; + case DATETIME: + tgt.setValue(CodeSystem.PropertyType.DATETIME); + break; + default: + tgt.setValue(CodeSystem.PropertyType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertPropertyType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyTypeEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case CODE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.CODE); - break; - case CODING: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.CODING); - break; - case STRING: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.STRING); - break; - case INTEGER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.INTEGER); - break; - case BOOLEAN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.BOOLEAN); - break; - case DATETIME: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.DATETIME); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyTypeEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CODE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.CODE); + break; + case CODING: + tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.CODING); + break; + case STRING: + tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.STRING); + break; + case INTEGER: + tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.INTEGER); + break; + case BOOLEAN: + tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.BOOLEAN); + break; + case DATETIME: + tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.DATETIME); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/CompartmentDefinition14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/CompartmentDefinition14_30.java index f39ddd9e1e..643f00789a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/CompartmentDefinition14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/CompartmentDefinition14_30.java @@ -7,6 +7,8 @@ import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.DateTime14_30; import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.String14_30; import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.Uri14_30; +import org.hl7.fhir.dstu3.model.CompartmentDefinition; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; public class CompartmentDefinition14_30 { @@ -126,58 +128,66 @@ public static org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentDe } static public org.hl7.fhir.dstu3.model.Enumeration convertCompartmentType(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CompartmentDefinition.CompartmentTypeEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case PATIENT: - tgt.setValue(org.hl7.fhir.dstu3.model.CompartmentDefinition.CompartmentType.PATIENT); - break; - case ENCOUNTER: - tgt.setValue(org.hl7.fhir.dstu3.model.CompartmentDefinition.CompartmentType.ENCOUNTER); - break; - case RELATEDPERSON: - tgt.setValue(org.hl7.fhir.dstu3.model.CompartmentDefinition.CompartmentType.RELATEDPERSON); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.dstu3.model.CompartmentDefinition.CompartmentType.PRACTITIONER); - break; - case DEVICE: - tgt.setValue(org.hl7.fhir.dstu3.model.CompartmentDefinition.CompartmentType.DEVICE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CompartmentDefinition.CompartmentType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CompartmentDefinition.CompartmentTypeEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PATIENT: + tgt.setValue(CompartmentDefinition.CompartmentType.PATIENT); + break; + case ENCOUNTER: + tgt.setValue(CompartmentDefinition.CompartmentType.ENCOUNTER); + break; + case RELATEDPERSON: + tgt.setValue(CompartmentDefinition.CompartmentType.RELATEDPERSON); + break; + case PRACTITIONER: + tgt.setValue(CompartmentDefinition.CompartmentType.PRACTITIONER); + break; + case DEVICE: + tgt.setValue(CompartmentDefinition.CompartmentType.DEVICE); + break; + default: + tgt.setValue(CompartmentDefinition.CompartmentType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertCompartmentType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentTypeEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case PATIENT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentType.PATIENT); - break; - case ENCOUNTER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentType.ENCOUNTER); - break; - case RELATEDPERSON: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentType.RELATEDPERSON); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentType.PRACTITIONER); - break; - case DEVICE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentType.DEVICE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentTypeEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PATIENT: + tgt.setValue(org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentType.PATIENT); + break; + case ENCOUNTER: + tgt.setValue(org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentType.ENCOUNTER); + break; + case RELATEDPERSON: + tgt.setValue(org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentType.RELATEDPERSON); + break; + case PRACTITIONER: + tgt.setValue(org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentType.PRACTITIONER); + break; + case DEVICE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentType.DEVICE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/ConceptMap14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/ConceptMap14_30.java index 1eabef9fef..402f2144ae 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/ConceptMap14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/ConceptMap14_30.java @@ -14,6 +14,8 @@ import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.DateTime14_30; import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.String14_30; import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.Uri14_30; +import org.hl7.fhir.dstu2016may.model.Enumeration; +import org.hl7.fhir.dstu2016may.model.Enumerations; import org.hl7.fhir.dstu3.model.ConceptMap; import org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupComponent; import org.hl7.fhir.exceptions.FHIRException; @@ -135,83 +137,91 @@ public static org.hl7.fhir.dstu3.model.ContactDetail convertConceptMapContactCom } static public org.hl7.fhir.dstu2016may.model.Enumeration convertConceptMapEquivalence(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalenceEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case EQUIVALENT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence.EQUIVALENT); - break; - case EQUAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence.EQUAL); - break; - case WIDER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence.WIDER); - break; - case SUBSUMES: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence.SUBSUMES); - break; - case NARROWER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence.NARROWER); - break; - case SPECIALIZES: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence.SPECIALIZES); - break; - case INEXACT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence.INEXACT); - break; - case UNMATCHED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence.UNMATCHED); - break; - case DISJOINT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence.DISJOINT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ConceptMapEquivalenceEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUIVALENT: + tgt.setValue(Enumerations.ConceptMapEquivalence.EQUIVALENT); + break; + case EQUAL: + tgt.setValue(Enumerations.ConceptMapEquivalence.EQUAL); + break; + case WIDER: + tgt.setValue(Enumerations.ConceptMapEquivalence.WIDER); + break; + case SUBSUMES: + tgt.setValue(Enumerations.ConceptMapEquivalence.SUBSUMES); + break; + case NARROWER: + tgt.setValue(Enumerations.ConceptMapEquivalence.NARROWER); + break; + case SPECIALIZES: + tgt.setValue(Enumerations.ConceptMapEquivalence.SPECIALIZES); + break; + case INEXACT: + tgt.setValue(Enumerations.ConceptMapEquivalence.INEXACT); + break; + case UNMATCHED: + tgt.setValue(Enumerations.ConceptMapEquivalence.UNMATCHED); + break; + case DISJOINT: + tgt.setValue(Enumerations.ConceptMapEquivalence.DISJOINT); + break; + default: + tgt.setValue(Enumerations.ConceptMapEquivalence.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertConceptMapEquivalence(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalenceEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case EQUIVALENT: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.EQUIVALENT); - break; - case EQUAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.EQUAL); - break; - case WIDER: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.WIDER); - break; - case SUBSUMES: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.SUBSUMES); - break; - case NARROWER: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.NARROWER); - break; - case SPECIALIZES: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.SPECIALIZES); - break; - case INEXACT: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.INEXACT); - break; - case UNMATCHED: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.UNMATCHED); - break; - case DISJOINT: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.DISJOINT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalenceEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUIVALENT: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.EQUIVALENT); + break; + case EQUAL: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.EQUAL); + break; + case WIDER: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.WIDER); + break; + case SUBSUMES: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.SUBSUMES); + break; + case NARROWER: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.NARROWER); + break; + case SPECIALIZES: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.SPECIALIZES); + break; + case INEXACT: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.INEXACT); + break; + case UNMATCHED: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.UNMATCHED); + break; + case DISJOINT: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.DISJOINT); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2016may.model.ConceptMap.OtherElementComponent convertOtherElementComponent(org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/Conformance14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/Conformance14_30.java index 357251ad3e..017e0934fa 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/Conformance14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/Conformance14_30.java @@ -13,52 +13,63 @@ import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.String14_30; import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.UnsignedInt14_30; import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.Uri14_30; +import org.hl7.fhir.dstu2016may.model.Conformance; +import org.hl7.fhir.dstu3.model.CapabilityStatement; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; public class Conformance14_30 { static public org.hl7.fhir.dstu3.model.Enumeration convertConditionalDeleteStatus(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalDeleteStatusEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalDeleteStatus.NOTSUPPORTED); - break; - case SINGLE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalDeleteStatus.SINGLE); - break; - case MULTIPLE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalDeleteStatus.MULTIPLE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalDeleteStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CapabilityStatement.ConditionalDeleteStatusEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTSUPPORTED: + tgt.setValue(CapabilityStatement.ConditionalDeleteStatus.NOTSUPPORTED); + break; + case SINGLE: + tgt.setValue(CapabilityStatement.ConditionalDeleteStatus.SINGLE); + break; + case MULTIPLE: + tgt.setValue(CapabilityStatement.ConditionalDeleteStatus.MULTIPLE); + break; + default: + tgt.setValue(CapabilityStatement.ConditionalDeleteStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertConditionalDeleteStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Conformance.ConditionalDeleteStatusEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ConditionalDeleteStatus.NOTSUPPORTED); - break; - case SINGLE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ConditionalDeleteStatus.SINGLE); - break; - case MULTIPLE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ConditionalDeleteStatus.MULTIPLE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ConditionalDeleteStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new Conformance.ConditionalDeleteStatusEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTSUPPORTED: + tgt.setValue(Conformance.ConditionalDeleteStatus.NOTSUPPORTED); + break; + case SINGLE: + tgt.setValue(Conformance.ConditionalDeleteStatus.SINGLE); + break; + case MULTIPLE: + tgt.setValue(Conformance.ConditionalDeleteStatus.MULTIPLE); + break; + default: + tgt.setValue(Conformance.ConditionalDeleteStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2016may.model.Conformance convertConformance(org.hl7.fhir.dstu3.model.CapabilityStatement src) throws FHIRException { @@ -221,41 +232,49 @@ public static org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementDo } static public org.hl7.fhir.dstu3.model.Enumeration convertConformanceEventMode(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.EventCapabilityModeEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case SENDER: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.EventCapabilityMode.SENDER); - break; - case RECEIVER: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.EventCapabilityMode.RECEIVER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.EventCapabilityMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CapabilityStatement.EventCapabilityModeEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SENDER: + tgt.setValue(CapabilityStatement.EventCapabilityMode.SENDER); + break; + case RECEIVER: + tgt.setValue(CapabilityStatement.EventCapabilityMode.RECEIVER); + break; + default: + tgt.setValue(CapabilityStatement.EventCapabilityMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertConformanceEventMode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Conformance.ConformanceEventModeEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case SENDER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ConformanceEventMode.SENDER); - break; - case RECEIVER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ConformanceEventMode.RECEIVER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ConformanceEventMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new Conformance.ConformanceEventModeEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SENDER: + tgt.setValue(Conformance.ConformanceEventMode.SENDER); + break; + case RECEIVER: + tgt.setValue(Conformance.ConformanceEventMode.RECEIVER); + break; + default: + tgt.setValue(Conformance.ConformanceEventMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2016may.model.Conformance.ConformanceImplementationComponent convertConformanceImplementationComponent(org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementImplementationComponent src) throws FHIRException { @@ -629,129 +648,153 @@ public static org.hl7.fhir.dstu2016may.model.Conformance.ConformanceSoftwareComp } static public org.hl7.fhir.dstu2016may.model.Enumeration convertConformanceStatementKind(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Conformance.ConformanceStatementKindEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ConformanceStatementKind.INSTANCE); - break; - case CAPABILITY: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ConformanceStatementKind.CAPABILITY); - break; - case REQUIREMENTS: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ConformanceStatementKind.REQUIREMENTS); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ConformanceStatementKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new Conformance.ConformanceStatementKindEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(Conformance.ConformanceStatementKind.INSTANCE); + break; + case CAPABILITY: + tgt.setValue(Conformance.ConformanceStatementKind.CAPABILITY); + break; + case REQUIREMENTS: + tgt.setValue(Conformance.ConformanceStatementKind.REQUIREMENTS); + break; + default: + tgt.setValue(Conformance.ConformanceStatementKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertConformanceStatementKind(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementKindEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementKind.INSTANCE); - break; - case CAPABILITY: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementKind.CAPABILITY); - break; - case REQUIREMENTS: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementKind.REQUIREMENTS); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CapabilityStatement.CapabilityStatementKindEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(CapabilityStatement.CapabilityStatementKind.INSTANCE); + break; + case CAPABILITY: + tgt.setValue(CapabilityStatement.CapabilityStatementKind.CAPABILITY); + break; + case REQUIREMENTS: + tgt.setValue(CapabilityStatement.CapabilityStatementKind.REQUIREMENTS); + break; + default: + tgt.setValue(CapabilityStatement.CapabilityStatementKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertDocumentMode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Conformance.DocumentModeEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case PRODUCER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.DocumentMode.PRODUCER); - break; - case CONSUMER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.DocumentMode.CONSUMER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.DocumentMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new Conformance.DocumentModeEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRODUCER: + tgt.setValue(Conformance.DocumentMode.PRODUCER); + break; + case CONSUMER: + tgt.setValue(Conformance.DocumentMode.CONSUMER); + break; + default: + tgt.setValue(Conformance.DocumentMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertDocumentMode(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.DocumentModeEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case PRODUCER: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.DocumentMode.PRODUCER); - break; - case CONSUMER: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.DocumentMode.CONSUMER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.DocumentMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CapabilityStatement.DocumentModeEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRODUCER: + tgt.setValue(CapabilityStatement.DocumentMode.PRODUCER); + break; + case CONSUMER: + tgt.setValue(CapabilityStatement.DocumentMode.CONSUMER); + break; + default: + tgt.setValue(CapabilityStatement.DocumentMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertMessageSignificanceCategory(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.MessageSignificanceCategoryEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case CONSEQUENCE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.MessageSignificanceCategory.CONSEQUENCE); - break; - case CURRENCY: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.MessageSignificanceCategory.CURRENCY); - break; - case NOTIFICATION: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.MessageSignificanceCategory.NOTIFICATION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.MessageSignificanceCategory.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CapabilityStatement.MessageSignificanceCategoryEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CONSEQUENCE: + tgt.setValue(CapabilityStatement.MessageSignificanceCategory.CONSEQUENCE); + break; + case CURRENCY: + tgt.setValue(CapabilityStatement.MessageSignificanceCategory.CURRENCY); + break; + case NOTIFICATION: + tgt.setValue(CapabilityStatement.MessageSignificanceCategory.NOTIFICATION); + break; + default: + tgt.setValue(CapabilityStatement.MessageSignificanceCategory.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertMessageSignificanceCategory(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Conformance.MessageSignificanceCategoryEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case CONSEQUENCE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.MessageSignificanceCategory.CONSEQUENCE); - break; - case CURRENCY: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.MessageSignificanceCategory.CURRENCY); - break; - case NOTIFICATION: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.MessageSignificanceCategory.NOTIFICATION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.MessageSignificanceCategory.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new Conformance.MessageSignificanceCategoryEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CONSEQUENCE: + tgt.setValue(Conformance.MessageSignificanceCategory.CONSEQUENCE); + break; + case CURRENCY: + tgt.setValue(Conformance.MessageSignificanceCategory.CURRENCY); + break; + case NOTIFICATION: + tgt.setValue(Conformance.MessageSignificanceCategory.NOTIFICATION); + break; + default: + tgt.setValue(Conformance.MessageSignificanceCategory.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceInteractionComponent convertResourceInteractionComponent(org.hl7.fhir.dstu2016may.model.Conformance.ResourceInteractionComponent src) throws FHIRException { @@ -779,85 +822,101 @@ public static org.hl7.fhir.dstu2016may.model.Conformance.ResourceInteractionComp } static public org.hl7.fhir.dstu3.model.Enumeration convertResourceVersionPolicy(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceVersionPolicyEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case NOVERSION: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceVersionPolicy.NOVERSION); - break; - case VERSIONED: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceVersionPolicy.VERSIONED); - break; - case VERSIONEDUPDATE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceVersionPolicy.VERSIONEDUPDATE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceVersionPolicy.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CapabilityStatement.ResourceVersionPolicyEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOVERSION: + tgt.setValue(CapabilityStatement.ResourceVersionPolicy.NOVERSION); + break; + case VERSIONED: + tgt.setValue(CapabilityStatement.ResourceVersionPolicy.VERSIONED); + break; + case VERSIONEDUPDATE: + tgt.setValue(CapabilityStatement.ResourceVersionPolicy.VERSIONEDUPDATE); + break; + default: + tgt.setValue(CapabilityStatement.ResourceVersionPolicy.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertResourceVersionPolicy(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Conformance.ResourceVersionPolicyEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case NOVERSION: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ResourceVersionPolicy.NOVERSION); - break; - case VERSIONED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ResourceVersionPolicy.VERSIONED); - break; - case VERSIONEDUPDATE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ResourceVersionPolicy.VERSIONEDUPDATE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ResourceVersionPolicy.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new Conformance.ResourceVersionPolicyEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOVERSION: + tgt.setValue(Conformance.ResourceVersionPolicy.NOVERSION); + break; + case VERSIONED: + tgt.setValue(Conformance.ResourceVersionPolicy.VERSIONED); + break; + case VERSIONEDUPDATE: + tgt.setValue(Conformance.ResourceVersionPolicy.VERSIONEDUPDATE); + break; + default: + tgt.setValue(Conformance.ResourceVersionPolicy.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertRestfulConformanceMode(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.RestfulCapabilityModeEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case CLIENT: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.RestfulCapabilityMode.CLIENT); - break; - case SERVER: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.RestfulCapabilityMode.SERVER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.RestfulCapabilityMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CapabilityStatement.RestfulCapabilityModeEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CLIENT: + tgt.setValue(CapabilityStatement.RestfulCapabilityMode.CLIENT); + break; + case SERVER: + tgt.setValue(CapabilityStatement.RestfulCapabilityMode.SERVER); + break; + default: + tgt.setValue(CapabilityStatement.RestfulCapabilityMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertRestfulConformanceMode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Conformance.RestfulConformanceModeEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case CLIENT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.RestfulConformanceMode.CLIENT); - break; - case SERVER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.RestfulConformanceMode.SERVER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.RestfulConformanceMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new Conformance.RestfulConformanceModeEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CLIENT: + tgt.setValue(Conformance.RestfulConformanceMode.CLIENT); + break; + case SERVER: + tgt.setValue(Conformance.RestfulConformanceMode.SERVER); + break; + default: + tgt.setValue(Conformance.RestfulConformanceMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2016may.model.Conformance.SystemInteractionComponent convertSystemInteractionComponent(org.hl7.fhir.dstu3.model.CapabilityStatement.SystemInteractionComponent src) throws FHIRException { @@ -885,170 +944,194 @@ public static org.hl7.fhir.dstu3.model.CapabilityStatement.SystemInteractionComp } static public org.hl7.fhir.dstu3.model.Enumeration convertSystemRestfulInteraction(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.SystemRestfulInteractionEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case TRANSACTION: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.SystemRestfulInteraction.TRANSACTION); - break; - case SEARCHSYSTEM: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.SystemRestfulInteraction.SEARCHSYSTEM); - break; - case HISTORYSYSTEM: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.SystemRestfulInteraction.HISTORYSYSTEM); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.SystemRestfulInteraction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CapabilityStatement.SystemRestfulInteractionEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case TRANSACTION: + tgt.setValue(CapabilityStatement.SystemRestfulInteraction.TRANSACTION); + break; + case SEARCHSYSTEM: + tgt.setValue(CapabilityStatement.SystemRestfulInteraction.SEARCHSYSTEM); + break; + case HISTORYSYSTEM: + tgt.setValue(CapabilityStatement.SystemRestfulInteraction.HISTORYSYSTEM); + break; + default: + tgt.setValue(CapabilityStatement.SystemRestfulInteraction.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertSystemRestfulInteraction(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Conformance.SystemRestfulInteractionEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case TRANSACTION: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.SystemRestfulInteraction.TRANSACTION); - break; - case SEARCHSYSTEM: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.SystemRestfulInteraction.SEARCHSYSTEM); - break; - case HISTORYSYSTEM: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.SystemRestfulInteraction.HISTORYSYSTEM); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.SystemRestfulInteraction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new Conformance.SystemRestfulInteractionEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case TRANSACTION: + tgt.setValue(Conformance.SystemRestfulInteraction.TRANSACTION); + break; + case SEARCHSYSTEM: + tgt.setValue(Conformance.SystemRestfulInteraction.SEARCHSYSTEM); + break; + case HISTORYSYSTEM: + tgt.setValue(Conformance.SystemRestfulInteraction.HISTORYSYSTEM); + break; + default: + tgt.setValue(Conformance.SystemRestfulInteraction.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertTypeRestfulInteraction(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteractionEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case READ: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.READ); - break; - case VREAD: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.VREAD); - break; - case UPDATE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.UPDATE); - break; - case DELETE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.DELETE); - break; - case HISTORYINSTANCE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.HISTORYINSTANCE); - break; - case HISTORYTYPE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.HISTORYTYPE); - break; - case CREATE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.CREATE); - break; - case SEARCHTYPE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.SEARCHTYPE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CapabilityStatement.TypeRestfulInteractionEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case READ: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.READ); + break; + case VREAD: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.VREAD); + break; + case UPDATE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.UPDATE); + break; + case DELETE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.DELETE); + break; + case HISTORYINSTANCE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.HISTORYINSTANCE); + break; + case HISTORYTYPE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.HISTORYTYPE); + break; + case CREATE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.CREATE); + break; + case SEARCHTYPE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.SEARCHTYPE); + break; + default: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertTypeRestfulInteraction(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Conformance.TypeRestfulInteractionEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case READ: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.TypeRestfulInteraction.READ); - break; - case VREAD: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.TypeRestfulInteraction.VREAD); - break; - case UPDATE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.TypeRestfulInteraction.UPDATE); - break; - case DELETE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.TypeRestfulInteraction.DELETE); - break; - case HISTORYINSTANCE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.TypeRestfulInteraction.HISTORYINSTANCE); - break; - case HISTORYTYPE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.TypeRestfulInteraction.HISTORYTYPE); - break; - case CREATE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.TypeRestfulInteraction.CREATE); - break; - case SEARCHTYPE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.TypeRestfulInteraction.SEARCHTYPE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.TypeRestfulInteraction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new Conformance.TypeRestfulInteractionEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case READ: + tgt.setValue(Conformance.TypeRestfulInteraction.READ); + break; + case VREAD: + tgt.setValue(Conformance.TypeRestfulInteraction.VREAD); + break; + case UPDATE: + tgt.setValue(Conformance.TypeRestfulInteraction.UPDATE); + break; + case DELETE: + tgt.setValue(Conformance.TypeRestfulInteraction.DELETE); + break; + case HISTORYINSTANCE: + tgt.setValue(Conformance.TypeRestfulInteraction.HISTORYINSTANCE); + break; + case HISTORYTYPE: + tgt.setValue(Conformance.TypeRestfulInteraction.HISTORYTYPE); + break; + case CREATE: + tgt.setValue(Conformance.TypeRestfulInteraction.CREATE); + break; + case SEARCHTYPE: + tgt.setValue(Conformance.TypeRestfulInteraction.SEARCHTYPE); + break; + default: + tgt.setValue(Conformance.TypeRestfulInteraction.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertUnknownContentCode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Conformance.UnknownContentCodeEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case NO: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.UnknownContentCode.NO); - break; - case EXTENSIONS: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.UnknownContentCode.EXTENSIONS); - break; - case ELEMENTS: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.UnknownContentCode.ELEMENTS); - break; - case BOTH: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.UnknownContentCode.BOTH); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.UnknownContentCode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new Conformance.UnknownContentCodeEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NO: + tgt.setValue(Conformance.UnknownContentCode.NO); + break; + case EXTENSIONS: + tgt.setValue(Conformance.UnknownContentCode.EXTENSIONS); + break; + case ELEMENTS: + tgt.setValue(Conformance.UnknownContentCode.ELEMENTS); + break; + case BOTH: + tgt.setValue(Conformance.UnknownContentCode.BOTH); + break; + default: + tgt.setValue(Conformance.UnknownContentCode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertUnknownContentCode(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.UnknownContentCodeEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case NO: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.UnknownContentCode.NO); - break; - case EXTENSIONS: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.UnknownContentCode.EXTENSIONS); - break; - case ELEMENTS: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.UnknownContentCode.ELEMENTS); - break; - case BOTH: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.UnknownContentCode.BOTH); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.UnknownContentCode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CapabilityStatement.UnknownContentCodeEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NO: + tgt.setValue(CapabilityStatement.UnknownContentCode.NO); + break; + case EXTENSIONS: + tgt.setValue(CapabilityStatement.UnknownContentCode.EXTENSIONS); + break; + case ELEMENTS: + tgt.setValue(CapabilityStatement.UnknownContentCode.ELEMENTS); + break; + case BOTH: + tgt.setValue(CapabilityStatement.UnknownContentCode.BOTH); + break; + default: + tgt.setValue(CapabilityStatement.UnknownContentCode.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/DataElement14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/DataElement14_30.java index 8bf6cfad9f..9315bb2f1e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/DataElement14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/DataElement14_30.java @@ -11,6 +11,8 @@ import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.Id14_30; import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.String14_30; import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.Uri14_30; +import org.hl7.fhir.dstu3.model.DataElement; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; public class DataElement14_30 { @@ -150,64 +152,72 @@ public static org.hl7.fhir.dstu2016may.model.DataElement.DataElementMappingCompo } static public org.hl7.fhir.dstu3.model.Enumeration convertDataElementStringency(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DataElement.DataElementStringencyEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case COMPARABLE: - tgt.setValue(org.hl7.fhir.dstu3.model.DataElement.DataElementStringency.COMPARABLE); - break; - case FULLYSPECIFIED: - tgt.setValue(org.hl7.fhir.dstu3.model.DataElement.DataElementStringency.FULLYSPECIFIED); - break; - case EQUIVALENT: - tgt.setValue(org.hl7.fhir.dstu3.model.DataElement.DataElementStringency.EQUIVALENT); - break; - case CONVERTABLE: - tgt.setValue(org.hl7.fhir.dstu3.model.DataElement.DataElementStringency.CONVERTABLE); - break; - case SCALEABLE: - tgt.setValue(org.hl7.fhir.dstu3.model.DataElement.DataElementStringency.SCALEABLE); - break; - case FLEXIBLE: - tgt.setValue(org.hl7.fhir.dstu3.model.DataElement.DataElementStringency.FLEXIBLE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.DataElement.DataElementStringency.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DataElement.DataElementStringencyEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case COMPARABLE: + tgt.setValue(DataElement.DataElementStringency.COMPARABLE); + break; + case FULLYSPECIFIED: + tgt.setValue(DataElement.DataElementStringency.FULLYSPECIFIED); + break; + case EQUIVALENT: + tgt.setValue(DataElement.DataElementStringency.EQUIVALENT); + break; + case CONVERTABLE: + tgt.setValue(DataElement.DataElementStringency.CONVERTABLE); + break; + case SCALEABLE: + tgt.setValue(DataElement.DataElementStringency.SCALEABLE); + break; + case FLEXIBLE: + tgt.setValue(DataElement.DataElementStringency.FLEXIBLE); + break; + default: + tgt.setValue(DataElement.DataElementStringency.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertDataElementStringency(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.DataElement.DataElementStringencyEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case COMPARABLE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.DataElement.DataElementStringency.COMPARABLE); - break; - case FULLYSPECIFIED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.DataElement.DataElementStringency.FULLYSPECIFIED); - break; - case EQUIVALENT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.DataElement.DataElementStringency.EQUIVALENT); - break; - case CONVERTABLE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.DataElement.DataElementStringency.CONVERTABLE); - break; - case SCALEABLE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.DataElement.DataElementStringency.SCALEABLE); - break; - case FLEXIBLE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.DataElement.DataElementStringency.FLEXIBLE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.DataElement.DataElementStringency.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.DataElement.DataElementStringencyEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case COMPARABLE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.DataElement.DataElementStringency.COMPARABLE); + break; + case FULLYSPECIFIED: + tgt.setValue(org.hl7.fhir.dstu2016may.model.DataElement.DataElementStringency.FULLYSPECIFIED); + break; + case EQUIVALENT: + tgt.setValue(org.hl7.fhir.dstu2016may.model.DataElement.DataElementStringency.EQUIVALENT); + break; + case CONVERTABLE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.DataElement.DataElementStringency.CONVERTABLE); + break; + case SCALEABLE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.DataElement.DataElementStringency.SCALEABLE); + break; + case FLEXIBLE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.DataElement.DataElementStringency.FLEXIBLE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.DataElement.DataElementStringency.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/Enumerations14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/Enumerations14_30.java index 226839cada..a1ae14e002 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/Enumerations14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/Enumerations14_30.java @@ -1,6 +1,7 @@ package org.hl7.fhir.convertors.conv14_30.resources14_30; import org.hl7.fhir.convertors.context.ConversionContext14_30; +import org.hl7.fhir.dstu3.model.Enumerations; import org.hl7.fhir.exceptions.FHIRException; public class Enumerations14_30 { @@ -9,26 +10,26 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Enumerations.BindingStrengthEnumFactory()); ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case REQUIRED: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.REQUIRED); - break; - case EXTENSIBLE: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.EXTENSIBLE); - break; - case PREFERRED: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.PREFERRED); - break; - case EXAMPLE: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.EXAMPLE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.NULL); - break; - } - } + tgt.setValue(Enumerations.BindingStrength.REQUIRED); + break; + case EXTENSIBLE: + tgt.setValue(Enumerations.BindingStrength.EXTENSIBLE); + break; + case PREFERRED: + tgt.setValue(Enumerations.BindingStrength.PREFERRED); + break; + case EXAMPLE: + tgt.setValue(Enumerations.BindingStrength.EXAMPLE); + break; + default: + tgt.setValue(Enumerations.BindingStrength.NULL); + break; + } +} return tgt; } @@ -37,26 +38,26 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrengthEnumFactory()); ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case REQUIRED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength.REQUIRED); - break; - case EXTENSIBLE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength.EXTENSIBLE); - break; - case PREFERRED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength.PREFERRED); - break; - case EXAMPLE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength.EXAMPLE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength.REQUIRED); + break; + case EXTENSIBLE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength.EXTENSIBLE); + break; + case PREFERRED: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength.PREFERRED); + break; + case EXAMPLE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength.EXAMPLE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength.NULL); + break; + } +} return tgt; } @@ -65,23 +66,23 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Enumerations.PublicationStatusEnumFactory()); ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case DRAFT: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.ACTIVE); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.RETIRED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.NULL); - break; - } - } + tgt.setValue(Enumerations.PublicationStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(Enumerations.PublicationStatus.ACTIVE); + break; + case RETIRED: + tgt.setValue(Enumerations.PublicationStatus.RETIRED); + break; + default: + tgt.setValue(Enumerations.PublicationStatus.NULL); + break; + } +} return tgt; } @@ -90,23 +91,23 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatusEnumFactory()); ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case DRAFT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus.ACTIVE); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus.RETIRED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus.ACTIVE); + break; + case RETIRED: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus.RETIRED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus.NULL); + break; + } +} return tgt; } @@ -115,38 +116,38 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Enumerations.SearchParamTypeEnumFactory()); ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case NUMBER: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.NUMBER); - break; - case DATE: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.DATE); - break; - case STRING: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.STRING); - break; - case TOKEN: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.TOKEN); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.REFERENCE); - break; - case COMPOSITE: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.COMPOSITE); - break; - case QUANTITY: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.QUANTITY); - break; - case URI: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.URI); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.NULL); - break; - } - } + tgt.setValue(Enumerations.SearchParamType.NUMBER); + break; + case DATE: + tgt.setValue(Enumerations.SearchParamType.DATE); + break; + case STRING: + tgt.setValue(Enumerations.SearchParamType.STRING); + break; + case TOKEN: + tgt.setValue(Enumerations.SearchParamType.TOKEN); + break; + case REFERENCE: + tgt.setValue(Enumerations.SearchParamType.REFERENCE); + break; + case COMPOSITE: + tgt.setValue(Enumerations.SearchParamType.COMPOSITE); + break; + case QUANTITY: + tgt.setValue(Enumerations.SearchParamType.QUANTITY); + break; + case URI: + tgt.setValue(Enumerations.SearchParamType.URI); + break; + default: + tgt.setValue(Enumerations.SearchParamType.NULL); + break; + } +} return tgt; } @@ -155,38 +156,38 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamTypeEnumFactory()); ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case NUMBER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.NUMBER); - break; - case DATE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.DATE); - break; - case STRING: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.STRING); - break; - case TOKEN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.TOKEN); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.REFERENCE); - break; - case COMPOSITE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.COMPOSITE); - break; - case QUANTITY: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.QUANTITY); - break; - case URI: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.URI); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.NUMBER); + break; + case DATE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.DATE); + break; + case STRING: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.STRING); + break; + case TOKEN: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.TOKEN); + break; + case REFERENCE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.REFERENCE); + break; + case COMPOSITE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.COMPOSITE); + break; + case QUANTITY: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.QUANTITY); + break; + case URI: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.URI); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/ImplementationGuide14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/ImplementationGuide14_30.java index ec0252c5e2..fd1e0592e5 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/ImplementationGuide14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/ImplementationGuide14_30.java @@ -11,120 +11,138 @@ import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.Id14_30; import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.String14_30; import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.Uri14_30; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.ImplementationGuide; import org.hl7.fhir.exceptions.FHIRException; public class ImplementationGuide14_30 { static public org.hl7.fhir.dstu3.model.Enumeration convertGuideDependencyType(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ImplementationGuide.GuideDependencyTypeEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case REFERENCE: - tgt.setValue(org.hl7.fhir.dstu3.model.ImplementationGuide.GuideDependencyType.REFERENCE); - break; - case INCLUSION: - tgt.setValue(org.hl7.fhir.dstu3.model.ImplementationGuide.GuideDependencyType.INCLUSION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ImplementationGuide.GuideDependencyType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ImplementationGuide.GuideDependencyTypeEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REFERENCE: + tgt.setValue(ImplementationGuide.GuideDependencyType.REFERENCE); + break; + case INCLUSION: + tgt.setValue(ImplementationGuide.GuideDependencyType.INCLUSION); + break; + default: + tgt.setValue(ImplementationGuide.GuideDependencyType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertGuideDependencyType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.ImplementationGuide.GuideDependencyTypeEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case REFERENCE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ImplementationGuide.GuideDependencyType.REFERENCE); - break; - case INCLUSION: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ImplementationGuide.GuideDependencyType.INCLUSION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ImplementationGuide.GuideDependencyType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.ImplementationGuide.GuideDependencyTypeEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REFERENCE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ImplementationGuide.GuideDependencyType.REFERENCE); + break; + case INCLUSION: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ImplementationGuide.GuideDependencyType.INCLUSION); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ImplementationGuide.GuideDependencyType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertGuidePageKind(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ImplementationGuide.GuidePageKindEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case PAGE: - tgt.setValue(org.hl7.fhir.dstu3.model.ImplementationGuide.GuidePageKind.PAGE); - break; - case EXAMPLE: - tgt.setValue(org.hl7.fhir.dstu3.model.ImplementationGuide.GuidePageKind.EXAMPLE); - break; - case LIST: - tgt.setValue(org.hl7.fhir.dstu3.model.ImplementationGuide.GuidePageKind.LIST); - break; - case INCLUDE: - tgt.setValue(org.hl7.fhir.dstu3.model.ImplementationGuide.GuidePageKind.INCLUDE); - break; - case DIRECTORY: - tgt.setValue(org.hl7.fhir.dstu3.model.ImplementationGuide.GuidePageKind.DIRECTORY); - break; - case DICTIONARY: - tgt.setValue(org.hl7.fhir.dstu3.model.ImplementationGuide.GuidePageKind.DICTIONARY); - break; - case TOC: - tgt.setValue(org.hl7.fhir.dstu3.model.ImplementationGuide.GuidePageKind.TOC); - break; - case RESOURCE: - tgt.setValue(org.hl7.fhir.dstu3.model.ImplementationGuide.GuidePageKind.RESOURCE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ImplementationGuide.GuidePageKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ImplementationGuide.GuidePageKindEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PAGE: + tgt.setValue(ImplementationGuide.GuidePageKind.PAGE); + break; + case EXAMPLE: + tgt.setValue(ImplementationGuide.GuidePageKind.EXAMPLE); + break; + case LIST: + tgt.setValue(ImplementationGuide.GuidePageKind.LIST); + break; + case INCLUDE: + tgt.setValue(ImplementationGuide.GuidePageKind.INCLUDE); + break; + case DIRECTORY: + tgt.setValue(ImplementationGuide.GuidePageKind.DIRECTORY); + break; + case DICTIONARY: + tgt.setValue(ImplementationGuide.GuidePageKind.DICTIONARY); + break; + case TOC: + tgt.setValue(ImplementationGuide.GuidePageKind.TOC); + break; + case RESOURCE: + tgt.setValue(ImplementationGuide.GuidePageKind.RESOURCE); + break; + default: + tgt.setValue(ImplementationGuide.GuidePageKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertGuidePageKind(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.ImplementationGuide.GuidePageKindEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case PAGE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ImplementationGuide.GuidePageKind.PAGE); - break; - case EXAMPLE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ImplementationGuide.GuidePageKind.EXAMPLE); - break; - case LIST: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ImplementationGuide.GuidePageKind.LIST); - break; - case INCLUDE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ImplementationGuide.GuidePageKind.INCLUDE); - break; - case DIRECTORY: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ImplementationGuide.GuidePageKind.DIRECTORY); - break; - case DICTIONARY: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ImplementationGuide.GuidePageKind.DICTIONARY); - break; - case TOC: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ImplementationGuide.GuidePageKind.TOC); - break; - case RESOURCE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ImplementationGuide.GuidePageKind.RESOURCE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ImplementationGuide.GuidePageKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.ImplementationGuide.GuidePageKindEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PAGE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ImplementationGuide.GuidePageKind.PAGE); + break; + case EXAMPLE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ImplementationGuide.GuidePageKind.EXAMPLE); + break; + case LIST: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ImplementationGuide.GuidePageKind.LIST); + break; + case INCLUDE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ImplementationGuide.GuidePageKind.INCLUDE); + break; + case DIRECTORY: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ImplementationGuide.GuidePageKind.DIRECTORY); + break; + case DICTIONARY: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ImplementationGuide.GuidePageKind.DICTIONARY); + break; + case TOC: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ImplementationGuide.GuidePageKind.TOC); + break; + case RESOURCE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ImplementationGuide.GuidePageKind.RESOURCE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ImplementationGuide.GuidePageKind.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2016may.model.ImplementationGuide convertImplementationGuide(org.hl7.fhir.dstu3.model.ImplementationGuide src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/NamingSystem14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/NamingSystem14_30.java index 473eb0e5a6..4c1a80ea42 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/NamingSystem14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/NamingSystem14_30.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.Boolean14_30; import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.DateTime14_30; import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.String14_30; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.NamingSystem; import org.hl7.fhir.exceptions.FHIRException; public class NamingSystem14_30 { @@ -112,97 +114,113 @@ public static org.hl7.fhir.dstu3.model.ContactDetail convertNamingSystemContactC } static public org.hl7.fhir.dstu3.model.Enumeration convertNamingSystemIdentifierType(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierTypeEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case OID: - tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierType.OID); - break; - case UUID: - tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierType.UUID); - break; - case URI: - tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierType.URI); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierType.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new NamingSystem.NamingSystemIdentifierTypeEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OID: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.OID); + break; + case UUID: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.UUID); + break; + case URI: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.URI); + break; + case OTHER: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.OTHER); + break; + default: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertNamingSystemIdentifierType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemIdentifierTypeEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case OID: - tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemIdentifierType.OID); - break; - case UUID: - tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemIdentifierType.UUID); - break; - case URI: - tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemIdentifierType.URI); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemIdentifierType.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemIdentifierType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemIdentifierTypeEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OID: + tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemIdentifierType.OID); + break; + case UUID: + tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemIdentifierType.UUID); + break; + case URI: + tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemIdentifierType.URI); + break; + case OTHER: + tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemIdentifierType.OTHER); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemIdentifierType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertNamingSystemType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemTypeEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case CODESYSTEM: - tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemType.CODESYSTEM); - break; - case IDENTIFIER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemType.IDENTIFIER); - break; - case ROOT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemType.ROOT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemTypeEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CODESYSTEM: + tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemType.CODESYSTEM); + break; + case IDENTIFIER: + tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemType.IDENTIFIER); + break; + case ROOT: + tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemType.ROOT); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertNamingSystemType(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemTypeEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case CODESYSTEM: - tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemType.CODESYSTEM); - break; - case IDENTIFIER: - tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemType.IDENTIFIER); - break; - case ROOT: - tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemType.ROOT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new NamingSystem.NamingSystemTypeEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CODESYSTEM: + tgt.setValue(NamingSystem.NamingSystemType.CODESYSTEM); + break; + case IDENTIFIER: + tgt.setValue(NamingSystem.NamingSystemType.IDENTIFIER); + break; + case ROOT: + tgt.setValue(NamingSystem.NamingSystemType.ROOT); + break; + default: + tgt.setValue(NamingSystem.NamingSystemType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemUniqueIdComponent convertNamingSystemUniqueIdComponent(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemUniqueIdComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/OperationDefinition14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/OperationDefinition14_30.java index ff57615bef..7b948f4c3e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/OperationDefinition14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/OperationDefinition14_30.java @@ -11,6 +11,8 @@ import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.Integer14_30; import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.String14_30; import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.Uri14_30; +import org.hl7.fhir.dstu2016may.model.Enumeration; +import org.hl7.fhir.dstu2016may.model.OperationDefinition; import org.hl7.fhir.dstu3.model.Enumerations.SearchParamType; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.utilities.Utilities; @@ -230,78 +232,94 @@ public static org.hl7.fhir.dstu3.model.OperationDefinition.OperationDefinitionPa } static public org.hl7.fhir.dstu2016may.model.Enumeration convertOperationKind(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationKindEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case OPERATION: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationKind.OPERATION); - break; - case QUERY: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationKind.QUERY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new OperationDefinition.OperationKindEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OPERATION: + tgt.setValue(OperationDefinition.OperationKind.OPERATION); + break; + case QUERY: + tgt.setValue(OperationDefinition.OperationKind.QUERY); + break; + default: + tgt.setValue(OperationDefinition.OperationKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertOperationKind(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.OperationDefinition.OperationKindEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case OPERATION: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationDefinition.OperationKind.OPERATION); - break; - case QUERY: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationDefinition.OperationKind.QUERY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationDefinition.OperationKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.OperationDefinition.OperationKindEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OPERATION: + tgt.setValue(org.hl7.fhir.dstu3.model.OperationDefinition.OperationKind.OPERATION); + break; + case QUERY: + tgt.setValue(org.hl7.fhir.dstu3.model.OperationDefinition.OperationKind.QUERY); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.OperationDefinition.OperationKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertOperationParameterUse(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.OperationDefinition.OperationParameterUseEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case IN: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationDefinition.OperationParameterUse.IN); - break; - case OUT: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationDefinition.OperationParameterUse.OUT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationDefinition.OperationParameterUse.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.OperationDefinition.OperationParameterUseEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case IN: + tgt.setValue(org.hl7.fhir.dstu3.model.OperationDefinition.OperationParameterUse.IN); + break; + case OUT: + tgt.setValue(org.hl7.fhir.dstu3.model.OperationDefinition.OperationParameterUse.OUT); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.OperationDefinition.OperationParameterUse.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertOperationParameterUse(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationParameterUseEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case IN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationParameterUse.IN); - break; - case OUT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationParameterUse.OUT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationParameterUse.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new OperationDefinition.OperationParameterUseEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case IN: + tgt.setValue(OperationDefinition.OperationParameterUse.IN); + break; + case OUT: + tgt.setValue(OperationDefinition.OperationParameterUse.OUT); + break; + default: + tgt.setValue(OperationDefinition.OperationParameterUse.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/OperationOutcome14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/OperationOutcome14_30.java index e11b9468e5..b408299aaa 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/OperationOutcome14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/OperationOutcome14_30.java @@ -3,258 +3,276 @@ import org.hl7.fhir.convertors.context.ConversionContext14_30; import org.hl7.fhir.convertors.conv14_30.datatypes14_30.complextypes14_30.CodeableConcept14_30; import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.String14_30; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.OperationOutcome; import org.hl7.fhir.exceptions.FHIRException; public class OperationOutcome14_30 { static public org.hl7.fhir.dstu3.model.Enumeration convertIssueSeverity(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverityEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case FATAL: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverity.FATAL); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverity.ERROR); - break; - case WARNING: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverity.WARNING); - break; - case INFORMATION: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverity.INFORMATION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverity.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new OperationOutcome.IssueSeverityEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FATAL: + tgt.setValue(OperationOutcome.IssueSeverity.FATAL); + break; + case ERROR: + tgt.setValue(OperationOutcome.IssueSeverity.ERROR); + break; + case WARNING: + tgt.setValue(OperationOutcome.IssueSeverity.WARNING); + break; + case INFORMATION: + tgt.setValue(OperationOutcome.IssueSeverity.INFORMATION); + break; + default: + tgt.setValue(OperationOutcome.IssueSeverity.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertIssueSeverity(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueSeverityEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case FATAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueSeverity.FATAL); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueSeverity.ERROR); - break; - case WARNING: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueSeverity.WARNING); - break; - case INFORMATION: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueSeverity.INFORMATION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueSeverity.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueSeverityEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FATAL: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueSeverity.FATAL); + break; + case ERROR: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueSeverity.ERROR); + break; + case WARNING: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueSeverity.WARNING); + break; + case INFORMATION: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueSeverity.INFORMATION); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueSeverity.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertIssueType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueTypeEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case INVALID: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.INVALID); - break; - case STRUCTURE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.STRUCTURE); - break; - case REQUIRED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.REQUIRED); - break; - case VALUE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.VALUE); - break; - case INVARIANT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.INVARIANT); - break; - case SECURITY: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.SECURITY); - break; - case LOGIN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.LOGIN); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.UNKNOWN); - break; - case EXPIRED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.EXPIRED); - break; - case FORBIDDEN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.FORBIDDEN); - break; - case SUPPRESSED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.SUPPRESSED); - break; - case PROCESSING: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.PROCESSING); - break; - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.NOTSUPPORTED); - break; - case DUPLICATE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.DUPLICATE); - break; - case NOTFOUND: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.NOTFOUND); - break; - case TOOLONG: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.TOOLONG); - break; - case CODEINVALID: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.CODEINVALID); - break; - case EXTENSION: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.EXTENSION); - break; - case TOOCOSTLY: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.TOOCOSTLY); - break; - case BUSINESSRULE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.BUSINESSRULE); - break; - case CONFLICT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.CONFLICT); - break; - case INCOMPLETE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.INCOMPLETE); - break; - case TRANSIENT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.TRANSIENT); - break; - case LOCKERROR: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.LOCKERROR); - break; - case NOSTORE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.NOSTORE); - break; - case EXCEPTION: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.EXCEPTION); - break; - case TIMEOUT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.TIMEOUT); - break; - case THROTTLED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.THROTTLED); - break; - case INFORMATIONAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.INFORMATIONAL); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueTypeEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INVALID: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.INVALID); + break; + case STRUCTURE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.STRUCTURE); + break; + case REQUIRED: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.REQUIRED); + break; + case VALUE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.VALUE); + break; + case INVARIANT: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.INVARIANT); + break; + case SECURITY: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.SECURITY); + break; + case LOGIN: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.LOGIN); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.UNKNOWN); + break; + case EXPIRED: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.EXPIRED); + break; + case FORBIDDEN: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.FORBIDDEN); + break; + case SUPPRESSED: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.SUPPRESSED); + break; + case PROCESSING: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.PROCESSING); + break; + case NOTSUPPORTED: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.NOTSUPPORTED); + break; + case DUPLICATE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.DUPLICATE); + break; + case NOTFOUND: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.NOTFOUND); + break; + case TOOLONG: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.TOOLONG); + break; + case CODEINVALID: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.CODEINVALID); + break; + case EXTENSION: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.EXTENSION); + break; + case TOOCOSTLY: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.TOOCOSTLY); + break; + case BUSINESSRULE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.BUSINESSRULE); + break; + case CONFLICT: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.CONFLICT); + break; + case INCOMPLETE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.INCOMPLETE); + break; + case TRANSIENT: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.TRANSIENT); + break; + case LOCKERROR: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.LOCKERROR); + break; + case NOSTORE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.NOSTORE); + break; + case EXCEPTION: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.EXCEPTION); + break; + case TIMEOUT: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.TIMEOUT); + break; + case THROTTLED: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.THROTTLED); + break; + case INFORMATIONAL: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.INFORMATIONAL); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertIssueType(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.OperationOutcome.IssueTypeEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case INVALID: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.INVALID); - break; - case STRUCTURE: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.STRUCTURE); - break; - case REQUIRED: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.REQUIRED); - break; - case VALUE: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.VALUE); - break; - case INVARIANT: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.INVARIANT); - break; - case SECURITY: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.SECURITY); - break; - case LOGIN: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.LOGIN); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.UNKNOWN); - break; - case EXPIRED: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.EXPIRED); - break; - case FORBIDDEN: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.FORBIDDEN); - break; - case SUPPRESSED: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.SUPPRESSED); - break; - case PROCESSING: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.PROCESSING); - break; - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.NOTSUPPORTED); - break; - case DUPLICATE: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.DUPLICATE); - break; - case NOTFOUND: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.NOTFOUND); - break; - case TOOLONG: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.TOOLONG); - break; - case CODEINVALID: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.CODEINVALID); - break; - case EXTENSION: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.EXTENSION); - break; - case TOOCOSTLY: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.TOOCOSTLY); - break; - case BUSINESSRULE: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.BUSINESSRULE); - break; - case CONFLICT: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.CONFLICT); - break; - case INCOMPLETE: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.INCOMPLETE); - break; - case TRANSIENT: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.TRANSIENT); - break; - case LOCKERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.LOCKERROR); - break; - case NOSTORE: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.NOSTORE); - break; - case EXCEPTION: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.EXCEPTION); - break; - case TIMEOUT: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.TIMEOUT); - break; - case THROTTLED: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.THROTTLED); - break; - case INFORMATIONAL: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.INFORMATIONAL); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new OperationOutcome.IssueTypeEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INVALID: + tgt.setValue(OperationOutcome.IssueType.INVALID); + break; + case STRUCTURE: + tgt.setValue(OperationOutcome.IssueType.STRUCTURE); + break; + case REQUIRED: + tgt.setValue(OperationOutcome.IssueType.REQUIRED); + break; + case VALUE: + tgt.setValue(OperationOutcome.IssueType.VALUE); + break; + case INVARIANT: + tgt.setValue(OperationOutcome.IssueType.INVARIANT); + break; + case SECURITY: + tgt.setValue(OperationOutcome.IssueType.SECURITY); + break; + case LOGIN: + tgt.setValue(OperationOutcome.IssueType.LOGIN); + break; + case UNKNOWN: + tgt.setValue(OperationOutcome.IssueType.UNKNOWN); + break; + case EXPIRED: + tgt.setValue(OperationOutcome.IssueType.EXPIRED); + break; + case FORBIDDEN: + tgt.setValue(OperationOutcome.IssueType.FORBIDDEN); + break; + case SUPPRESSED: + tgt.setValue(OperationOutcome.IssueType.SUPPRESSED); + break; + case PROCESSING: + tgt.setValue(OperationOutcome.IssueType.PROCESSING); + break; + case NOTSUPPORTED: + tgt.setValue(OperationOutcome.IssueType.NOTSUPPORTED); + break; + case DUPLICATE: + tgt.setValue(OperationOutcome.IssueType.DUPLICATE); + break; + case NOTFOUND: + tgt.setValue(OperationOutcome.IssueType.NOTFOUND); + break; + case TOOLONG: + tgt.setValue(OperationOutcome.IssueType.TOOLONG); + break; + case CODEINVALID: + tgt.setValue(OperationOutcome.IssueType.CODEINVALID); + break; + case EXTENSION: + tgt.setValue(OperationOutcome.IssueType.EXTENSION); + break; + case TOOCOSTLY: + tgt.setValue(OperationOutcome.IssueType.TOOCOSTLY); + break; + case BUSINESSRULE: + tgt.setValue(OperationOutcome.IssueType.BUSINESSRULE); + break; + case CONFLICT: + tgt.setValue(OperationOutcome.IssueType.CONFLICT); + break; + case INCOMPLETE: + tgt.setValue(OperationOutcome.IssueType.INCOMPLETE); + break; + case TRANSIENT: + tgt.setValue(OperationOutcome.IssueType.TRANSIENT); + break; + case LOCKERROR: + tgt.setValue(OperationOutcome.IssueType.LOCKERROR); + break; + case NOSTORE: + tgt.setValue(OperationOutcome.IssueType.NOSTORE); + break; + case EXCEPTION: + tgt.setValue(OperationOutcome.IssueType.EXCEPTION); + break; + case TIMEOUT: + tgt.setValue(OperationOutcome.IssueType.TIMEOUT); + break; + case THROTTLED: + tgt.setValue(OperationOutcome.IssueType.THROTTLED); + break; + case INFORMATIONAL: + tgt.setValue(OperationOutcome.IssueType.INFORMATIONAL); + break; + default: + tgt.setValue(OperationOutcome.IssueType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2016may.model.OperationOutcome convertOperationOutcome(org.hl7.fhir.dstu3.model.OperationOutcome src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/Questionnaire14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/Questionnaire14_30.java index 38c105e268..3974c379c7 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/Questionnaire14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/Questionnaire14_30.java @@ -12,8 +12,7 @@ import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.Integer14_30; import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.String14_30; import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.Uri14_30; -import org.hl7.fhir.dstu3.model.ContactDetail; -import org.hl7.fhir.dstu3.model.UsageContext; +import org.hl7.fhir.dstu3.model.*; import org.hl7.fhir.exceptions.FHIRException; public class Questionnaire14_30 { @@ -212,177 +211,193 @@ public static org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemOptionComp } static public org.hl7.fhir.dstu3.model.Enumeration convertQuestionnaireItemType(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemTypeEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case GROUP: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.GROUP); - break; - case DISPLAY: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.DISPLAY); - break; - case QUESTION: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.QUESTION); - break; - case BOOLEAN: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.BOOLEAN); - break; - case DECIMAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.DECIMAL); - break; - case INTEGER: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.INTEGER); - break; - case DATE: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.DATE); - break; - case DATETIME: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.DATETIME); - break; - case INSTANT: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.DATETIME); - break; - case TIME: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.TIME); - break; - case STRING: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.STRING); - break; - case TEXT: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.TEXT); - break; - case URL: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.URL); - break; - case CHOICE: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.CHOICE); - break; - case OPENCHOICE: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.OPENCHOICE); - break; - case ATTACHMENT: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.ATTACHMENT); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.REFERENCE); - break; - case QUANTITY: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.QUANTITY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Questionnaire.QuestionnaireItemTypeEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case GROUP: + tgt.setValue(Questionnaire.QuestionnaireItemType.GROUP); + break; + case DISPLAY: + tgt.setValue(Questionnaire.QuestionnaireItemType.DISPLAY); + break; + case QUESTION: + tgt.setValue(Questionnaire.QuestionnaireItemType.QUESTION); + break; + case BOOLEAN: + tgt.setValue(Questionnaire.QuestionnaireItemType.BOOLEAN); + break; + case DECIMAL: + tgt.setValue(Questionnaire.QuestionnaireItemType.DECIMAL); + break; + case INTEGER: + tgt.setValue(Questionnaire.QuestionnaireItemType.INTEGER); + break; + case DATE: + tgt.setValue(Questionnaire.QuestionnaireItemType.DATE); + break; + case DATETIME: + tgt.setValue(Questionnaire.QuestionnaireItemType.DATETIME); + break; + case INSTANT: + tgt.setValue(Questionnaire.QuestionnaireItemType.DATETIME); + break; + case TIME: + tgt.setValue(Questionnaire.QuestionnaireItemType.TIME); + break; + case STRING: + tgt.setValue(Questionnaire.QuestionnaireItemType.STRING); + break; + case TEXT: + tgt.setValue(Questionnaire.QuestionnaireItemType.TEXT); + break; + case URL: + tgt.setValue(Questionnaire.QuestionnaireItemType.URL); + break; + case CHOICE: + tgt.setValue(Questionnaire.QuestionnaireItemType.CHOICE); + break; + case OPENCHOICE: + tgt.setValue(Questionnaire.QuestionnaireItemType.OPENCHOICE); + break; + case ATTACHMENT: + tgt.setValue(Questionnaire.QuestionnaireItemType.ATTACHMENT); + break; + case REFERENCE: + tgt.setValue(Questionnaire.QuestionnaireItemType.REFERENCE); + break; + case QUANTITY: + tgt.setValue(Questionnaire.QuestionnaireItemType.QUANTITY); + break; + default: + tgt.setValue(Questionnaire.QuestionnaireItemType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertQuestionnaireItemType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemTypeEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case GROUP: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.GROUP); - break; - case DISPLAY: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.DISPLAY); - break; - case QUESTION: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.QUESTION); - break; - case BOOLEAN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.BOOLEAN); - break; - case DECIMAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.DECIMAL); - break; - case INTEGER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.INTEGER); - break; - case DATE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.DATE); - break; - case DATETIME: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.DATETIME); - break; - case TIME: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.TIME); - break; - case STRING: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.STRING); - break; - case TEXT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.TEXT); - break; - case URL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.URL); - break; - case CHOICE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.CHOICE); - break; - case OPENCHOICE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.OPENCHOICE); - break; - case ATTACHMENT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.ATTACHMENT); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.REFERENCE); - break; - case QUANTITY: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.QUANTITY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemTypeEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case GROUP: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.GROUP); + break; + case DISPLAY: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.DISPLAY); + break; + case QUESTION: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.QUESTION); + break; + case BOOLEAN: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.BOOLEAN); + break; + case DECIMAL: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.DECIMAL); + break; + case INTEGER: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.INTEGER); + break; + case DATE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.DATE); + break; + case DATETIME: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.DATETIME); + break; + case TIME: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.TIME); + break; + case STRING: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.STRING); + break; + case TEXT: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.TEXT); + break; + case URL: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.URL); + break; + case CHOICE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.CHOICE); + break; + case OPENCHOICE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.OPENCHOICE); + break; + case ATTACHMENT: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.ATTACHMENT); + break; + case REFERENCE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.REFERENCE); + break; + case QUANTITY: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.QUANTITY); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertQuestionnaireStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireStatusEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireStatus.PUBLISHED); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireStatus.RETIRED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireStatusEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireStatus.PUBLISHED); + break; + case RETIRED: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireStatus.RETIRED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertQuestionnaireStatus(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Enumerations.PublicationStatusEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.DRAFT); - break; - case PUBLISHED: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.ACTIVE); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.RETIRED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.PublicationStatusEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(Enumerations.PublicationStatus.DRAFT); + break; + case PUBLISHED: + tgt.setValue(Enumerations.PublicationStatus.ACTIVE); + break; + case RETIRED: + tgt.setValue(Enumerations.PublicationStatus.RETIRED); + break; + default: + tgt.setValue(Enumerations.PublicationStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/QuestionnaireResponse14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/QuestionnaireResponse14_30.java index e30e145c71..c491923d9b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/QuestionnaireResponse14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/QuestionnaireResponse14_30.java @@ -5,6 +5,8 @@ import org.hl7.fhir.convertors.conv14_30.datatypes14_30.complextypes14_30.Identifier14_30; import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.DateTime14_30; import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.String14_30; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.QuestionnaireResponse; import org.hl7.fhir.exceptions.FHIRException; public class QuestionnaireResponse14_30 { @@ -122,46 +124,54 @@ public static org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireRespon } static public org.hl7.fhir.dstu3.model.Enumeration convertQuestionnaireResponseStatus(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED); + break; + case AMENDED: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED); + break; + default: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertQuestionnaireResponseStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED); + break; + case AMENDED: + tgt.setValue(org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/SearchParameter14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/SearchParameter14_30.java index 6141dfd132..34bfa0ba9a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/SearchParameter14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/SearchParameter14_30.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.DateTime14_30; import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.String14_30; import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.Uri14_30; +import org.hl7.fhir.dstu2016may.model.Enumeration; +import org.hl7.fhir.dstu2016may.model.SearchParameter; import org.hl7.fhir.exceptions.FHIRException; public class SearchParameter14_30 { @@ -124,58 +126,66 @@ public static org.hl7.fhir.dstu3.model.ContactDetail convertSearchParameterConta } static public org.hl7.fhir.dstu2016may.model.Enumeration convertXPathUsageType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.SearchParameter.XPathUsageTypeEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case NORMAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.SearchParameter.XPathUsageType.NORMAL); - break; - case PHONETIC: - tgt.setValue(org.hl7.fhir.dstu2016may.model.SearchParameter.XPathUsageType.PHONETIC); - break; - case NEARBY: - tgt.setValue(org.hl7.fhir.dstu2016may.model.SearchParameter.XPathUsageType.NEARBY); - break; - case DISTANCE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.SearchParameter.XPathUsageType.DISTANCE); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.SearchParameter.XPathUsageType.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.SearchParameter.XPathUsageType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new SearchParameter.XPathUsageTypeEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NORMAL: + tgt.setValue(SearchParameter.XPathUsageType.NORMAL); + break; + case PHONETIC: + tgt.setValue(SearchParameter.XPathUsageType.PHONETIC); + break; + case NEARBY: + tgt.setValue(SearchParameter.XPathUsageType.NEARBY); + break; + case DISTANCE: + tgt.setValue(SearchParameter.XPathUsageType.DISTANCE); + break; + case OTHER: + tgt.setValue(SearchParameter.XPathUsageType.OTHER); + break; + default: + tgt.setValue(SearchParameter.XPathUsageType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertXPathUsageType(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageTypeEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case NORMAL: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageType.NORMAL); - break; - case PHONETIC: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageType.PHONETIC); - break; - case NEARBY: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageType.NEARBY); - break; - case DISTANCE: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageType.DISTANCE); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageType.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageTypeEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NORMAL: + tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageType.NORMAL); + break; + case PHONETIC: + tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageType.PHONETIC); + break; + case NEARBY: + tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageType.NEARBY); + break; + case DISTANCE: + tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageType.DISTANCE); + break; + case OTHER: + tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageType.OTHER); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/StructureDefinition14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/StructureDefinition14_30.java index e426a72e39..a40e482ba6 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/StructureDefinition14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/StructureDefinition14_30.java @@ -13,52 +13,62 @@ import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.String14_30; import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.Uri14_30; import org.hl7.fhir.dstu2016may.model.StructureDefinition.TypeDerivationRule; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.StructureDefinition; import org.hl7.fhir.exceptions.FHIRException; public class StructureDefinition14_30 { static public org.hl7.fhir.dstu3.model.Enumeration convertExtensionContext(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContextEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case RESOURCE: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContext.RESOURCE); - break; - case DATATYPE: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContext.DATATYPE); - break; - case EXTENSION: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContext.EXTENSION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContext.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureDefinition.ExtensionContextEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case RESOURCE: + tgt.setValue(StructureDefinition.ExtensionContext.RESOURCE); + break; + case DATATYPE: + tgt.setValue(StructureDefinition.ExtensionContext.DATATYPE); + break; + case EXTENSION: + tgt.setValue(StructureDefinition.ExtensionContext.EXTENSION); + break; + default: + tgt.setValue(StructureDefinition.ExtensionContext.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertExtensionContext(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContextEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case RESOURCE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContext.RESOURCE); - break; - case DATATYPE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContext.DATATYPE); - break; - case EXTENSION: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContext.EXTENSION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContext.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContextEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case RESOURCE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContext.RESOURCE); + break; + case DATATYPE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContext.DATATYPE); + break; + case EXTENSION: + tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContext.EXTENSION); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContext.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2016may.model.StructureDefinition convertStructureDefinition(org.hl7.fhir.dstu3.model.StructureDefinition src) throws FHIRException { @@ -236,50 +246,58 @@ public static org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionDi } static public org.hl7.fhir.dstu2016may.model.Enumeration convertStructureDefinitionKind(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKindEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case PRIMITIVETYPE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKind.DATATYPE); - break; - case COMPLEXTYPE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKind.DATATYPE); - break; - case RESOURCE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKind.RESOURCE); - break; - case LOGICAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKind.LOGICAL); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKindEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRIMITIVETYPE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKind.DATATYPE); + break; + case COMPLEXTYPE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKind.DATATYPE); + break; + case RESOURCE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKind.RESOURCE); + break; + case LOGICAL: + tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKind.LOGICAL); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertStructureDefinitionKind(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKindEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case DATATYPE: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKind.COMPLEXTYPE); - break; - case RESOURCE: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKind.RESOURCE); - break; - case LOGICAL: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKind.LOGICAL); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureDefinition.StructureDefinitionKindEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DATATYPE: + tgt.setValue(StructureDefinition.StructureDefinitionKind.COMPLEXTYPE); + break; + case RESOURCE: + tgt.setValue(StructureDefinition.StructureDefinitionKind.RESOURCE); + break; + case LOGICAL: + tgt.setValue(StructureDefinition.StructureDefinitionKind.LOGICAL); + break; + default: + tgt.setValue(StructureDefinition.StructureDefinitionKind.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionMappingComponent convertStructureDefinitionMappingComponent(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionMappingComponent src) throws FHIRException { @@ -335,40 +353,48 @@ public static org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefini } static public org.hl7.fhir.dstu3.model.Enumeration convertTypeDerivationRule(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureDefinition.TypeDerivationRuleEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case SPECIALIZATION: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.TypeDerivationRule.SPECIALIZATION); - break; - case CONSTRAINT: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.TypeDerivationRule.CONSTRAINT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.TypeDerivationRule.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureDefinition.TypeDerivationRuleEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SPECIALIZATION: + tgt.setValue(StructureDefinition.TypeDerivationRule.SPECIALIZATION); + break; + case CONSTRAINT: + tgt.setValue(StructureDefinition.TypeDerivationRule.CONSTRAINT); + break; + default: + tgt.setValue(StructureDefinition.TypeDerivationRule.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertTypeDerivationRule(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.StructureDefinition.TypeDerivationRuleEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case SPECIALIZATION: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.TypeDerivationRule.SPECIALIZATION); - break; - case CONSTRAINT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.TypeDerivationRule.CONSTRAINT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.TypeDerivationRule.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.StructureDefinition.TypeDerivationRuleEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SPECIALIZATION: + tgt.setValue(TypeDerivationRule.SPECIALIZATION); + break; + case CONSTRAINT: + tgt.setValue(TypeDerivationRule.CONSTRAINT); + break; + default: + tgt.setValue(TypeDerivationRule.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/TestScript14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/TestScript14_30.java index aba9bd8f6b..cf3b0a8f06 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/TestScript14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/TestScript14_30.java @@ -13,268 +13,302 @@ import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.Integer14_30; import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.String14_30; import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.Uri14_30; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.TestScript; import org.hl7.fhir.exceptions.FHIRException; public class TestScript14_30 { static public org.hl7.fhir.dstu3.model.Enumeration convertAssertionDirectionType(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionTypeEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case RESPONSE: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType.RESPONSE); - break; - case REQUEST: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType.REQUEST); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new TestScript.AssertionDirectionTypeEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case RESPONSE: + tgt.setValue(TestScript.AssertionDirectionType.RESPONSE); + break; + case REQUEST: + tgt.setValue(TestScript.AssertionDirectionType.REQUEST); + break; + default: + tgt.setValue(TestScript.AssertionDirectionType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertAssertionDirectionType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.TestScript.AssertionDirectionTypeEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case RESPONSE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionDirectionType.RESPONSE); - break; - case REQUEST: - tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionDirectionType.REQUEST); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionDirectionType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.TestScript.AssertionDirectionTypeEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case RESPONSE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionDirectionType.RESPONSE); + break; + case REQUEST: + tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionDirectionType.REQUEST); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionDirectionType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertAssertionOperatorType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.TestScript.AssertionOperatorTypeEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case EQUALS: - tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionOperatorType.EQUALS); - break; - case NOTEQUALS: - tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionOperatorType.NOTEQUALS); - break; - case IN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionOperatorType.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionOperatorType.NOTIN); - break; - case GREATERTHAN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionOperatorType.GREATERTHAN); - break; - case LESSTHAN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionOperatorType.LESSTHAN); - break; - case EMPTY: - tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionOperatorType.EMPTY); - break; - case NOTEMPTY: - tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionOperatorType.NOTEMPTY); - break; - case CONTAINS: - tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionOperatorType.CONTAINS); - break; - case NOTCONTAINS: - tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionOperatorType.NOTCONTAINS); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionOperatorType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.TestScript.AssertionOperatorTypeEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUALS: + tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionOperatorType.EQUALS); + break; + case NOTEQUALS: + tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionOperatorType.NOTEQUALS); + break; + case IN: + tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionOperatorType.IN); + break; + case NOTIN: + tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionOperatorType.NOTIN); + break; + case GREATERTHAN: + tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionOperatorType.GREATERTHAN); + break; + case LESSTHAN: + tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionOperatorType.LESSTHAN); + break; + case EMPTY: + tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionOperatorType.EMPTY); + break; + case NOTEMPTY: + tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionOperatorType.NOTEMPTY); + break; + case CONTAINS: + tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionOperatorType.CONTAINS); + break; + case NOTCONTAINS: + tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionOperatorType.NOTCONTAINS); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionOperatorType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertAssertionOperatorType(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorTypeEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case EQUALS: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.EQUALS); - break; - case NOTEQUALS: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTEQUALS); - break; - case IN: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTIN); - break; - case GREATERTHAN: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.GREATERTHAN); - break; - case LESSTHAN: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.LESSTHAN); - break; - case EMPTY: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.EMPTY); - break; - case NOTEMPTY: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTEMPTY); - break; - case CONTAINS: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.CONTAINS); - break; - case NOTCONTAINS: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTCONTAINS); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new TestScript.AssertionOperatorTypeEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUALS: + tgt.setValue(TestScript.AssertionOperatorType.EQUALS); + break; + case NOTEQUALS: + tgt.setValue(TestScript.AssertionOperatorType.NOTEQUALS); + break; + case IN: + tgt.setValue(TestScript.AssertionOperatorType.IN); + break; + case NOTIN: + tgt.setValue(TestScript.AssertionOperatorType.NOTIN); + break; + case GREATERTHAN: + tgt.setValue(TestScript.AssertionOperatorType.GREATERTHAN); + break; + case LESSTHAN: + tgt.setValue(TestScript.AssertionOperatorType.LESSTHAN); + break; + case EMPTY: + tgt.setValue(TestScript.AssertionOperatorType.EMPTY); + break; + case NOTEMPTY: + tgt.setValue(TestScript.AssertionOperatorType.NOTEMPTY); + break; + case CONTAINS: + tgt.setValue(TestScript.AssertionOperatorType.CONTAINS); + break; + case NOTCONTAINS: + tgt.setValue(TestScript.AssertionOperatorType.NOTCONTAINS); + break; + default: + tgt.setValue(TestScript.AssertionOperatorType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertAssertionResponseTypes(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypesEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case OKAY: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.OKAY); - break; - case CREATED: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.CREATED); - break; - case NOCONTENT: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NOCONTENT); - break; - case NOTMODIFIED: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NOTMODIFIED); - break; - case BAD: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.BAD); - break; - case FORBIDDEN: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.FORBIDDEN); - break; - case NOTFOUND: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NOTFOUND); - break; - case METHODNOTALLOWED: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.METHODNOTALLOWED); - break; - case CONFLICT: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.CONFLICT); - break; - case GONE: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.GONE); - break; - case PRECONDITIONFAILED: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.PRECONDITIONFAILED); - break; - case UNPROCESSABLE: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.UNPROCESSABLE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new TestScript.AssertionResponseTypesEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OKAY: + tgt.setValue(TestScript.AssertionResponseTypes.OKAY); + break; + case CREATED: + tgt.setValue(TestScript.AssertionResponseTypes.CREATED); + break; + case NOCONTENT: + tgt.setValue(TestScript.AssertionResponseTypes.NOCONTENT); + break; + case NOTMODIFIED: + tgt.setValue(TestScript.AssertionResponseTypes.NOTMODIFIED); + break; + case BAD: + tgt.setValue(TestScript.AssertionResponseTypes.BAD); + break; + case FORBIDDEN: + tgt.setValue(TestScript.AssertionResponseTypes.FORBIDDEN); + break; + case NOTFOUND: + tgt.setValue(TestScript.AssertionResponseTypes.NOTFOUND); + break; + case METHODNOTALLOWED: + tgt.setValue(TestScript.AssertionResponseTypes.METHODNOTALLOWED); + break; + case CONFLICT: + tgt.setValue(TestScript.AssertionResponseTypes.CONFLICT); + break; + case GONE: + tgt.setValue(TestScript.AssertionResponseTypes.GONE); + break; + case PRECONDITIONFAILED: + tgt.setValue(TestScript.AssertionResponseTypes.PRECONDITIONFAILED); + break; + case UNPROCESSABLE: + tgt.setValue(TestScript.AssertionResponseTypes.UNPROCESSABLE); + break; + default: + tgt.setValue(TestScript.AssertionResponseTypes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertAssertionResponseTypes(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypesEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case OKAY: - tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes.OKAY); - break; - case CREATED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes.CREATED); - break; - case NOCONTENT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes.NOCONTENT); - break; - case NOTMODIFIED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes.NOTMODIFIED); - break; - case BAD: - tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes.BAD); - break; - case FORBIDDEN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes.FORBIDDEN); - break; - case NOTFOUND: - tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes.NOTFOUND); - break; - case METHODNOTALLOWED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes.METHODNOTALLOWED); - break; - case CONFLICT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes.CONFLICT); - break; - case GONE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes.GONE); - break; - case PRECONDITIONFAILED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes.PRECONDITIONFAILED); - break; - case UNPROCESSABLE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes.UNPROCESSABLE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypesEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OKAY: + tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes.OKAY); + break; + case CREATED: + tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes.CREATED); + break; + case NOCONTENT: + tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes.NOCONTENT); + break; + case NOTMODIFIED: + tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes.NOTMODIFIED); + break; + case BAD: + tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes.BAD); + break; + case FORBIDDEN: + tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes.FORBIDDEN); + break; + case NOTFOUND: + tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes.NOTFOUND); + break; + case METHODNOTALLOWED: + tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes.METHODNOTALLOWED); + break; + case CONFLICT: + tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes.CONFLICT); + break; + case GONE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes.GONE); + break; + case PRECONDITIONFAILED: + tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes.PRECONDITIONFAILED); + break; + case UNPROCESSABLE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes.UNPROCESSABLE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertContentType(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestScript.ContentTypeEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case XML: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.ContentType.XML); - break; - case JSON: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.ContentType.JSON); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.ContentType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new TestScript.ContentTypeEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case XML: + tgt.setValue(TestScript.ContentType.XML); + break; + case JSON: + tgt.setValue(TestScript.ContentType.JSON); + break; + default: + tgt.setValue(TestScript.ContentType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertContentType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.TestScript.ContentTypeEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case XML: - tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.ContentType.XML); - break; - case JSON: - tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.ContentType.JSON); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.ContentType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.TestScript.ContentTypeEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case XML: + tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.ContentType.XML); + break; + case JSON: + tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.ContentType.JSON); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.ContentType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertComponent convertSetupActionAssertComponent(org.hl7.fhir.dstu3.model.TestScript.SetupActionAssertComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/ValueSet14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/ValueSet14_30.java index 52a3cea61c..c27785951a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/ValueSet14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/resources14_30/ValueSet14_30.java @@ -11,6 +11,8 @@ import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.Integer14_30; import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.String14_30; import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.Uri14_30; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.ValueSet; import org.hl7.fhir.exceptions.FHIRException; public class ValueSet14_30 { @@ -132,65 +134,73 @@ public static org.hl7.fhir.dstu2016may.model.ValueSet.ConceptSetFilterComponent } static public org.hl7.fhir.dstu3.model.Enumeration convertFilterOperator(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ValueSet.FilterOperatorEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case EQUAL: - tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.EQUAL); - break; - case ISA: - tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.ISA); - break; - case ISNOTA: - tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.ISNOTA); - break; - case REGEX: - tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.REGEX); - break; - case IN: - tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.NOTIN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ValueSet.FilterOperatorEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUAL: + tgt.setValue(ValueSet.FilterOperator.EQUAL); + break; + case ISA: + tgt.setValue(ValueSet.FilterOperator.ISA); + break; + case ISNOTA: + tgt.setValue(ValueSet.FilterOperator.ISNOTA); + break; + case REGEX: + tgt.setValue(ValueSet.FilterOperator.REGEX); + break; + case IN: + tgt.setValue(ValueSet.FilterOperator.IN); + break; + case NOTIN: + tgt.setValue(ValueSet.FilterOperator.NOTIN); + break; + default: + tgt.setValue(ValueSet.FilterOperator.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertFilterOperator(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.ValueSet.FilterOperatorEnumFactory()); - ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); - switch (src.getValue()) { - case EQUAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ValueSet.FilterOperator.EQUAL); - break; - case ISA: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ValueSet.FilterOperator.ISA); - break; - case ISNOTA: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ValueSet.FilterOperator.ISNOTA); - break; - case REGEX: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ValueSet.FilterOperator.REGEX); - break; - case IN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ValueSet.FilterOperator.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ValueSet.FilterOperator.NOTIN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ValueSet.FilterOperator.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.ValueSet.FilterOperatorEnumFactory()); + ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUAL: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ValueSet.FilterOperator.EQUAL); + break; + case ISA: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ValueSet.FilterOperator.ISA); + break; + case ISNOTA: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ValueSet.FilterOperator.ISNOTA); + break; + case REGEX: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ValueSet.FilterOperator.REGEX); + break; + case IN: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ValueSet.FilterOperator.IN); + break; + case NOTIN: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ValueSet.FilterOperator.NOTIN); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ValueSet.FilterOperator.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2016may.model.ValueSet convertValueSet(org.hl7.fhir.dstu3.model.ValueSet src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/datatypes14_40/ElementDefinition14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/datatypes14_40/ElementDefinition14_40.java index b8ff2cbb6b..61298b01ba 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/datatypes14_40/ElementDefinition14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/datatypes14_40/ElementDefinition14_40.java @@ -131,26 +131,26 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ElementDefinition.PropertyRepresentationEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.PropertyRepresentation.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case XMLATTR: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.PropertyRepresentation.XMLATTR); - break; - case XMLTEXT: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.PropertyRepresentation.XMLTEXT); - break; - case TYPEATTR: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.PropertyRepresentation.TYPEATTR); - break; - case CDATEXT: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.PropertyRepresentation.CDATEXT); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.PropertyRepresentation.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.PropertyRepresentation.XMLATTR); + break; + case XMLTEXT: + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.PropertyRepresentation.XMLTEXT); + break; + case TYPEATTR: + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.PropertyRepresentation.TYPEATTR); + break; + case CDATEXT: + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.PropertyRepresentation.CDATEXT); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.PropertyRepresentation.NULL); + break; + } +} return tgt; } @@ -159,26 +159,26 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new ElementDefinition.PropertyRepresentationEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(ElementDefinition.PropertyRepresentation.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case XMLATTR: - tgt.setValue(ElementDefinition.PropertyRepresentation.XMLATTR); - break; - case XMLTEXT: - tgt.setValue(ElementDefinition.PropertyRepresentation.XMLTEXT); - break; - case TYPEATTR: - tgt.setValue(ElementDefinition.PropertyRepresentation.TYPEATTR); - break; - case CDATEXT: - tgt.setValue(ElementDefinition.PropertyRepresentation.CDATEXT); - break; - default: - tgt.setValue(ElementDefinition.PropertyRepresentation.NULL); - break; - } - } + tgt.setValue(ElementDefinition.PropertyRepresentation.XMLATTR); + break; + case XMLTEXT: + tgt.setValue(ElementDefinition.PropertyRepresentation.XMLTEXT); + break; + case TYPEATTR: + tgt.setValue(ElementDefinition.PropertyRepresentation.TYPEATTR); + break; + case CDATEXT: + tgt.setValue(ElementDefinition.PropertyRepresentation.CDATEXT); + break; + default: + tgt.setValue(ElementDefinition.PropertyRepresentation.NULL); + break; + } +} return tgt; } @@ -255,23 +255,23 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ElementDefinition.SlicingRulesEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.SlicingRules.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CLOSED: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.SlicingRules.CLOSED); - break; - case OPEN: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.SlicingRules.OPEN); - break; - case OPENATEND: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.SlicingRules.OPENATEND); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.SlicingRules.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.SlicingRules.CLOSED); + break; + case OPEN: + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.SlicingRules.OPEN); + break; + case OPENATEND: + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.SlicingRules.OPENATEND); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.SlicingRules.NULL); + break; + } +} return tgt; } @@ -280,23 +280,23 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new ElementDefinition.SlicingRulesEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(ElementDefinition.SlicingRules.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CLOSED: - tgt.setValue(ElementDefinition.SlicingRules.CLOSED); - break; - case OPEN: - tgt.setValue(ElementDefinition.SlicingRules.OPEN); - break; - case OPENATEND: - tgt.setValue(ElementDefinition.SlicingRules.OPENATEND); - break; - default: - tgt.setValue(ElementDefinition.SlicingRules.NULL); - break; - } - } + tgt.setValue(ElementDefinition.SlicingRules.CLOSED); + break; + case OPEN: + tgt.setValue(ElementDefinition.SlicingRules.OPEN); + break; + case OPENATEND: + tgt.setValue(ElementDefinition.SlicingRules.OPENATEND); + break; + default: + tgt.setValue(ElementDefinition.SlicingRules.NULL); + break; + } +} return tgt; } @@ -390,23 +390,23 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ElementDefinition.AggregationModeEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.AggregationMode.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CONTAINED: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.AggregationMode.CONTAINED); - break; - case REFERENCED: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.AggregationMode.REFERENCED); - break; - case BUNDLED: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.AggregationMode.BUNDLED); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.AggregationMode.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.AggregationMode.CONTAINED); + break; + case REFERENCED: + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.AggregationMode.REFERENCED); + break; + case BUNDLED: + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.AggregationMode.BUNDLED); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.AggregationMode.NULL); + break; + } +} return tgt; } @@ -415,23 +415,23 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new ElementDefinition.AggregationModeEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(ElementDefinition.AggregationMode.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CONTAINED: - tgt.setValue(ElementDefinition.AggregationMode.CONTAINED); - break; - case REFERENCED: - tgt.setValue(ElementDefinition.AggregationMode.REFERENCED); - break; - case BUNDLED: - tgt.setValue(ElementDefinition.AggregationMode.BUNDLED); - break; - default: - tgt.setValue(ElementDefinition.AggregationMode.NULL); - break; - } - } + tgt.setValue(ElementDefinition.AggregationMode.CONTAINED); + break; + case REFERENCED: + tgt.setValue(ElementDefinition.AggregationMode.REFERENCED); + break; + case BUNDLED: + tgt.setValue(ElementDefinition.AggregationMode.BUNDLED); + break; + default: + tgt.setValue(ElementDefinition.AggregationMode.NULL); + break; + } +} return tgt; } @@ -440,23 +440,23 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ElementDefinition.ReferenceVersionRulesEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.ReferenceVersionRules.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case EITHER: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.ReferenceVersionRules.EITHER); - break; - case INDEPENDENT: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.ReferenceVersionRules.INDEPENDENT); - break; - case SPECIFIC: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.ReferenceVersionRules.SPECIFIC); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.ReferenceVersionRules.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.ReferenceVersionRules.EITHER); + break; + case INDEPENDENT: + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.ReferenceVersionRules.INDEPENDENT); + break; + case SPECIFIC: + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.ReferenceVersionRules.SPECIFIC); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.ReferenceVersionRules.NULL); + break; + } +} return tgt; } @@ -465,23 +465,23 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new ElementDefinition.ReferenceVersionRulesEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(ElementDefinition.ReferenceVersionRules.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case EITHER: - tgt.setValue(ElementDefinition.ReferenceVersionRules.EITHER); - break; - case INDEPENDENT: - tgt.setValue(ElementDefinition.ReferenceVersionRules.INDEPENDENT); - break; - case SPECIFIC: - tgt.setValue(ElementDefinition.ReferenceVersionRules.SPECIFIC); - break; - default: - tgt.setValue(ElementDefinition.ReferenceVersionRules.NULL); - break; - } - } + tgt.setValue(ElementDefinition.ReferenceVersionRules.EITHER); + break; + case INDEPENDENT: + tgt.setValue(ElementDefinition.ReferenceVersionRules.INDEPENDENT); + break; + case SPECIFIC: + tgt.setValue(ElementDefinition.ReferenceVersionRules.SPECIFIC); + break; + default: + tgt.setValue(ElementDefinition.ReferenceVersionRules.NULL); + break; + } +} return tgt; } @@ -516,20 +516,20 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ElementDefinition.ConstraintSeverityEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.ConstraintSeverity.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case ERROR: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.ConstraintSeverity.ERROR); - break; - case WARNING: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.ConstraintSeverity.WARNING); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.ConstraintSeverity.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.ConstraintSeverity.ERROR); + break; + case WARNING: + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.ConstraintSeverity.WARNING); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.ConstraintSeverity.NULL); + break; + } +} return tgt; } @@ -538,20 +538,20 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new ElementDefinition.ConstraintSeverityEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(ElementDefinition.ConstraintSeverity.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case ERROR: - tgt.setValue(ElementDefinition.ConstraintSeverity.ERROR); - break; - case WARNING: - tgt.setValue(ElementDefinition.ConstraintSeverity.WARNING); - break; - default: - tgt.setValue(ElementDefinition.ConstraintSeverity.NULL); - break; - } - } + tgt.setValue(ElementDefinition.ConstraintSeverity.ERROR); + break; + case WARNING: + tgt.setValue(ElementDefinition.ConstraintSeverity.WARNING); + break; + default: + tgt.setValue(ElementDefinition.ConstraintSeverity.NULL); + break; + } +} return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/datatypes14_40/Narrative14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/datatypes14_40/Narrative14_40.java index d2c2b678d1..d7a733a7f4 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/datatypes14_40/Narrative14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/datatypes14_40/Narrative14_40.java @@ -2,6 +2,7 @@ import org.hl7.fhir.convertors.context.ConversionContext14_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Narrative; public class Narrative14_40 { public static org.hl7.fhir.r4.model.Narrative convertNarrative(org.hl7.fhir.dstu2016may.model.Narrative src) throws FHIRException { @@ -27,26 +28,26 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Narrative.NarrativeStatusEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Narrative.NarrativeStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case GENERATED: - tgt.setValue(org.hl7.fhir.r4.model.Narrative.NarrativeStatus.GENERATED); - break; - case EXTENSIONS: - tgt.setValue(org.hl7.fhir.r4.model.Narrative.NarrativeStatus.EXTENSIONS); - break; - case ADDITIONAL: - tgt.setValue(org.hl7.fhir.r4.model.Narrative.NarrativeStatus.ADDITIONAL); - break; - case EMPTY: - tgt.setValue(org.hl7.fhir.r4.model.Narrative.NarrativeStatus.EMPTY); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Narrative.NarrativeStatus.NULL); - break; - } - } + tgt.setValue(Narrative.NarrativeStatus.GENERATED); + break; + case EXTENSIONS: + tgt.setValue(Narrative.NarrativeStatus.EXTENSIONS); + break; + case ADDITIONAL: + tgt.setValue(Narrative.NarrativeStatus.ADDITIONAL); + break; + case EMPTY: + tgt.setValue(Narrative.NarrativeStatus.EMPTY); + break; + default: + tgt.setValue(Narrative.NarrativeStatus.NULL); + break; + } +} return tgt; } @@ -55,26 +56,26 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Narrative.NarrativeStatusEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.Narrative.NarrativeStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case GENERATED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Narrative.NarrativeStatus.GENERATED); - break; - case EXTENSIONS: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Narrative.NarrativeStatus.EXTENSIONS); - break; - case ADDITIONAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Narrative.NarrativeStatus.ADDITIONAL); - break; - case EMPTY: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Narrative.NarrativeStatus.EMPTY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Narrative.NarrativeStatus.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.Narrative.NarrativeStatus.GENERATED); + break; + case EXTENSIONS: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Narrative.NarrativeStatus.EXTENSIONS); + break; + case ADDITIONAL: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Narrative.NarrativeStatus.ADDITIONAL); + break; + case EMPTY: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Narrative.NarrativeStatus.EMPTY); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Narrative.NarrativeStatus.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/datatypes14_40/complextypes14_40/Address14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/datatypes14_40/complextypes14_40/Address14_40.java index 12c47ae7ff..bcdd1426e1 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/datatypes14_40/complextypes14_40/Address14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/datatypes14_40/complextypes14_40/Address14_40.java @@ -3,6 +3,7 @@ import org.hl7.fhir.convertors.context.ConversionContext14_40; import org.hl7.fhir.convertors.conv14_40.datatypes14_40.primitivetypes14_40.String14_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Address; public class Address14_40 { public static org.hl7.fhir.r4.model.Address convertAddress(org.hl7.fhir.dstu2016may.model.Address src) throws FHIRException { @@ -44,26 +45,26 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Address.AddressUseEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HOME: - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressUse.HOME); - break; - case WORK: - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressUse.WORK); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressUse.OLD); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressUse.NULL); - break; - } - } + tgt.setValue(Address.AddressUse.HOME); + break; + case WORK: + tgt.setValue(Address.AddressUse.WORK); + break; + case TEMP: + tgt.setValue(Address.AddressUse.TEMP); + break; + case OLD: + tgt.setValue(Address.AddressUse.OLD); + break; + default: + tgt.setValue(Address.AddressUse.NULL); + break; + } +} return tgt; } @@ -72,26 +73,26 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Address.AddressUseEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HOME: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressUse.HOME); - break; - case WORK: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressUse.WORK); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressUse.OLD); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressUse.HOME); + break; + case WORK: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressUse.WORK); + break; + case TEMP: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressUse.TEMP); + break; + case OLD: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressUse.OLD); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressUse.NULL); + break; + } +} return tgt; } @@ -100,23 +101,23 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Address.AddressTypeEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case POSTAL: - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressType.POSTAL); - break; - case PHYSICAL: - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressType.PHYSICAL); - break; - case BOTH: - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressType.BOTH); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressType.NULL); - break; - } - } + tgt.setValue(Address.AddressType.POSTAL); + break; + case PHYSICAL: + tgt.setValue(Address.AddressType.PHYSICAL); + break; + case BOTH: + tgt.setValue(Address.AddressType.BOTH); + break; + default: + tgt.setValue(Address.AddressType.NULL); + break; + } +} return tgt; } @@ -125,23 +126,23 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Address.AddressTypeEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case POSTAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressType.POSTAL); - break; - case PHYSICAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressType.PHYSICAL); - break; - case BOTH: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressType.BOTH); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressType.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressType.POSTAL); + break; + case PHYSICAL: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressType.PHYSICAL); + break; + case BOTH: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressType.BOTH); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressType.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/datatypes14_40/complextypes14_40/ContactPoint14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/datatypes14_40/complextypes14_40/ContactPoint14_40.java index ffa6fc5e1e..5d26b6bf93 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/datatypes14_40/complextypes14_40/ContactPoint14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/datatypes14_40/complextypes14_40/ContactPoint14_40.java @@ -4,6 +4,7 @@ import org.hl7.fhir.convertors.conv14_40.datatypes14_40.primitivetypes14_40.PositiveInt14_40; import org.hl7.fhir.convertors.conv14_40.datatypes14_40.primitivetypes14_40.String14_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.ContactPoint; public class ContactPoint14_40 { public static org.hl7.fhir.r4.model.ContactPoint convertContactPoint(org.hl7.fhir.dstu2016may.model.ContactPoint src) throws FHIRException { @@ -35,29 +36,29 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ContactPoint.ContactPointSystemEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case PHONE: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem.PHONE); - break; - case FAX: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem.FAX); - break; - case EMAIL: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem.EMAIL); - break; - case PAGER: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem.PAGER); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem.URL); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem.NULL); - break; - } - } + tgt.setValue(ContactPoint.ContactPointSystem.PHONE); + break; + case FAX: + tgt.setValue(ContactPoint.ContactPointSystem.FAX); + break; + case EMAIL: + tgt.setValue(ContactPoint.ContactPointSystem.EMAIL); + break; + case PAGER: + tgt.setValue(ContactPoint.ContactPointSystem.PAGER); + break; + case OTHER: + tgt.setValue(ContactPoint.ContactPointSystem.URL); + break; + default: + tgt.setValue(ContactPoint.ContactPointSystem.NULL); + break; + } +} return tgt; } @@ -66,29 +67,29 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystemEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case PHONE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem.PHONE); - break; - case FAX: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem.FAX); - break; - case EMAIL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem.EMAIL); - break; - case PAGER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem.PAGER); - break; - case URL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem.PHONE); + break; + case FAX: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem.FAX); + break; + case EMAIL: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem.EMAIL); + break; + case PAGER: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem.PAGER); + break; + case URL: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem.OTHER); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem.NULL); + break; + } +} return tgt; } @@ -97,29 +98,29 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ContactPoint.ContactPointUseEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HOME: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointUse.HOME); - break; - case WORK: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointUse.WORK); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointUse.OLD); - break; - case MOBILE: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointUse.MOBILE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointUse.NULL); - break; - } - } + tgt.setValue(ContactPoint.ContactPointUse.HOME); + break; + case WORK: + tgt.setValue(ContactPoint.ContactPointUse.WORK); + break; + case TEMP: + tgt.setValue(ContactPoint.ContactPointUse.TEMP); + break; + case OLD: + tgt.setValue(ContactPoint.ContactPointUse.OLD); + break; + case MOBILE: + tgt.setValue(ContactPoint.ContactPointUse.MOBILE); + break; + default: + tgt.setValue(ContactPoint.ContactPointUse.NULL); + break; + } +} return tgt; } @@ -128,29 +129,29 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUseEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HOME: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUse.HOME); - break; - case WORK: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUse.WORK); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUse.OLD); - break; - case MOBILE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUse.MOBILE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUse.HOME); + break; + case WORK: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUse.WORK); + break; + case TEMP: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUse.TEMP); + break; + case OLD: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUse.OLD); + break; + case MOBILE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUse.MOBILE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUse.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/datatypes14_40/complextypes14_40/HumanName14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/datatypes14_40/complextypes14_40/HumanName14_40.java index 2dd46dbe7c..bded3ee485 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/datatypes14_40/complextypes14_40/HumanName14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/datatypes14_40/complextypes14_40/HumanName14_40.java @@ -3,6 +3,7 @@ import org.hl7.fhir.convertors.context.ConversionContext14_40; import org.hl7.fhir.convertors.conv14_40.datatypes14_40.primitivetypes14_40.String14_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.HumanName; public class HumanName14_40 { public static org.hl7.fhir.r4.model.HumanName convertHumanName(org.hl7.fhir.dstu2016may.model.HumanName src) throws FHIRException { @@ -38,35 +39,35 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.HumanName.NameUseEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case USUAL: - tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.USUAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.OFFICIAL); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.TEMP); - break; - case NICKNAME: - tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.NICKNAME); - break; - case ANONYMOUS: - tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.ANONYMOUS); - break; - case OLD: - tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.OLD); - break; - case MAIDEN: - tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.MAIDEN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.NULL); - break; - } - } + tgt.setValue(HumanName.NameUse.USUAL); + break; + case OFFICIAL: + tgt.setValue(HumanName.NameUse.OFFICIAL); + break; + case TEMP: + tgt.setValue(HumanName.NameUse.TEMP); + break; + case NICKNAME: + tgt.setValue(HumanName.NameUse.NICKNAME); + break; + case ANONYMOUS: + tgt.setValue(HumanName.NameUse.ANONYMOUS); + break; + case OLD: + tgt.setValue(HumanName.NameUse.OLD); + break; + case MAIDEN: + tgt.setValue(HumanName.NameUse.MAIDEN); + break; + default: + tgt.setValue(HumanName.NameUse.NULL); + break; + } +} return tgt; } @@ -75,35 +76,35 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.HumanName.NameUseEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case USUAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.USUAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.OFFICIAL); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.TEMP); - break; - case NICKNAME: - tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.NICKNAME); - break; - case ANONYMOUS: - tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.ANONYMOUS); - break; - case OLD: - tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.OLD); - break; - case MAIDEN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.MAIDEN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.USUAL); + break; + case OFFICIAL: + tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.OFFICIAL); + break; + case TEMP: + tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.TEMP); + break; + case NICKNAME: + tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.NICKNAME); + break; + case ANONYMOUS: + tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.ANONYMOUS); + break; + case OLD: + tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.OLD); + break; + case MAIDEN: + tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.MAIDEN); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/datatypes14_40/complextypes14_40/Identifier14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/datatypes14_40/complextypes14_40/Identifier14_40.java index 3851f1feed..211d05699b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/datatypes14_40/complextypes14_40/Identifier14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/datatypes14_40/complextypes14_40/Identifier14_40.java @@ -5,6 +5,7 @@ import org.hl7.fhir.convertors.conv14_40.datatypes14_40.primitivetypes14_40.String14_40; import org.hl7.fhir.convertors.conv14_40.datatypes14_40.primitivetypes14_40.Uri14_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Identifier; public class Identifier14_40 { public static org.hl7.fhir.r4.model.Identifier convertIdentifier(org.hl7.fhir.dstu2016may.model.Identifier src) throws FHIRException { @@ -38,26 +39,26 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Identifier.IdentifierUseEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Identifier.IdentifierUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case USUAL: - tgt.setValue(org.hl7.fhir.r4.model.Identifier.IdentifierUse.USUAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.r4.model.Identifier.IdentifierUse.OFFICIAL); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.r4.model.Identifier.IdentifierUse.TEMP); - break; - case SECONDARY: - tgt.setValue(org.hl7.fhir.r4.model.Identifier.IdentifierUse.SECONDARY); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Identifier.IdentifierUse.NULL); - break; - } - } + tgt.setValue(Identifier.IdentifierUse.USUAL); + break; + case OFFICIAL: + tgt.setValue(Identifier.IdentifierUse.OFFICIAL); + break; + case TEMP: + tgt.setValue(Identifier.IdentifierUse.TEMP); + break; + case SECONDARY: + tgt.setValue(Identifier.IdentifierUse.SECONDARY); + break; + default: + tgt.setValue(Identifier.IdentifierUse.NULL); + break; + } +} return tgt; } @@ -66,26 +67,26 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Identifier.IdentifierUseEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.Identifier.IdentifierUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case USUAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Identifier.IdentifierUse.USUAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Identifier.IdentifierUse.OFFICIAL); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Identifier.IdentifierUse.TEMP); - break; - case SECONDARY: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Identifier.IdentifierUse.SECONDARY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Identifier.IdentifierUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.Identifier.IdentifierUse.USUAL); + break; + case OFFICIAL: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Identifier.IdentifierUse.OFFICIAL); + break; + case TEMP: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Identifier.IdentifierUse.TEMP); + break; + case SECONDARY: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Identifier.IdentifierUse.SECONDARY); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Identifier.IdentifierUse.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/datatypes14_40/complextypes14_40/Quantity14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/datatypes14_40/complextypes14_40/Quantity14_40.java index 9c235fa0e7..8747934223 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/datatypes14_40/complextypes14_40/Quantity14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/datatypes14_40/complextypes14_40/Quantity14_40.java @@ -6,6 +6,7 @@ import org.hl7.fhir.convertors.conv14_40.datatypes14_40.primitivetypes14_40.String14_40; import org.hl7.fhir.convertors.conv14_40.datatypes14_40.primitivetypes14_40.Uri14_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Quantity; public class Quantity14_40 { public static org.hl7.fhir.r4.model.Quantity convertQuantity(org.hl7.fhir.dstu2016may.model.Quantity src) throws FHIRException { @@ -37,26 +38,26 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Quantity.QuantityComparatorEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Quantity.QuantityComparator.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case LESS_THAN: - tgt.setValue(org.hl7.fhir.r4.model.Quantity.QuantityComparator.LESS_THAN); - break; - case LESS_OR_EQUAL: - tgt.setValue(org.hl7.fhir.r4.model.Quantity.QuantityComparator.LESS_OR_EQUAL); - break; - case GREATER_OR_EQUAL: - tgt.setValue(org.hl7.fhir.r4.model.Quantity.QuantityComparator.GREATER_OR_EQUAL); - break; - case GREATER_THAN: - tgt.setValue(org.hl7.fhir.r4.model.Quantity.QuantityComparator.GREATER_THAN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Quantity.QuantityComparator.NULL); - break; - } - } + tgt.setValue(Quantity.QuantityComparator.LESS_THAN); + break; + case LESS_OR_EQUAL: + tgt.setValue(Quantity.QuantityComparator.LESS_OR_EQUAL); + break; + case GREATER_OR_EQUAL: + tgt.setValue(Quantity.QuantityComparator.GREATER_OR_EQUAL); + break; + case GREATER_THAN: + tgt.setValue(Quantity.QuantityComparator.GREATER_THAN); + break; + default: + tgt.setValue(Quantity.QuantityComparator.NULL); + break; + } +} return tgt; } @@ -65,26 +66,26 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Quantity.QuantityComparatorEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.Quantity.QuantityComparator.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case LESS_THAN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Quantity.QuantityComparator.LESS_THAN); - break; - case LESS_OR_EQUAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Quantity.QuantityComparator.LESS_OR_EQUAL); - break; - case GREATER_OR_EQUAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Quantity.QuantityComparator.GREATER_OR_EQUAL); - break; - case GREATER_THAN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Quantity.QuantityComparator.GREATER_THAN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Quantity.QuantityComparator.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.Quantity.QuantityComparator.LESS_THAN); + break; + case LESS_OR_EQUAL: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Quantity.QuantityComparator.LESS_OR_EQUAL); + break; + case GREATER_OR_EQUAL: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Quantity.QuantityComparator.GREATER_OR_EQUAL); + break; + case GREATER_THAN: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Quantity.QuantityComparator.GREATER_THAN); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Quantity.QuantityComparator.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/datatypes14_40/complextypes14_40/Timing14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/datatypes14_40/complextypes14_40/Timing14_40.java index 05936f0462..5f08952c4b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/datatypes14_40/complextypes14_40/Timing14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/datatypes14_40/complextypes14_40/Timing14_40.java @@ -6,6 +6,7 @@ import org.hl7.fhir.convertors.conv14_40.datatypes14_40.primitivetypes14_40.Decimal14_40; import org.hl7.fhir.convertors.conv14_40.datatypes14_40.primitivetypes14_40.UnsignedInt14_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Timing; public class Timing14_40 { public static org.hl7.fhir.r4.model.Timing convertTiming(org.hl7.fhir.dstu2016may.model.Timing src) throws FHIRException { @@ -75,35 +76,35 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Timing.UnitsOfTimeEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case S: - tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.S); - break; - case MIN: - tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.MIN); - break; - case H: - tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.H); - break; - case D: - tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.D); - break; - case WK: - tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.WK); - break; - case MO: - tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.MO); - break; - case A: - tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.A); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.NULL); - break; - } - } + tgt.setValue(Timing.UnitsOfTime.S); + break; + case MIN: + tgt.setValue(Timing.UnitsOfTime.MIN); + break; + case H: + tgt.setValue(Timing.UnitsOfTime.H); + break; + case D: + tgt.setValue(Timing.UnitsOfTime.D); + break; + case WK: + tgt.setValue(Timing.UnitsOfTime.WK); + break; + case MO: + tgt.setValue(Timing.UnitsOfTime.MO); + break; + case A: + tgt.setValue(Timing.UnitsOfTime.A); + break; + default: + tgt.setValue(Timing.UnitsOfTime.NULL); + break; + } +} return tgt; } @@ -112,35 +113,35 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTimeEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case S: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.S); - break; - case MIN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.MIN); - break; - case H: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.H); - break; - case D: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.D); - break; - case WK: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.WK); - break; - case MO: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.MO); - break; - case A: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.A); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.S); + break; + case MIN: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.MIN); + break; + case H: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.H); + break; + case D: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.D); + break; + case WK: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.WK); + break; + case MO: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.MO); + break; + case A: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.A); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.NULL); + break; + } +} return tgt; } @@ -149,56 +150,56 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Timing.EventTimingEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HS: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.HS); - break; - case WAKE: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.WAKE); - break; - case C: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.C); - break; - case CM: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.CM); - break; - case CD: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.CD); - break; - case CV: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.CV); - break; - case AC: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.AC); - break; - case ACM: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.ACM); - break; - case ACD: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.ACD); - break; - case ACV: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.ACV); - break; - case PC: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.PC); - break; - case PCM: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.PCM); - break; - case PCD: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.PCD); - break; - case PCV: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.PCV); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.NULL); - break; - } - } + tgt.setValue(Timing.EventTiming.HS); + break; + case WAKE: + tgt.setValue(Timing.EventTiming.WAKE); + break; + case C: + tgt.setValue(Timing.EventTiming.C); + break; + case CM: + tgt.setValue(Timing.EventTiming.CM); + break; + case CD: + tgt.setValue(Timing.EventTiming.CD); + break; + case CV: + tgt.setValue(Timing.EventTiming.CV); + break; + case AC: + tgt.setValue(Timing.EventTiming.AC); + break; + case ACM: + tgt.setValue(Timing.EventTiming.ACM); + break; + case ACD: + tgt.setValue(Timing.EventTiming.ACD); + break; + case ACV: + tgt.setValue(Timing.EventTiming.ACV); + break; + case PC: + tgt.setValue(Timing.EventTiming.PC); + break; + case PCM: + tgt.setValue(Timing.EventTiming.PCM); + break; + case PCD: + tgt.setValue(Timing.EventTiming.PCD); + break; + case PCV: + tgt.setValue(Timing.EventTiming.PCV); + break; + default: + tgt.setValue(Timing.EventTiming.NULL); + break; + } +} return tgt; } @@ -207,56 +208,56 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Timing.EventTimingEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HS: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.HS); - break; - case WAKE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.WAKE); - break; - case C: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.C); - break; - case CM: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.CM); - break; - case CD: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.CD); - break; - case CV: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.CV); - break; - case AC: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.AC); - break; - case ACM: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.ACM); - break; - case ACD: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.ACD); - break; - case ACV: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.ACV); - break; - case PC: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.PC); - break; - case PCM: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.PCM); - break; - case PCD: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.PCD); - break; - case PCV: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.PCV); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.HS); + break; + case WAKE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.WAKE); + break; + case C: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.C); + break; + case CM: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.CM); + break; + case CD: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.CD); + break; + case CV: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.CV); + break; + case AC: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.AC); + break; + case ACM: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.ACM); + break; + case ACD: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.ACD); + break; + case ACV: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.ACV); + break; + case PC: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.PC); + break; + case PCM: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.PCM); + break; + case PCD: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.PCD); + break; + case PCV: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.PCV); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/Bundle14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/Bundle14_40.java index 04e8a82772..8fca4b3b44 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/Bundle14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/Bundle14_40.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv14_40.datatypes14_40.primitivetypes14_40.UnsignedInt14_40; import org.hl7.fhir.convertors.conv14_40.datatypes14_40.primitivetypes14_40.Uri14_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Bundle; +import org.hl7.fhir.r4.model.Enumeration; public class Bundle14_40 { @@ -206,176 +208,200 @@ public static org.hl7.fhir.r4.model.Bundle.BundleLinkComponent convertBundleLink } static public org.hl7.fhir.r4.model.Enumeration convertBundleType(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Bundle.BundleTypeEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case DOCUMENT: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.DOCUMENT); - break; - case MESSAGE: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.MESSAGE); - break; - case TRANSACTION: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.TRANSACTION); - break; - case TRANSACTIONRESPONSE: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.TRANSACTIONRESPONSE); - break; - case BATCH: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.BATCH); - break; - case BATCHRESPONSE: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.BATCHRESPONSE); - break; - case HISTORY: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.HISTORY); - break; - case SEARCHSET: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.SEARCHSET); - break; - case COLLECTION: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.COLLECTION); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Bundle.BundleTypeEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DOCUMENT: + tgt.setValue(Bundle.BundleType.DOCUMENT); + break; + case MESSAGE: + tgt.setValue(Bundle.BundleType.MESSAGE); + break; + case TRANSACTION: + tgt.setValue(Bundle.BundleType.TRANSACTION); + break; + case TRANSACTIONRESPONSE: + tgt.setValue(Bundle.BundleType.TRANSACTIONRESPONSE); + break; + case BATCH: + tgt.setValue(Bundle.BundleType.BATCH); + break; + case BATCHRESPONSE: + tgt.setValue(Bundle.BundleType.BATCHRESPONSE); + break; + case HISTORY: + tgt.setValue(Bundle.BundleType.HISTORY); + break; + case SEARCHSET: + tgt.setValue(Bundle.BundleType.SEARCHSET); + break; + case COLLECTION: + tgt.setValue(Bundle.BundleType.COLLECTION); + break; + default: + tgt.setValue(Bundle.BundleType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertBundleType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Bundle.BundleTypeEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case DOCUMENT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.DOCUMENT); - break; - case MESSAGE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.MESSAGE); - break; - case TRANSACTION: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.TRANSACTION); - break; - case TRANSACTIONRESPONSE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.TRANSACTIONRESPONSE); - break; - case BATCH: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.BATCH); - break; - case BATCHRESPONSE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.BATCHRESPONSE); - break; - case HISTORY: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.HISTORY); - break; - case SEARCHSET: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.SEARCHSET); - break; - case COLLECTION: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.COLLECTION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Bundle.BundleTypeEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DOCUMENT: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.DOCUMENT); + break; + case MESSAGE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.MESSAGE); + break; + case TRANSACTION: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.TRANSACTION); + break; + case TRANSACTIONRESPONSE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.TRANSACTIONRESPONSE); + break; + case BATCH: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.BATCH); + break; + case BATCHRESPONSE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.BATCHRESPONSE); + break; + case HISTORY: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.HISTORY); + break; + case SEARCHSET: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.SEARCHSET); + break; + case COLLECTION: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.COLLECTION); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertHTTPVerb(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Bundle.HTTPVerbEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case GET: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.GET); - break; - case POST: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.POST); - break; - case PUT: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.PUT); - break; - case DELETE: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.DELETE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Bundle.HTTPVerbEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case GET: + tgt.setValue(Bundle.HTTPVerb.GET); + break; + case POST: + tgt.setValue(Bundle.HTTPVerb.POST); + break; + case PUT: + tgt.setValue(Bundle.HTTPVerb.PUT); + break; + case DELETE: + tgt.setValue(Bundle.HTTPVerb.DELETE); + break; + default: + tgt.setValue(Bundle.HTTPVerb.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertHTTPVerb(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Bundle.HTTPVerbEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case GET: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.HTTPVerb.GET); - break; - case POST: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.HTTPVerb.POST); - break; - case PUT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.HTTPVerb.PUT); - break; - case DELETE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.HTTPVerb.DELETE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.HTTPVerb.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Bundle.HTTPVerbEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case GET: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.HTTPVerb.GET); + break; + case POST: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.HTTPVerb.POST); + break; + case PUT: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.HTTPVerb.PUT); + break; + case DELETE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.HTTPVerb.DELETE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.HTTPVerb.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertSearchEntryMode(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Bundle.SearchEntryModeEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case MATCH: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.SearchEntryMode.MATCH); - break; - case INCLUDE: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.SearchEntryMode.INCLUDE); - break; - case OUTCOME: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.SearchEntryMode.OUTCOME); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.SearchEntryMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Bundle.SearchEntryModeEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MATCH: + tgt.setValue(Bundle.SearchEntryMode.MATCH); + break; + case INCLUDE: + tgt.setValue(Bundle.SearchEntryMode.INCLUDE); + break; + case OUTCOME: + tgt.setValue(Bundle.SearchEntryMode.OUTCOME); + break; + default: + tgt.setValue(Bundle.SearchEntryMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertSearchEntryMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Bundle.SearchEntryModeEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case MATCH: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.SearchEntryMode.MATCH); - break; - case INCLUDE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.SearchEntryMode.INCLUDE); - break; - case OUTCOME: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.SearchEntryMode.OUTCOME); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.SearchEntryMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Bundle.SearchEntryModeEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MATCH: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.SearchEntryMode.MATCH); + break; + case INCLUDE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.SearchEntryMode.INCLUDE); + break; + case OUTCOME: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.SearchEntryMode.OUTCOME); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.SearchEntryMode.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/CodeSystem14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/CodeSystem14_40.java index 91eaf9e6bc..f95d34e3b2 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/CodeSystem14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/CodeSystem14_40.java @@ -154,53 +154,61 @@ public static org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContactCompone } static public org.hl7.fhir.dstu2016may.model.Enumeration convertCodeSystemContentMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContentModeEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case NOTPRESENT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContentMode.NOTPRESENT); - break; - case EXAMPLE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContentMode.EXAMPLAR); - break; - case FRAGMENT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContentMode.FRAGMENT); - break; - case COMPLETE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContentMode.COMPLETE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContentMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContentModeEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTPRESENT: + tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContentMode.NOTPRESENT); + break; + case EXAMPLE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContentMode.EXAMPLAR); + break; + case FRAGMENT: + tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContentMode.FRAGMENT); + break; + case COMPLETE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContentMode.COMPLETE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContentMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertCodeSystemContentMode(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentModeEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case NOTPRESENT: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.NOTPRESENT); - break; - case EXAMPLAR: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.EXAMPLE); - break; - case FRAGMENT: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.FRAGMENT); - break; - case COMPLETE: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.COMPLETE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CodeSystem.CodeSystemContentModeEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTPRESENT: + tgt.setValue(CodeSystem.CodeSystemContentMode.NOTPRESENT); + break; + case EXAMPLAR: + tgt.setValue(CodeSystem.CodeSystemContentMode.EXAMPLE); + break; + case FRAGMENT: + tgt.setValue(CodeSystem.CodeSystemContentMode.FRAGMENT); + break; + case COMPLETE: + tgt.setValue(CodeSystem.CodeSystemContentMode.COMPLETE); + break; + default: + tgt.setValue(CodeSystem.CodeSystemContentMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r4.model.CodeSystem.CodeSystemFilterComponent convertCodeSystemFilterComponent(org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemFilterComponent src) throws FHIRException { @@ -358,64 +366,72 @@ public static org.hl7.fhir.r4.model.CodeSystem.PropertyComponent convertProperty } static public org.hl7.fhir.r4.model.Enumeration convertPropertyType(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CodeSystem.PropertyTypeEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case CODE: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.CODE); - break; - case CODING: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.CODING); - break; - case STRING: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.STRING); - break; - case INTEGER: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.INTEGER); - break; - case BOOLEAN: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.BOOLEAN); - break; - case DATETIME: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.DATETIME); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CodeSystem.PropertyTypeEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CODE: + tgt.setValue(CodeSystem.PropertyType.CODE); + break; + case CODING: + tgt.setValue(CodeSystem.PropertyType.CODING); + break; + case STRING: + tgt.setValue(CodeSystem.PropertyType.STRING); + break; + case INTEGER: + tgt.setValue(CodeSystem.PropertyType.INTEGER); + break; + case BOOLEAN: + tgt.setValue(CodeSystem.PropertyType.BOOLEAN); + break; + case DATETIME: + tgt.setValue(CodeSystem.PropertyType.DATETIME); + break; + default: + tgt.setValue(CodeSystem.PropertyType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertPropertyType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyTypeEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case CODE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.CODE); - break; - case CODING: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.CODING); - break; - case STRING: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.STRING); - break; - case INTEGER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.INTEGER); - break; - case BOOLEAN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.BOOLEAN); - break; - case DATETIME: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.DATETIME); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyTypeEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CODE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.CODE); + break; + case CODING: + tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.CODING); + break; + case STRING: + tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.STRING); + break; + case INTEGER: + tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.INTEGER); + break; + case BOOLEAN: + tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.BOOLEAN); + break; + case DATETIME: + tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.DATETIME); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/CompartmentDefinition14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/CompartmentDefinition14_40.java index 086dc4f9f3..c7aab92626 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/CompartmentDefinition14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/CompartmentDefinition14_40.java @@ -7,6 +7,8 @@ import org.hl7.fhir.convertors.conv14_40.datatypes14_40.primitivetypes14_40.DateTime14_40; import org.hl7.fhir.convertors.conv14_40.datatypes14_40.primitivetypes14_40.String14_40; import org.hl7.fhir.convertors.conv14_40.datatypes14_40.primitivetypes14_40.Uri14_40; +import org.hl7.fhir.dstu2016may.model.CompartmentDefinition; +import org.hl7.fhir.dstu2016may.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; public class CompartmentDefinition14_40 { @@ -126,58 +128,66 @@ public static org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentDe } static public org.hl7.fhir.dstu2016may.model.Enumeration convertCompartmentType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentTypeEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case PATIENT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentType.PATIENT); - break; - case ENCOUNTER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentType.ENCOUNTER); - break; - case RELATEDPERSON: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentType.RELATEDPERSON); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentType.PRACTITIONER); - break; - case DEVICE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentType.DEVICE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CompartmentDefinition.CompartmentTypeEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PATIENT: + tgt.setValue(CompartmentDefinition.CompartmentType.PATIENT); + break; + case ENCOUNTER: + tgt.setValue(CompartmentDefinition.CompartmentType.ENCOUNTER); + break; + case RELATEDPERSON: + tgt.setValue(CompartmentDefinition.CompartmentType.RELATEDPERSON); + break; + case PRACTITIONER: + tgt.setValue(CompartmentDefinition.CompartmentType.PRACTITIONER); + break; + case DEVICE: + tgt.setValue(CompartmentDefinition.CompartmentType.DEVICE); + break; + default: + tgt.setValue(CompartmentDefinition.CompartmentType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertCompartmentType(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentTypeEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case PATIENT: - tgt.setValue(org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.PATIENT); - break; - case ENCOUNTER: - tgt.setValue(org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.ENCOUNTER); - break; - case RELATEDPERSON: - tgt.setValue(org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.RELATEDPERSON); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.PRACTITIONER); - break; - case DEVICE: - tgt.setValue(org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.DEVICE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentTypeEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PATIENT: + tgt.setValue(org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.PATIENT); + break; + case ENCOUNTER: + tgt.setValue(org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.ENCOUNTER); + break; + case RELATEDPERSON: + tgt.setValue(org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.RELATEDPERSON); + break; + case PRACTITIONER: + tgt.setValue(org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.PRACTITIONER); + break; + case DEVICE: + tgt.setValue(org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.DEVICE); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/ConceptMap14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/ConceptMap14_40.java index 1cc4a4268f..d8e79bf338 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/ConceptMap14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/ConceptMap14_40.java @@ -19,6 +19,8 @@ import org.hl7.fhir.r4.model.CanonicalType; import org.hl7.fhir.r4.model.ConceptMap; import org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupComponent; +import org.hl7.fhir.r4.model.Enumeration; +import org.hl7.fhir.r4.model.Enumerations; public class ConceptMap14_40 { @@ -144,83 +146,91 @@ public static org.hl7.fhir.r4.model.ContactDetail convertConceptMapContactCompon } static public org.hl7.fhir.r4.model.Enumeration convertConceptMapEquivalence(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalenceEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case EQUIVALENT: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.EQUIVALENT); - break; - case EQUAL: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.EQUAL); - break; - case WIDER: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.WIDER); - break; - case SUBSUMES: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.SUBSUMES); - break; - case NARROWER: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.NARROWER); - break; - case SPECIALIZES: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.SPECIALIZES); - break; - case INEXACT: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.INEXACT); - break; - case UNMATCHED: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.UNMATCHED); - break; - case DISJOINT: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.DISJOINT); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ConceptMapEquivalenceEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUIVALENT: + tgt.setValue(Enumerations.ConceptMapEquivalence.EQUIVALENT); + break; + case EQUAL: + tgt.setValue(Enumerations.ConceptMapEquivalence.EQUAL); + break; + case WIDER: + tgt.setValue(Enumerations.ConceptMapEquivalence.WIDER); + break; + case SUBSUMES: + tgt.setValue(Enumerations.ConceptMapEquivalence.SUBSUMES); + break; + case NARROWER: + tgt.setValue(Enumerations.ConceptMapEquivalence.NARROWER); + break; + case SPECIALIZES: + tgt.setValue(Enumerations.ConceptMapEquivalence.SPECIALIZES); + break; + case INEXACT: + tgt.setValue(Enumerations.ConceptMapEquivalence.INEXACT); + break; + case UNMATCHED: + tgt.setValue(Enumerations.ConceptMapEquivalence.UNMATCHED); + break; + case DISJOINT: + tgt.setValue(Enumerations.ConceptMapEquivalence.DISJOINT); + break; + default: + tgt.setValue(Enumerations.ConceptMapEquivalence.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertConceptMapEquivalence(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalenceEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case EQUIVALENT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence.EQUIVALENT); - break; - case EQUAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence.EQUAL); - break; - case WIDER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence.WIDER); - break; - case SUBSUMES: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence.SUBSUMES); - break; - case NARROWER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence.NARROWER); - break; - case SPECIALIZES: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence.SPECIALIZES); - break; - case INEXACT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence.INEXACT); - break; - case UNMATCHED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence.UNMATCHED); - break; - case DISJOINT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence.DISJOINT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalenceEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUIVALENT: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence.EQUIVALENT); + break; + case EQUAL: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence.EQUAL); + break; + case WIDER: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence.WIDER); + break; + case SUBSUMES: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence.SUBSUMES); + break; + case NARROWER: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence.NARROWER); + break; + case SPECIALIZES: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence.SPECIALIZES); + break; + case INEXACT: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence.INEXACT); + break; + case UNMATCHED: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence.UNMATCHED); + break; + case DISJOINT: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence.DISJOINT); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent convertOtherElementComponent(org.hl7.fhir.dstu2016may.model.ConceptMap.OtherElementComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/Conformance14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/Conformance14_40.java index 12734273f4..f090ce2aa9 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/Conformance14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/Conformance14_40.java @@ -13,9 +13,12 @@ import org.hl7.fhir.convertors.conv14_40.datatypes14_40.primitivetypes14_40.String14_40; import org.hl7.fhir.convertors.conv14_40.datatypes14_40.primitivetypes14_40.UnsignedInt14_40; import org.hl7.fhir.convertors.conv14_40.datatypes14_40.primitivetypes14_40.Uri14_40; +import org.hl7.fhir.dstu2016may.model.Conformance; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.CapabilityStatement; import org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestComponent; import org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceComponent; +import org.hl7.fhir.r4.model.Enumeration; public class Conformance14_40 { @@ -28,21 +31,25 @@ public class Conformance14_40 { static public org.hl7.fhir.r4.model.Enumeration convertConditionalDeleteStatus(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { if (src == null || src.isEmpty()) return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatusEnumFactory()); + Enumeration tgt = new Enumeration<>(new CapabilityStatement.ConditionalDeleteStatusEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus.NOTSUPPORTED); - break; - case SINGLE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus.SINGLE); - break; - case MULTIPLE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus.MULTIPLE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTSUPPORTED: + tgt.setValue(CapabilityStatement.ConditionalDeleteStatus.NOTSUPPORTED); + break; + case SINGLE: + tgt.setValue(CapabilityStatement.ConditionalDeleteStatus.SINGLE); + break; + case MULTIPLE: + tgt.setValue(CapabilityStatement.ConditionalDeleteStatus.MULTIPLE); + break; + default: + tgt.setValue(CapabilityStatement.ConditionalDeleteStatus.NULL); + break; + } } return tgt; } @@ -50,21 +57,25 @@ static public org.hl7.fhir.r4.model.Enumeration convertConditionalDeleteStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { if (src == null || src.isEmpty()) return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Conformance.ConditionalDeleteStatusEnumFactory()); + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new Conformance.ConditionalDeleteStatusEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ConditionalDeleteStatus.NOTSUPPORTED); - break; - case SINGLE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ConditionalDeleteStatus.SINGLE); - break; - case MULTIPLE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ConditionalDeleteStatus.MULTIPLE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ConditionalDeleteStatus.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTSUPPORTED: + tgt.setValue(Conformance.ConditionalDeleteStatus.NOTSUPPORTED); + break; + case SINGLE: + tgt.setValue(Conformance.ConditionalDeleteStatus.SINGLE); + break; + case MULTIPLE: + tgt.setValue(Conformance.ConditionalDeleteStatus.MULTIPLE); + break; + default: + tgt.setValue(Conformance.ConditionalDeleteStatus.NULL); + break; + } } return tgt; } @@ -568,21 +579,25 @@ public static org.hl7.fhir.dstu2016may.model.Conformance.ConformanceSoftwareComp static public org.hl7.fhir.dstu2016may.model.Enumeration convertConformanceStatementKind(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { if (src == null || src.isEmpty()) return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Conformance.ConformanceStatementKindEnumFactory()); + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new Conformance.ConformanceStatementKindEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ConformanceStatementKind.INSTANCE); - break; - case CAPABILITY: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ConformanceStatementKind.CAPABILITY); - break; - case REQUIREMENTS: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ConformanceStatementKind.REQUIREMENTS); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ConformanceStatementKind.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(Conformance.ConformanceStatementKind.INSTANCE); + break; + case CAPABILITY: + tgt.setValue(Conformance.ConformanceStatementKind.CAPABILITY); + break; + case REQUIREMENTS: + tgt.setValue(Conformance.ConformanceStatementKind.REQUIREMENTS); + break; + default: + tgt.setValue(Conformance.ConformanceStatementKind.NULL); + break; + } } return tgt; } @@ -590,21 +605,25 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration convertConformanceStatementKind(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { if (src == null || src.isEmpty()) return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKindEnumFactory()); + Enumeration tgt = new Enumeration<>(new CapabilityStatement.CapabilityStatementKindEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind.INSTANCE); - break; - case CAPABILITY: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind.CAPABILITY); - break; - case REQUIREMENTS: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind.REQUIREMENTS); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(CapabilityStatement.CapabilityStatementKind.INSTANCE); + break; + case CAPABILITY: + tgt.setValue(CapabilityStatement.CapabilityStatementKind.CAPABILITY); + break; + case REQUIREMENTS: + tgt.setValue(CapabilityStatement.CapabilityStatementKind.REQUIREMENTS); + break; + default: + tgt.setValue(CapabilityStatement.CapabilityStatementKind.NULL); + break; + } } return tgt; } @@ -612,18 +631,22 @@ static public org.hl7.fhir.r4.model.Enumeration convertDocumentMode(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { if (src == null || src.isEmpty()) return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.DocumentModeEnumFactory()); + Enumeration tgt = new Enumeration<>(new CapabilityStatement.DocumentModeEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case PRODUCER: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.DocumentMode.PRODUCER); - break; - case CONSUMER: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.DocumentMode.CONSUMER); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.DocumentMode.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRODUCER: + tgt.setValue(CapabilityStatement.DocumentMode.PRODUCER); + break; + case CONSUMER: + tgt.setValue(CapabilityStatement.DocumentMode.CONSUMER); + break; + default: + tgt.setValue(CapabilityStatement.DocumentMode.NULL); + break; + } } return tgt; } @@ -631,18 +654,22 @@ static public org.hl7.fhir.r4.model.Enumeration convertDocumentMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { if (src == null || src.isEmpty()) return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Conformance.DocumentModeEnumFactory()); + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new Conformance.DocumentModeEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case PRODUCER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.DocumentMode.PRODUCER); - break; - case CONSUMER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.DocumentMode.CONSUMER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.DocumentMode.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRODUCER: + tgt.setValue(Conformance.DocumentMode.PRODUCER); + break; + case CONSUMER: + tgt.setValue(Conformance.DocumentMode.CONSUMER); + break; + default: + tgt.setValue(Conformance.DocumentMode.NULL); + break; + } } return tgt; } @@ -674,21 +701,25 @@ public static org.hl7.fhir.dstu2016may.model.Conformance.ResourceInteractionComp static public org.hl7.fhir.r4.model.Enumeration convertResourceVersionPolicy(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { if (src == null || src.isEmpty()) return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicyEnumFactory()); + Enumeration tgt = new Enumeration<>(new CapabilityStatement.ResourceVersionPolicyEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case NOVERSION: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy.NOVERSION); - break; - case VERSIONED: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy.VERSIONED); - break; - case VERSIONEDUPDATE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy.VERSIONEDUPDATE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOVERSION: + tgt.setValue(CapabilityStatement.ResourceVersionPolicy.NOVERSION); + break; + case VERSIONED: + tgt.setValue(CapabilityStatement.ResourceVersionPolicy.VERSIONED); + break; + case VERSIONEDUPDATE: + tgt.setValue(CapabilityStatement.ResourceVersionPolicy.VERSIONEDUPDATE); + break; + default: + tgt.setValue(CapabilityStatement.ResourceVersionPolicy.NULL); + break; + } } return tgt; } @@ -696,21 +727,25 @@ static public org.hl7.fhir.r4.model.Enumeration convertResourceVersionPolicy(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { if (src == null || src.isEmpty()) return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Conformance.ResourceVersionPolicyEnumFactory()); + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new Conformance.ResourceVersionPolicyEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case NOVERSION: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ResourceVersionPolicy.NOVERSION); - break; - case VERSIONED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ResourceVersionPolicy.VERSIONED); - break; - case VERSIONEDUPDATE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ResourceVersionPolicy.VERSIONEDUPDATE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ResourceVersionPolicy.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOVERSION: + tgt.setValue(Conformance.ResourceVersionPolicy.NOVERSION); + break; + case VERSIONED: + tgt.setValue(Conformance.ResourceVersionPolicy.VERSIONED); + break; + case VERSIONEDUPDATE: + tgt.setValue(Conformance.ResourceVersionPolicy.VERSIONEDUPDATE); + break; + default: + tgt.setValue(Conformance.ResourceVersionPolicy.NULL); + break; + } } return tgt; } @@ -718,18 +753,22 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration convertRestfulConformanceMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { if (src == null || src.isEmpty()) return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Conformance.RestfulConformanceModeEnumFactory()); + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new Conformance.RestfulConformanceModeEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case CLIENT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.RestfulConformanceMode.CLIENT); - break; - case SERVER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.RestfulConformanceMode.SERVER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.RestfulConformanceMode.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CLIENT: + tgt.setValue(Conformance.RestfulConformanceMode.CLIENT); + break; + case SERVER: + tgt.setValue(Conformance.RestfulConformanceMode.SERVER); + break; + default: + tgt.setValue(Conformance.RestfulConformanceMode.NULL); + break; + } } return tgt; } @@ -737,18 +776,22 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration convertRestfulConformanceMode(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { if (src == null || src.isEmpty()) return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityModeEnumFactory()); + Enumeration tgt = new Enumeration<>(new CapabilityStatement.RestfulCapabilityModeEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case CLIENT: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityMode.CLIENT); - break; - case SERVER: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityMode.SERVER); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityMode.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CLIENT: + tgt.setValue(CapabilityStatement.RestfulCapabilityMode.CLIENT); + break; + case SERVER: + tgt.setValue(CapabilityStatement.RestfulCapabilityMode.SERVER); + break; + default: + tgt.setValue(CapabilityStatement.RestfulCapabilityMode.NULL); + break; + } } return tgt; } @@ -780,21 +823,25 @@ public static org.hl7.fhir.r4.model.CapabilityStatement.SystemInteractionCompone static public org.hl7.fhir.dstu2016may.model.Enumeration convertSystemRestfulInteraction(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { if (src == null || src.isEmpty()) return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Conformance.SystemRestfulInteractionEnumFactory()); + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new Conformance.SystemRestfulInteractionEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case TRANSACTION: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.SystemRestfulInteraction.TRANSACTION); - break; - case SEARCHSYSTEM: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.SystemRestfulInteraction.SEARCHSYSTEM); - break; - case HISTORYSYSTEM: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.SystemRestfulInteraction.HISTORYSYSTEM); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.SystemRestfulInteraction.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case TRANSACTION: + tgt.setValue(Conformance.SystemRestfulInteraction.TRANSACTION); + break; + case SEARCHSYSTEM: + tgt.setValue(Conformance.SystemRestfulInteraction.SEARCHSYSTEM); + break; + case HISTORYSYSTEM: + tgt.setValue(Conformance.SystemRestfulInteraction.HISTORYSYSTEM); + break; + default: + tgt.setValue(Conformance.SystemRestfulInteraction.NULL); + break; + } } return tgt; } @@ -802,21 +849,25 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration convertSystemRestfulInteraction(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { if (src == null || src.isEmpty()) return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteractionEnumFactory()); + Enumeration tgt = new Enumeration<>(new CapabilityStatement.SystemRestfulInteractionEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case TRANSACTION: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.TRANSACTION); - break; - case SEARCHSYSTEM: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.SEARCHSYSTEM); - break; - case HISTORYSYSTEM: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.HISTORYSYSTEM); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case TRANSACTION: + tgt.setValue(CapabilityStatement.SystemRestfulInteraction.TRANSACTION); + break; + case SEARCHSYSTEM: + tgt.setValue(CapabilityStatement.SystemRestfulInteraction.SEARCHSYSTEM); + break; + case HISTORYSYSTEM: + tgt.setValue(CapabilityStatement.SystemRestfulInteraction.HISTORYSYSTEM); + break; + default: + tgt.setValue(CapabilityStatement.SystemRestfulInteraction.NULL); + break; + } } return tgt; } @@ -824,36 +875,40 @@ static public org.hl7.fhir.r4.model.Enumeration convertTypeRestfulInteraction(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { if (src == null || src.isEmpty()) return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteractionEnumFactory()); + Enumeration tgt = new Enumeration<>(new CapabilityStatement.TypeRestfulInteractionEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case READ: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.READ); - break; - case VREAD: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.VREAD); - break; - case UPDATE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.UPDATE); - break; - case DELETE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.DELETE); - break; - case HISTORYINSTANCE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.HISTORYINSTANCE); - break; - case HISTORYTYPE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.HISTORYTYPE); - break; - case CREATE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.CREATE); - break; - case SEARCHTYPE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.SEARCHTYPE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case READ: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.READ); + break; + case VREAD: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.VREAD); + break; + case UPDATE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.UPDATE); + break; + case DELETE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.DELETE); + break; + case HISTORYINSTANCE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.HISTORYINSTANCE); + break; + case HISTORYTYPE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.HISTORYTYPE); + break; + case CREATE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.CREATE); + break; + case SEARCHTYPE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.SEARCHTYPE); + break; + default: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.NULL); + break; + } } return tgt; } @@ -861,36 +916,40 @@ static public org.hl7.fhir.r4.model.Enumeration convertTypeRestfulInteraction(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { if (src == null || src.isEmpty()) return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Conformance.TypeRestfulInteractionEnumFactory()); + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new Conformance.TypeRestfulInteractionEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case READ: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.TypeRestfulInteraction.READ); - break; - case VREAD: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.TypeRestfulInteraction.VREAD); - break; - case UPDATE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.TypeRestfulInteraction.UPDATE); - break; - case DELETE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.TypeRestfulInteraction.DELETE); - break; - case HISTORYINSTANCE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.TypeRestfulInteraction.HISTORYINSTANCE); - break; - case HISTORYTYPE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.TypeRestfulInteraction.HISTORYTYPE); - break; - case CREATE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.TypeRestfulInteraction.CREATE); - break; - case SEARCHTYPE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.TypeRestfulInteraction.SEARCHTYPE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.TypeRestfulInteraction.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case READ: + tgt.setValue(Conformance.TypeRestfulInteraction.READ); + break; + case VREAD: + tgt.setValue(Conformance.TypeRestfulInteraction.VREAD); + break; + case UPDATE: + tgt.setValue(Conformance.TypeRestfulInteraction.UPDATE); + break; + case DELETE: + tgt.setValue(Conformance.TypeRestfulInteraction.DELETE); + break; + case HISTORYINSTANCE: + tgt.setValue(Conformance.TypeRestfulInteraction.HISTORYINSTANCE); + break; + case HISTORYTYPE: + tgt.setValue(Conformance.TypeRestfulInteraction.HISTORYTYPE); + break; + case CREATE: + tgt.setValue(Conformance.TypeRestfulInteraction.CREATE); + break; + case SEARCHTYPE: + tgt.setValue(Conformance.TypeRestfulInteraction.SEARCHTYPE); + break; + default: + tgt.setValue(Conformance.TypeRestfulInteraction.NULL); + break; + } } return tgt; } @@ -900,20 +959,20 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityModeEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityMode.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case SENDER: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityMode.SENDER); - break; - case RECEIVER: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityMode.RECEIVER); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityMode.NULL); - break; - } - } + tgt.setValue(CapabilityStatement.EventCapabilityMode.SENDER); + break; + case RECEIVER: + tgt.setValue(CapabilityStatement.EventCapabilityMode.RECEIVER); + break; + default: + tgt.setValue(CapabilityStatement.EventCapabilityMode.NULL); + break; + } +} return tgt; } @@ -922,20 +981,20 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Conformance.ConformanceEventModeEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ConformanceEventMode.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case SENDER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ConformanceEventMode.SENDER); - break; - case RECEIVER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ConformanceEventMode.RECEIVER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ConformanceEventMode.NULL); - break; - } - } + tgt.setValue(Conformance.ConformanceEventMode.SENDER); + break; + case RECEIVER: + tgt.setValue(Conformance.ConformanceEventMode.RECEIVER); + break; + default: + tgt.setValue(Conformance.ConformanceEventMode.NULL); + break; + } +} return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/Enumerations14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/Enumerations14_40.java index a9062a107a..7041dd5347 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/Enumerations14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/Enumerations14_40.java @@ -2,6 +2,7 @@ import org.hl7.fhir.convertors.context.ConversionContext14_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Enumerations; public class Enumerations14_40 { static public org.hl7.fhir.r4.model.Enumeration convertBindingStrength(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { @@ -9,26 +10,26 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.BindingStrengthEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.BindingStrength.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case REQUIRED: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.BindingStrength.REQUIRED); - break; - case EXTENSIBLE: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.BindingStrength.EXTENSIBLE); - break; - case PREFERRED: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.BindingStrength.PREFERRED); - break; - case EXAMPLE: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.BindingStrength.EXAMPLE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.BindingStrength.NULL); - break; - } - } + tgt.setValue(Enumerations.BindingStrength.REQUIRED); + break; + case EXTENSIBLE: + tgt.setValue(Enumerations.BindingStrength.EXTENSIBLE); + break; + case PREFERRED: + tgt.setValue(Enumerations.BindingStrength.PREFERRED); + break; + case EXAMPLE: + tgt.setValue(Enumerations.BindingStrength.EXAMPLE); + break; + default: + tgt.setValue(Enumerations.BindingStrength.NULL); + break; + } +} return tgt; } @@ -37,26 +38,26 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrengthEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case REQUIRED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength.REQUIRED); - break; - case EXTENSIBLE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength.EXTENSIBLE); - break; - case PREFERRED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength.PREFERRED); - break; - case EXAMPLE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength.EXAMPLE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength.REQUIRED); + break; + case EXTENSIBLE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength.EXTENSIBLE); + break; + case PREFERRED: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength.PREFERRED); + break; + case EXAMPLE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength.EXAMPLE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength.NULL); + break; + } +} return tgt; } @@ -65,23 +66,23 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.PublicationStatusEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case DRAFT: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.ACTIVE); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.RETIRED); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.NULL); - break; - } - } + tgt.setValue(Enumerations.PublicationStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(Enumerations.PublicationStatus.ACTIVE); + break; + case RETIRED: + tgt.setValue(Enumerations.PublicationStatus.RETIRED); + break; + default: + tgt.setValue(Enumerations.PublicationStatus.NULL); + break; + } +} return tgt; } @@ -90,23 +91,23 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatusEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case DRAFT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus.ACTIVE); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus.RETIRED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus.ACTIVE); + break; + case RETIRED: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus.RETIRED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus.NULL); + break; + } +} return tgt; } @@ -115,38 +116,38 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.SearchParamTypeEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case NUMBER: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.NUMBER); - break; - case DATE: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.DATE); - break; - case STRING: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.STRING); - break; - case TOKEN: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.TOKEN); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.REFERENCE); - break; - case COMPOSITE: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.COMPOSITE); - break; - case QUANTITY: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.QUANTITY); - break; - case URI: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.URI); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.NULL); - break; - } - } + tgt.setValue(Enumerations.SearchParamType.NUMBER); + break; + case DATE: + tgt.setValue(Enumerations.SearchParamType.DATE); + break; + case STRING: + tgt.setValue(Enumerations.SearchParamType.STRING); + break; + case TOKEN: + tgt.setValue(Enumerations.SearchParamType.TOKEN); + break; + case REFERENCE: + tgt.setValue(Enumerations.SearchParamType.REFERENCE); + break; + case COMPOSITE: + tgt.setValue(Enumerations.SearchParamType.COMPOSITE); + break; + case QUANTITY: + tgt.setValue(Enumerations.SearchParamType.QUANTITY); + break; + case URI: + tgt.setValue(Enumerations.SearchParamType.URI); + break; + default: + tgt.setValue(Enumerations.SearchParamType.NULL); + break; + } +} return tgt; } @@ -155,38 +156,38 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamTypeEnumFactory()); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case NUMBER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.NUMBER); - break; - case DATE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.DATE); - break; - case STRING: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.STRING); - break; - case TOKEN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.TOKEN); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.REFERENCE); - break; - case COMPOSITE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.COMPOSITE); - break; - case QUANTITY: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.QUANTITY); - break; - case URI: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.URI); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.NUMBER); + break; + case DATE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.DATE); + break; + case STRING: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.STRING); + break; + case TOKEN: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.TOKEN); + break; + case REFERENCE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.REFERENCE); + break; + case COMPOSITE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.COMPOSITE); + break; + case QUANTITY: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.QUANTITY); + break; + case URI: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.URI); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/NamingSystem14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/NamingSystem14_40.java index 580211be86..d4d31f1692 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/NamingSystem14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/NamingSystem14_40.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv14_40.datatypes14_40.primitivetypes14_40.Boolean14_40; import org.hl7.fhir.convertors.conv14_40.datatypes14_40.primitivetypes14_40.DateTime14_40; import org.hl7.fhir.convertors.conv14_40.datatypes14_40.primitivetypes14_40.String14_40; +import org.hl7.fhir.dstu2016may.model.Enumeration; +import org.hl7.fhir.dstu2016may.model.NamingSystem; import org.hl7.fhir.exceptions.FHIRException; public class NamingSystem14_40 { @@ -107,97 +109,113 @@ public static org.hl7.fhir.r4.model.ContactDetail convertNamingSystemContactComp } static public org.hl7.fhir.dstu2016may.model.Enumeration convertNamingSystemIdentifierType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemIdentifierTypeEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case OID: - tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemIdentifierType.OID); - break; - case UUID: - tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemIdentifierType.UUID); - break; - case URI: - tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemIdentifierType.URI); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemIdentifierType.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemIdentifierType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new NamingSystem.NamingSystemIdentifierTypeEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OID: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.OID); + break; + case UUID: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.UUID); + break; + case URI: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.URI); + break; + case OTHER: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.OTHER); + break; + default: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertNamingSystemIdentifierType(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierTypeEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case OID: - tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.OID); - break; - case UUID: - tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.UUID); - break; - case URI: - tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.URI); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierTypeEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OID: + tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.OID); + break; + case UUID: + tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.UUID); + break; + case URI: + tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.URI); + break; + case OTHER: + tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.OTHER); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertNamingSystemType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemTypeEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case CODESYSTEM: - tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemType.CODESYSTEM); - break; - case IDENTIFIER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemType.IDENTIFIER); - break; - case ROOT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemType.ROOT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new NamingSystem.NamingSystemTypeEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CODESYSTEM: + tgt.setValue(NamingSystem.NamingSystemType.CODESYSTEM); + break; + case IDENTIFIER: + tgt.setValue(NamingSystem.NamingSystemType.IDENTIFIER); + break; + case ROOT: + tgt.setValue(NamingSystem.NamingSystemType.ROOT); + break; + default: + tgt.setValue(NamingSystem.NamingSystemType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertNamingSystemType(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.NamingSystem.NamingSystemTypeEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case CODESYSTEM: - tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemType.CODESYSTEM); - break; - case IDENTIFIER: - tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemType.IDENTIFIER); - break; - case ROOT: - tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemType.ROOT); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.NamingSystem.NamingSystemTypeEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CODESYSTEM: + tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemType.CODESYSTEM); + break; + case IDENTIFIER: + tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemType.IDENTIFIER); + break; + case ROOT: + tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemType.ROOT); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemUniqueIdComponent convertNamingSystemUniqueIdComponent(org.hl7.fhir.r4.model.NamingSystem.NamingSystemUniqueIdComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/OperationDefinition14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/OperationDefinition14_40.java index daf05a6e7c..72afa8045a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/OperationDefinition14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/OperationDefinition14_40.java @@ -12,6 +12,8 @@ import org.hl7.fhir.convertors.conv14_40.datatypes14_40.primitivetypes14_40.Integer14_40; import org.hl7.fhir.convertors.conv14_40.datatypes14_40.primitivetypes14_40.String14_40; import org.hl7.fhir.convertors.conv14_40.datatypes14_40.primitivetypes14_40.Uri14_40; +import org.hl7.fhir.dstu2016may.model.Enumeration; +import org.hl7.fhir.dstu2016may.model.OperationDefinition; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4.model.Type; @@ -234,78 +236,94 @@ public static org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationDefini } static public org.hl7.fhir.dstu2016may.model.Enumeration convertOperationKind(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationKindEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case OPERATION: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationKind.OPERATION); - break; - case QUERY: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationKind.QUERY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new OperationDefinition.OperationKindEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OPERATION: + tgt.setValue(OperationDefinition.OperationKind.OPERATION); + break; + case QUERY: + tgt.setValue(OperationDefinition.OperationKind.QUERY); + break; + default: + tgt.setValue(OperationDefinition.OperationKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertOperationKind(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.OperationDefinition.OperationKindEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case OPERATION: - tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationKind.OPERATION); - break; - case QUERY: - tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationKind.QUERY); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.OperationDefinition.OperationKindEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OPERATION: + tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationKind.OPERATION); + break; + case QUERY: + tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationKind.QUERY); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertOperationParameterUse(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationParameterUseEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case IN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationParameterUse.IN); - break; - case OUT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationParameterUse.OUT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationParameterUse.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new OperationDefinition.OperationParameterUseEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case IN: + tgt.setValue(OperationDefinition.OperationParameterUse.IN); + break; + case OUT: + tgt.setValue(OperationDefinition.OperationParameterUse.OUT); + break; + default: + tgt.setValue(OperationDefinition.OperationParameterUse.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertOperationParameterUse(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUseEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case IN: - tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUse.IN); - break; - case OUT: - tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUse.OUT); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUse.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUseEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case IN: + tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUse.IN); + break; + case OUT: + tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUse.OUT); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUse.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/OperationOutcome14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/OperationOutcome14_40.java index 6ed8edb564..121c2dc1aa 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/OperationOutcome14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/OperationOutcome14_40.java @@ -5,257 +5,275 @@ import org.hl7.fhir.convertors.conv14_40.datatypes14_40.complextypes14_40.CodeableConcept14_40; import org.hl7.fhir.convertors.conv14_40.datatypes14_40.primitivetypes14_40.String14_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Enumeration; +import org.hl7.fhir.r4.model.OperationOutcome; public class OperationOutcome14_40 { static public org.hl7.fhir.r4.model.Enumeration convertIssueSeverity(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.OperationOutcome.IssueSeverityEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case FATAL: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.FATAL); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.ERROR); - break; - case WARNING: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.WARNING); - break; - case INFORMATION: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.INFORMATION); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new OperationOutcome.IssueSeverityEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FATAL: + tgt.setValue(OperationOutcome.IssueSeverity.FATAL); + break; + case ERROR: + tgt.setValue(OperationOutcome.IssueSeverity.ERROR); + break; + case WARNING: + tgt.setValue(OperationOutcome.IssueSeverity.WARNING); + break; + case INFORMATION: + tgt.setValue(OperationOutcome.IssueSeverity.INFORMATION); + break; + default: + tgt.setValue(OperationOutcome.IssueSeverity.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertIssueSeverity(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueSeverityEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case FATAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueSeverity.FATAL); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueSeverity.ERROR); - break; - case WARNING: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueSeverity.WARNING); - break; - case INFORMATION: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueSeverity.INFORMATION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueSeverity.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueSeverityEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FATAL: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueSeverity.FATAL); + break; + case ERROR: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueSeverity.ERROR); + break; + case WARNING: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueSeverity.WARNING); + break; + case INFORMATION: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueSeverity.INFORMATION); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueSeverity.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertIssueType(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.OperationOutcome.IssueTypeEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case INVALID: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.INVALID); - break; - case STRUCTURE: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.STRUCTURE); - break; - case REQUIRED: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.REQUIRED); - break; - case VALUE: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.VALUE); - break; - case INVARIANT: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.INVARIANT); - break; - case SECURITY: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.SECURITY); - break; - case LOGIN: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.LOGIN); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.UNKNOWN); - break; - case EXPIRED: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.EXPIRED); - break; - case FORBIDDEN: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.FORBIDDEN); - break; - case SUPPRESSED: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.SUPPRESSED); - break; - case PROCESSING: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.PROCESSING); - break; - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.NOTSUPPORTED); - break; - case DUPLICATE: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.DUPLICATE); - break; - case NOTFOUND: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.NOTFOUND); - break; - case TOOLONG: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.TOOLONG); - break; - case CODEINVALID: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.CODEINVALID); - break; - case EXTENSION: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.EXTENSION); - break; - case TOOCOSTLY: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.TOOCOSTLY); - break; - case BUSINESSRULE: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.BUSINESSRULE); - break; - case CONFLICT: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.CONFLICT); - break; - case INCOMPLETE: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.INCOMPLETE); - break; - case TRANSIENT: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.TRANSIENT); - break; - case LOCKERROR: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.LOCKERROR); - break; - case NOSTORE: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.NOSTORE); - break; - case EXCEPTION: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.EXCEPTION); - break; - case TIMEOUT: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.TIMEOUT); - break; - case THROTTLED: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.THROTTLED); - break; - case INFORMATIONAL: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.INFORMATIONAL); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new OperationOutcome.IssueTypeEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INVALID: + tgt.setValue(OperationOutcome.IssueType.INVALID); + break; + case STRUCTURE: + tgt.setValue(OperationOutcome.IssueType.STRUCTURE); + break; + case REQUIRED: + tgt.setValue(OperationOutcome.IssueType.REQUIRED); + break; + case VALUE: + tgt.setValue(OperationOutcome.IssueType.VALUE); + break; + case INVARIANT: + tgt.setValue(OperationOutcome.IssueType.INVARIANT); + break; + case SECURITY: + tgt.setValue(OperationOutcome.IssueType.SECURITY); + break; + case LOGIN: + tgt.setValue(OperationOutcome.IssueType.LOGIN); + break; + case UNKNOWN: + tgt.setValue(OperationOutcome.IssueType.UNKNOWN); + break; + case EXPIRED: + tgt.setValue(OperationOutcome.IssueType.EXPIRED); + break; + case FORBIDDEN: + tgt.setValue(OperationOutcome.IssueType.FORBIDDEN); + break; + case SUPPRESSED: + tgt.setValue(OperationOutcome.IssueType.SUPPRESSED); + break; + case PROCESSING: + tgt.setValue(OperationOutcome.IssueType.PROCESSING); + break; + case NOTSUPPORTED: + tgt.setValue(OperationOutcome.IssueType.NOTSUPPORTED); + break; + case DUPLICATE: + tgt.setValue(OperationOutcome.IssueType.DUPLICATE); + break; + case NOTFOUND: + tgt.setValue(OperationOutcome.IssueType.NOTFOUND); + break; + case TOOLONG: + tgt.setValue(OperationOutcome.IssueType.TOOLONG); + break; + case CODEINVALID: + tgt.setValue(OperationOutcome.IssueType.CODEINVALID); + break; + case EXTENSION: + tgt.setValue(OperationOutcome.IssueType.EXTENSION); + break; + case TOOCOSTLY: + tgt.setValue(OperationOutcome.IssueType.TOOCOSTLY); + break; + case BUSINESSRULE: + tgt.setValue(OperationOutcome.IssueType.BUSINESSRULE); + break; + case CONFLICT: + tgt.setValue(OperationOutcome.IssueType.CONFLICT); + break; + case INCOMPLETE: + tgt.setValue(OperationOutcome.IssueType.INCOMPLETE); + break; + case TRANSIENT: + tgt.setValue(OperationOutcome.IssueType.TRANSIENT); + break; + case LOCKERROR: + tgt.setValue(OperationOutcome.IssueType.LOCKERROR); + break; + case NOSTORE: + tgt.setValue(OperationOutcome.IssueType.NOSTORE); + break; + case EXCEPTION: + tgt.setValue(OperationOutcome.IssueType.EXCEPTION); + break; + case TIMEOUT: + tgt.setValue(OperationOutcome.IssueType.TIMEOUT); + break; + case THROTTLED: + tgt.setValue(OperationOutcome.IssueType.THROTTLED); + break; + case INFORMATIONAL: + tgt.setValue(OperationOutcome.IssueType.INFORMATIONAL); + break; + default: + tgt.setValue(OperationOutcome.IssueType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertIssueType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueTypeEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case INVALID: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.INVALID); - break; - case STRUCTURE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.STRUCTURE); - break; - case REQUIRED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.REQUIRED); - break; - case VALUE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.VALUE); - break; - case INVARIANT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.INVARIANT); - break; - case SECURITY: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.SECURITY); - break; - case LOGIN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.LOGIN); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.UNKNOWN); - break; - case EXPIRED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.EXPIRED); - break; - case FORBIDDEN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.FORBIDDEN); - break; - case SUPPRESSED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.SUPPRESSED); - break; - case PROCESSING: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.PROCESSING); - break; - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.NOTSUPPORTED); - break; - case DUPLICATE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.DUPLICATE); - break; - case NOTFOUND: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.NOTFOUND); - break; - case TOOLONG: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.TOOLONG); - break; - case CODEINVALID: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.CODEINVALID); - break; - case EXTENSION: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.EXTENSION); - break; - case TOOCOSTLY: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.TOOCOSTLY); - break; - case BUSINESSRULE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.BUSINESSRULE); - break; - case CONFLICT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.CONFLICT); - break; - case INCOMPLETE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.INCOMPLETE); - break; - case TRANSIENT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.TRANSIENT); - break; - case LOCKERROR: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.LOCKERROR); - break; - case NOSTORE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.NOSTORE); - break; - case EXCEPTION: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.EXCEPTION); - break; - case TIMEOUT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.TIMEOUT); - break; - case THROTTLED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.THROTTLED); - break; - case INFORMATIONAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.INFORMATIONAL); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueTypeEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INVALID: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.INVALID); + break; + case STRUCTURE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.STRUCTURE); + break; + case REQUIRED: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.REQUIRED); + break; + case VALUE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.VALUE); + break; + case INVARIANT: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.INVARIANT); + break; + case SECURITY: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.SECURITY); + break; + case LOGIN: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.LOGIN); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.UNKNOWN); + break; + case EXPIRED: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.EXPIRED); + break; + case FORBIDDEN: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.FORBIDDEN); + break; + case SUPPRESSED: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.SUPPRESSED); + break; + case PROCESSING: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.PROCESSING); + break; + case NOTSUPPORTED: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.NOTSUPPORTED); + break; + case DUPLICATE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.DUPLICATE); + break; + case NOTFOUND: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.NOTFOUND); + break; + case TOOLONG: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.TOOLONG); + break; + case CODEINVALID: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.CODEINVALID); + break; + case EXTENSION: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.EXTENSION); + break; + case TOOCOSTLY: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.TOOCOSTLY); + break; + case BUSINESSRULE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.BUSINESSRULE); + break; + case CONFLICT: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.CONFLICT); + break; + case INCOMPLETE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.INCOMPLETE); + break; + case TRANSIENT: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.TRANSIENT); + break; + case LOCKERROR: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.LOCKERROR); + break; + case NOSTORE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.NOSTORE); + break; + case EXCEPTION: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.EXCEPTION); + break; + case TIMEOUT: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.TIMEOUT); + break; + case THROTTLED: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.THROTTLED); + break; + case INFORMATIONAL: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.INFORMATIONAL); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2016may.model.OperationOutcome convertOperationOutcome(org.hl7.fhir.r4.model.OperationOutcome src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/Questionnaire14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/Questionnaire14_40.java index a02b0e5de3..709e39a92d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/Questionnaire14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/Questionnaire14_40.java @@ -13,9 +13,8 @@ import org.hl7.fhir.convertors.conv14_40.datatypes14_40.primitivetypes14_40.String14_40; import org.hl7.fhir.convertors.conv14_40.datatypes14_40.primitivetypes14_40.Uri14_40; import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.r4.model.ContactDetail; +import org.hl7.fhir.r4.model.*; import org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator; -import org.hl7.fhir.r4.model.UsageContext; public class Questionnaire14_40 { @@ -216,177 +215,193 @@ public static org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemOpti } static public org.hl7.fhir.r4.model.Enumeration convertQuestionnaireItemType(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemTypeEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case GROUP: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.GROUP); - break; - case DISPLAY: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.DISPLAY); - break; - case QUESTION: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.QUESTION); - break; - case BOOLEAN: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.BOOLEAN); - break; - case DECIMAL: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.DECIMAL); - break; - case INTEGER: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.INTEGER); - break; - case DATE: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.DATE); - break; - case DATETIME: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.DATETIME); - break; - case INSTANT: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.DATETIME); - break; - case TIME: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.TIME); - break; - case STRING: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.STRING); - break; - case TEXT: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.TEXT); - break; - case URL: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.URL); - break; - case CHOICE: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.CHOICE); - break; - case OPENCHOICE: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.OPENCHOICE); - break; - case ATTACHMENT: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.ATTACHMENT); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.REFERENCE); - break; - case QUANTITY: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.QUANTITY); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Questionnaire.QuestionnaireItemTypeEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case GROUP: + tgt.setValue(Questionnaire.QuestionnaireItemType.GROUP); + break; + case DISPLAY: + tgt.setValue(Questionnaire.QuestionnaireItemType.DISPLAY); + break; + case QUESTION: + tgt.setValue(Questionnaire.QuestionnaireItemType.QUESTION); + break; + case BOOLEAN: + tgt.setValue(Questionnaire.QuestionnaireItemType.BOOLEAN); + break; + case DECIMAL: + tgt.setValue(Questionnaire.QuestionnaireItemType.DECIMAL); + break; + case INTEGER: + tgt.setValue(Questionnaire.QuestionnaireItemType.INTEGER); + break; + case DATE: + tgt.setValue(Questionnaire.QuestionnaireItemType.DATE); + break; + case DATETIME: + tgt.setValue(Questionnaire.QuestionnaireItemType.DATETIME); + break; + case INSTANT: + tgt.setValue(Questionnaire.QuestionnaireItemType.DATETIME); + break; + case TIME: + tgt.setValue(Questionnaire.QuestionnaireItemType.TIME); + break; + case STRING: + tgt.setValue(Questionnaire.QuestionnaireItemType.STRING); + break; + case TEXT: + tgt.setValue(Questionnaire.QuestionnaireItemType.TEXT); + break; + case URL: + tgt.setValue(Questionnaire.QuestionnaireItemType.URL); + break; + case CHOICE: + tgt.setValue(Questionnaire.QuestionnaireItemType.CHOICE); + break; + case OPENCHOICE: + tgt.setValue(Questionnaire.QuestionnaireItemType.OPENCHOICE); + break; + case ATTACHMENT: + tgt.setValue(Questionnaire.QuestionnaireItemType.ATTACHMENT); + break; + case REFERENCE: + tgt.setValue(Questionnaire.QuestionnaireItemType.REFERENCE); + break; + case QUANTITY: + tgt.setValue(Questionnaire.QuestionnaireItemType.QUANTITY); + break; + default: + tgt.setValue(Questionnaire.QuestionnaireItemType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertQuestionnaireItemType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemTypeEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case GROUP: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.GROUP); - break; - case DISPLAY: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.DISPLAY); - break; - case QUESTION: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.QUESTION); - break; - case BOOLEAN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.BOOLEAN); - break; - case DECIMAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.DECIMAL); - break; - case INTEGER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.INTEGER); - break; - case DATE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.DATE); - break; - case DATETIME: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.DATETIME); - break; - case TIME: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.TIME); - break; - case STRING: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.STRING); - break; - case TEXT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.TEXT); - break; - case URL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.URL); - break; - case CHOICE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.CHOICE); - break; - case OPENCHOICE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.OPENCHOICE); - break; - case ATTACHMENT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.ATTACHMENT); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.REFERENCE); - break; - case QUANTITY: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.QUANTITY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemTypeEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case GROUP: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.GROUP); + break; + case DISPLAY: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.DISPLAY); + break; + case QUESTION: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.QUESTION); + break; + case BOOLEAN: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.BOOLEAN); + break; + case DECIMAL: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.DECIMAL); + break; + case INTEGER: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.INTEGER); + break; + case DATE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.DATE); + break; + case DATETIME: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.DATETIME); + break; + case TIME: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.TIME); + break; + case STRING: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.STRING); + break; + case TEXT: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.TEXT); + break; + case URL: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.URL); + break; + case CHOICE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.CHOICE); + break; + case OPENCHOICE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.OPENCHOICE); + break; + case ATTACHMENT: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.ATTACHMENT); + break; + case REFERENCE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.REFERENCE); + break; + case QUANTITY: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.QUANTITY); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertQuestionnaireStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireStatusEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireStatus.PUBLISHED); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireStatus.RETIRED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireStatusEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireStatus.PUBLISHED); + break; + case RETIRED: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireStatus.RETIRED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertQuestionnaireStatus(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.PublicationStatusEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.DRAFT); - break; - case PUBLISHED: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.ACTIVE); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.RETIRED); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.PublicationStatusEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(Enumerations.PublicationStatus.DRAFT); + break; + case PUBLISHED: + tgt.setValue(Enumerations.PublicationStatus.ACTIVE); + break; + case RETIRED: + tgt.setValue(Enumerations.PublicationStatus.RETIRED); + break; + default: + tgt.setValue(Enumerations.PublicationStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/QuestionnaireResponse14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/QuestionnaireResponse14_40.java index 8fd2602cae..45ea4b5c4c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/QuestionnaireResponse14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/QuestionnaireResponse14_40.java @@ -5,6 +5,8 @@ import org.hl7.fhir.convertors.conv14_40.datatypes14_40.complextypes14_40.Identifier14_40; import org.hl7.fhir.convertors.conv14_40.datatypes14_40.primitivetypes14_40.DateTime14_40; import org.hl7.fhir.convertors.conv14_40.datatypes14_40.primitivetypes14_40.String14_40; +import org.hl7.fhir.dstu2016may.model.Enumeration; +import org.hl7.fhir.dstu2016may.model.QuestionnaireResponse; import org.hl7.fhir.exceptions.FHIRException; public class QuestionnaireResponse14_40 { @@ -118,46 +120,54 @@ public static org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseI } static public org.hl7.fhir.dstu2016may.model.Enumeration convertQuestionnaireResponseStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED); + break; + case AMENDED: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED); + break; + default: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertQuestionnaireResponseStatus(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED); + break; + case AMENDED: + tgt.setValue(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/SearchParameter14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/SearchParameter14_40.java index 641bce909a..87c286c799 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/SearchParameter14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/SearchParameter14_40.java @@ -11,6 +11,8 @@ import org.hl7.fhir.convertors.conv14_40.datatypes14_40.primitivetypes14_40.String14_40; import org.hl7.fhir.convertors.conv14_40.datatypes14_40.primitivetypes14_40.Uri14_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Enumeration; +import org.hl7.fhir.r4.model.SearchParameter; public class SearchParameter14_40 { @@ -125,58 +127,66 @@ public static org.hl7.fhir.dstu2016may.model.SearchParameter.SearchParameterCont } static public org.hl7.fhir.r4.model.Enumeration convertXPathUsageType(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.SearchParameter.XPathUsageTypeEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case NORMAL: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.NORMAL); - break; - case PHONETIC: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.PHONETIC); - break; - case NEARBY: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.NEARBY); - break; - case DISTANCE: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.DISTANCE); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new SearchParameter.XPathUsageTypeEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NORMAL: + tgt.setValue(SearchParameter.XPathUsageType.NORMAL); + break; + case PHONETIC: + tgt.setValue(SearchParameter.XPathUsageType.PHONETIC); + break; + case NEARBY: + tgt.setValue(SearchParameter.XPathUsageType.NEARBY); + break; + case DISTANCE: + tgt.setValue(SearchParameter.XPathUsageType.DISTANCE); + break; + case OTHER: + tgt.setValue(SearchParameter.XPathUsageType.OTHER); + break; + default: + tgt.setValue(SearchParameter.XPathUsageType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertXPathUsageType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.SearchParameter.XPathUsageTypeEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case NORMAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.SearchParameter.XPathUsageType.NORMAL); - break; - case PHONETIC: - tgt.setValue(org.hl7.fhir.dstu2016may.model.SearchParameter.XPathUsageType.PHONETIC); - break; - case NEARBY: - tgt.setValue(org.hl7.fhir.dstu2016may.model.SearchParameter.XPathUsageType.NEARBY); - break; - case DISTANCE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.SearchParameter.XPathUsageType.DISTANCE); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.SearchParameter.XPathUsageType.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.SearchParameter.XPathUsageType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.SearchParameter.XPathUsageTypeEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NORMAL: + tgt.setValue(org.hl7.fhir.dstu2016may.model.SearchParameter.XPathUsageType.NORMAL); + break; + case PHONETIC: + tgt.setValue(org.hl7.fhir.dstu2016may.model.SearchParameter.XPathUsageType.PHONETIC); + break; + case NEARBY: + tgt.setValue(org.hl7.fhir.dstu2016may.model.SearchParameter.XPathUsageType.NEARBY); + break; + case DISTANCE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.SearchParameter.XPathUsageType.DISTANCE); + break; + case OTHER: + tgt.setValue(org.hl7.fhir.dstu2016may.model.SearchParameter.XPathUsageType.OTHER); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.SearchParameter.XPathUsageType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/StructureDefinition14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/StructureDefinition14_40.java index 8053b3b9fb..f83898852a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/StructureDefinition14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/StructureDefinition14_40.java @@ -14,58 +14,68 @@ import org.hl7.fhir.convertors.conv14_40.datatypes14_40.primitivetypes14_40.Uri14_40; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4.model.ElementDefinition; +import org.hl7.fhir.r4.model.Enumeration; +import org.hl7.fhir.r4.model.StructureDefinition; import org.hl7.fhir.r4.model.StructureDefinition.TypeDerivationRule; import org.hl7.fhir.utilities.Utilities; public class StructureDefinition14_40 { static public org.hl7.fhir.r4.model.Enumeration convertExtensionContext(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextTypeEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case RESOURCE: - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextType.ELEMENT); - break; - case DATATYPE: - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextType.ELEMENT); - break; - case EXTENSION: - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextType.EXTENSION); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureDefinition.ExtensionContextTypeEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case RESOURCE: + tgt.setValue(StructureDefinition.ExtensionContextType.ELEMENT); + break; + case DATATYPE: + tgt.setValue(StructureDefinition.ExtensionContextType.ELEMENT); + break; + case EXTENSION: + tgt.setValue(StructureDefinition.ExtensionContextType.EXTENSION); + break; + default: + tgt.setValue(StructureDefinition.ExtensionContextType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertExtensionContext(org.hl7.fhir.r4.model.Enumeration src, String expression) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContextEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case FHIRPATH: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContext.RESOURCE); - break; - case ELEMENT: - String tn = expression.contains(".") ? expression.substring(0, expression.indexOf(".")) : expression; - if (isResource140(tn)) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContext.RESOURCE); - } else { - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContext.DATATYPE); - } - break; - case EXTENSION: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContext.EXTENSION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContext.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContextEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FHIRPATH: + tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContext.RESOURCE); + break; + case ELEMENT: + String tn = expression.contains(".") ? expression.substring(0, expression.indexOf(".")) : expression; + if (isResource140(tn)) { + tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContext.RESOURCE); + } else { + tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContext.DATATYPE); + } + break; + case EXTENSION: + tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContext.EXTENSION); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContext.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2016may.model.StructureDefinition convertStructureDefinition(org.hl7.fhir.r4.model.StructureDefinition src) throws FHIRException { @@ -254,54 +264,62 @@ public static org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionDiffe } static public org.hl7.fhir.dstu2016may.model.Enumeration convertStructureDefinitionKind(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKindEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case PRIMITIVETYPE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKind.DATATYPE); - break; - case COMPLEXTYPE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKind.DATATYPE); - break; - case RESOURCE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKind.RESOURCE); - break; - case LOGICAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKind.LOGICAL); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKindEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRIMITIVETYPE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKind.DATATYPE); + break; + case COMPLEXTYPE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKind.DATATYPE); + break; + case RESOURCE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKind.RESOURCE); + break; + case LOGICAL: + tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKind.LOGICAL); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertStructureDefinitionKind(org.hl7.fhir.dstu2016may.model.Enumeration src, String name) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKindEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case DATATYPE: - if (name.substring(0, 1).toLowerCase().equals(name.substring(0, 1))) { - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind.PRIMITIVETYPE); - } else { - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind.COMPLEXTYPE); - } - break; - case RESOURCE: - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind.RESOURCE); - break; - case LOGICAL: - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind.LOGICAL); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureDefinition.StructureDefinitionKindEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DATATYPE: + if (name.substring(0, 1).toLowerCase().equals(name.substring(0, 1))) { + tgt.setValue(StructureDefinition.StructureDefinitionKind.PRIMITIVETYPE); + } else { + tgt.setValue(StructureDefinition.StructureDefinitionKind.COMPLEXTYPE); + } + break; + case RESOURCE: + tgt.setValue(StructureDefinition.StructureDefinitionKind.RESOURCE); + break; + case LOGICAL: + tgt.setValue(StructureDefinition.StructureDefinitionKind.LOGICAL); + break; + default: + tgt.setValue(StructureDefinition.StructureDefinitionKind.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionMappingComponent convertStructureDefinitionMappingComponent(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionMappingComponent src) throws FHIRException { @@ -357,41 +375,49 @@ public static org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefini } static public org.hl7.fhir.dstu2016may.model.Enumeration convertTypeDerivationRule(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.StructureDefinition.TypeDerivationRuleEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case SPECIALIZATION: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.TypeDerivationRule.SPECIALIZATION); - break; - case CONSTRAINT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.TypeDerivationRule.CONSTRAINT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.TypeDerivationRule.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.StructureDefinition.TypeDerivationRuleEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SPECIALIZATION: + tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.TypeDerivationRule.SPECIALIZATION); + break; + case CONSTRAINT: + tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.TypeDerivationRule.CONSTRAINT); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.TypeDerivationRule.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertTypeDerivationRule(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureDefinition.TypeDerivationRuleEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case SPECIALIZATION: - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.TypeDerivationRule.SPECIALIZATION); - break; - case CONSTRAINT: - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.TypeDerivationRule.CONSTRAINT); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.TypeDerivationRule.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureDefinition.TypeDerivationRuleEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SPECIALIZATION: + tgt.setValue(TypeDerivationRule.SPECIALIZATION); + break; + case CONSTRAINT: + tgt.setValue(TypeDerivationRule.CONSTRAINT); + break; + default: + tgt.setValue(TypeDerivationRule.NULL); + break; + } + } + return tgt; } static public boolean isResource140(String tn) { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/StructureMap14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/StructureMap14_40.java index ff39486ee0..b288321d4f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/StructureMap14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/StructureMap14_40.java @@ -16,6 +16,7 @@ import org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapContextType; import org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapListMode; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Enumeration; public class StructureMap14_40 { @@ -128,38 +129,46 @@ public static org.hl7.fhir.r4.model.ContactDetail convertStructureMapContactComp } public static org.hl7.fhir.r4.model.Enumeration convertStructureMapContextType(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureMap.StructureMapContextTypeEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case TYPE: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapContextType.TYPE); - case VARIABLE: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapContextType.VARIABLE); - default: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapContextType.NULL); - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new org.hl7.fhir.r4.model.StructureMap.StructureMapContextTypeEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case TYPE: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapContextType.TYPE); + case VARIABLE: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapContextType.VARIABLE); + default: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapContextType.NULL); + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertStructureMapContextType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapContextTypeEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case TYPE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapContextType.TYPE); - break; - case VARIABLE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapContextType.VARIABLE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapContextType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new StructureMap.StructureMapContextTypeEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case TYPE: + tgt.setValue(StructureMapContextType.TYPE); + break; + case VARIABLE: + tgt.setValue(StructureMapContextType.VARIABLE); + break; + default: + tgt.setValue(StructureMapContextType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapGroupComponent convertStructureMapGroupComponent(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupComponent src) throws FHIRException { @@ -407,79 +416,95 @@ public static org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetPara } static public org.hl7.fhir.dstu2016may.model.Enumeration convertStructureMapInputMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapInputModeEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case SOURCE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapInputMode.SOURCE); - break; - case TARGET: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapInputMode.TARGET); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapInputMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new StructureMap.StructureMapInputModeEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SOURCE: + tgt.setValue(StructureMap.StructureMapInputMode.SOURCE); + break; + case TARGET: + tgt.setValue(StructureMap.StructureMapInputMode.TARGET); + break; + default: + tgt.setValue(StructureMap.StructureMapInputMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertStructureMapInputMode(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureMap.StructureMapInputModeEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case SOURCE: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapInputMode.SOURCE); - break; - case TARGET: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapInputMode.TARGET); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapInputMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new org.hl7.fhir.r4.model.StructureMap.StructureMapInputModeEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SOURCE: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapInputMode.SOURCE); + break; + case TARGET: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapInputMode.TARGET); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapInputMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r4.model.Enumeration convertStructureMapSourceListMode(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListModeEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case FIRST: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.FIRST); - break; - case LAST: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.LAST); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListModeEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FIRST: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.FIRST); + break; + case LAST: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.LAST); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertStructureMapSourceListMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapListModeEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case FIRST: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapListMode.FIRST); - break; - case LAST: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapListMode.LAST); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapListMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new StructureMap.StructureMapListModeEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FIRST: + tgt.setValue(StructureMapListMode.FIRST); + break; + case LAST: + tgt.setValue(StructureMapListMode.LAST); + break; + default: + tgt.setValue(StructureMapListMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapStructureComponent convertStructureMapStructureComponent(org.hl7.fhir.r4.model.StructureMap.StructureMapStructureComponent src) throws FHIRException { @@ -511,53 +536,61 @@ public static org.hl7.fhir.r4.model.StructureMap.StructureMapStructureComponent } static public org.hl7.fhir.dstu2016may.model.Enumeration convertStructureMapStructureMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapModelModeEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case PRODUCED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapModelMode.PRODUCED); - break; - case QUERIED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapModelMode.QUERIED); - break; - case SOURCE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapModelMode.SOURCE); - break; - case TARGET: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapModelMode.TARGET); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapModelMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new StructureMap.StructureMapModelModeEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRODUCED: + tgt.setValue(StructureMap.StructureMapModelMode.PRODUCED); + break; + case QUERIED: + tgt.setValue(StructureMap.StructureMapModelMode.QUERIED); + break; + case SOURCE: + tgt.setValue(StructureMap.StructureMapModelMode.SOURCE); + break; + case TARGET: + tgt.setValue(StructureMap.StructureMapModelMode.TARGET); + break; + default: + tgt.setValue(StructureMap.StructureMapModelMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertStructureMapStructureMode(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureMap.StructureMapModelModeEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case PRODUCED: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode.PRODUCED); - break; - case QUERIED: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode.QUERIED); - break; - case SOURCE: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode.SOURCE); - break; - case TARGET: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode.TARGET); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new org.hl7.fhir.r4.model.StructureMap.StructureMapModelModeEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRODUCED: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode.PRODUCED); + break; + case QUERIED: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode.QUERIED); + break; + case SOURCE: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode.SOURCE); + break; + case TARGET: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode.TARGET); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListMode convertStructureMapTargetListMode(StructureMapListMode src) throws FHIRException { @@ -576,122 +609,134 @@ public static org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListMode conv } static public org.hl7.fhir.dstu2016may.model.Enumeration convertStructureMapTargetListMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapListModeEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case FIRST: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapListMode.FIRST); - break; - case LAST: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapListMode.LAST); - break; - case SHARE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapListMode.SHARE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapListMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new StructureMap.StructureMapListModeEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FIRST: + tgt.setValue(StructureMapListMode.FIRST); + break; + case LAST: + tgt.setValue(StructureMapListMode.LAST); + break; + case SHARE: + tgt.setValue(StructureMapListMode.SHARE); + break; + default: + tgt.setValue(StructureMapListMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertStructureMapTransform(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapTransformEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case APPEND: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapTransform.APPEND); - break; - case CAST: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapTransform.CAST); - break; - case COPY: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapTransform.COPY); - break; - case CREATE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapTransform.CREATE); - break; - case DATEOP: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapTransform.DATEOP); - break; - case ESCAPE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapTransform.ESCAPE); - break; - case EVALUATE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapTransform.EVALUATE); - break; - case POINTER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapTransform.POINTER); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapTransform.REFERENCE); - break; - case TRANSLATE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapTransform.TRANSLATE); - break; - case TRUNCATE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapTransform.TRUNCATE); - break; - case UUID: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapTransform.UUID); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapTransform.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new StructureMap.StructureMapTransformEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case APPEND: + tgt.setValue(StructureMap.StructureMapTransform.APPEND); + break; + case CAST: + tgt.setValue(StructureMap.StructureMapTransform.CAST); + break; + case COPY: + tgt.setValue(StructureMap.StructureMapTransform.COPY); + break; + case CREATE: + tgt.setValue(StructureMap.StructureMapTransform.CREATE); + break; + case DATEOP: + tgt.setValue(StructureMap.StructureMapTransform.DATEOP); + break; + case ESCAPE: + tgt.setValue(StructureMap.StructureMapTransform.ESCAPE); + break; + case EVALUATE: + tgt.setValue(StructureMap.StructureMapTransform.EVALUATE); + break; + case POINTER: + tgt.setValue(StructureMap.StructureMapTransform.POINTER); + break; + case REFERENCE: + tgt.setValue(StructureMap.StructureMapTransform.REFERENCE); + break; + case TRANSLATE: + tgt.setValue(StructureMap.StructureMapTransform.TRANSLATE); + break; + case TRUNCATE: + tgt.setValue(StructureMap.StructureMapTransform.TRUNCATE); + break; + case UUID: + tgt.setValue(StructureMap.StructureMapTransform.UUID); + break; + default: + tgt.setValue(StructureMap.StructureMapTransform.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r4.model.Enumeration convertStructureMapTransform(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureMap.StructureMapTransformEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case APPEND: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.APPEND); - break; - case CAST: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.CAST); - break; - case COPY: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.COPY); - break; - case CREATE: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.CREATE); - break; - case DATEOP: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.DATEOP); - break; - case ESCAPE: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.ESCAPE); - break; - case EVALUATE: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.EVALUATE); - break; - case POINTER: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.POINTER); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.REFERENCE); - break; - case TRANSLATE: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.TRANSLATE); - break; - case TRUNCATE: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.TRUNCATE); - break; - case UUID: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.UUID); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new org.hl7.fhir.r4.model.StructureMap.StructureMapTransformEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case APPEND: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.APPEND); + break; + case CAST: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.CAST); + break; + case COPY: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.COPY); + break; + case CREATE: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.CREATE); + break; + case DATEOP: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.DATEOP); + break; + case ESCAPE: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.ESCAPE); + break; + case EVALUATE: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.EVALUATE); + break; + case POINTER: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.POINTER); + break; + case REFERENCE: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.REFERENCE); + break; + case TRANSLATE: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.TRANSLATE); + break; + case TRUNCATE: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.TRUNCATE); + break; + case UUID: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.UUID); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/ValueSet14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/ValueSet14_40.java index 1c82332146..19eb0ee8e5 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/ValueSet14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/resources14_40/ValueSet14_40.java @@ -14,6 +14,8 @@ import org.hl7.fhir.convertors.conv14_40.datatypes14_40.primitivetypes14_40.Uri14_40; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4.model.BooleanType; +import org.hl7.fhir.r4.model.Enumeration; +import org.hl7.fhir.r4.model.ValueSet; public class ValueSet14_40 { @@ -134,65 +136,73 @@ public static org.hl7.fhir.dstu2016may.model.ValueSet.ConceptSetFilterComponent } static public org.hl7.fhir.r4.model.Enumeration convertFilterOperator(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ValueSet.FilterOperatorEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case EQUAL: - tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.EQUAL); - break; - case ISA: - tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.ISA); - break; - case ISNOTA: - tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.ISNOTA); - break; - case REGEX: - tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.REGEX); - break; - case IN: - tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.NOTIN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ValueSet.FilterOperatorEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUAL: + tgt.setValue(ValueSet.FilterOperator.EQUAL); + break; + case ISA: + tgt.setValue(ValueSet.FilterOperator.ISA); + break; + case ISNOTA: + tgt.setValue(ValueSet.FilterOperator.ISNOTA); + break; + case REGEX: + tgt.setValue(ValueSet.FilterOperator.REGEX); + break; + case IN: + tgt.setValue(ValueSet.FilterOperator.IN); + break; + case NOTIN: + tgt.setValue(ValueSet.FilterOperator.NOTIN); + break; + default: + tgt.setValue(ValueSet.FilterOperator.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertFilterOperator(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.ValueSet.FilterOperatorEnumFactory()); - ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); - switch (src.getValue()) { - case EQUAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ValueSet.FilterOperator.EQUAL); - break; - case ISA: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ValueSet.FilterOperator.ISA); - break; - case ISNOTA: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ValueSet.FilterOperator.ISNOTA); - break; - case REGEX: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ValueSet.FilterOperator.REGEX); - break; - case IN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ValueSet.FilterOperator.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ValueSet.FilterOperator.NOTIN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ValueSet.FilterOperator.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.ValueSet.FilterOperatorEnumFactory()); + ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUAL: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ValueSet.FilterOperator.EQUAL); + break; + case ISA: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ValueSet.FilterOperator.ISA); + break; + case ISNOTA: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ValueSet.FilterOperator.ISNOTA); + break; + case REGEX: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ValueSet.FilterOperator.REGEX); + break; + case IN: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ValueSet.FilterOperator.IN); + break; + case NOTIN: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ValueSet.FilterOperator.NOTIN); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ValueSet.FilterOperator.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r4.model.ValueSet convertValueSet(org.hl7.fhir.dstu2016may.model.ValueSet src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/datatypes14_50/ElementDefinition14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/datatypes14_50/ElementDefinition14_50.java index ca04e7fd84..dd0bedfe4f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/datatypes14_50/ElementDefinition14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/datatypes14_50/ElementDefinition14_50.java @@ -150,26 +150,26 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentationEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case XMLATTR: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.XMLATTR); - break; - case XMLTEXT: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.XMLTEXT); - break; - case TYPEATTR: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.TYPEATTR); - break; - case CDATEXT: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.CDATEXT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.XMLATTR); + break; + case XMLTEXT: + tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.XMLTEXT); + break; + case TYPEATTR: + tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.TYPEATTR); + break; + case CDATEXT: + tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.CDATEXT); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.NULL); + break; + } +} return tgt; } @@ -178,26 +178,26 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new ElementDefinition.PropertyRepresentationEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(ElementDefinition.PropertyRepresentation.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case XMLATTR: - tgt.setValue(ElementDefinition.PropertyRepresentation.XMLATTR); - break; - case XMLTEXT: - tgt.setValue(ElementDefinition.PropertyRepresentation.XMLTEXT); - break; - case TYPEATTR: - tgt.setValue(ElementDefinition.PropertyRepresentation.TYPEATTR); - break; - case CDATEXT: - tgt.setValue(ElementDefinition.PropertyRepresentation.CDATEXT); - break; - default: - tgt.setValue(ElementDefinition.PropertyRepresentation.NULL); - break; - } - } + tgt.setValue(ElementDefinition.PropertyRepresentation.XMLATTR); + break; + case XMLTEXT: + tgt.setValue(ElementDefinition.PropertyRepresentation.XMLTEXT); + break; + case TYPEATTR: + tgt.setValue(ElementDefinition.PropertyRepresentation.TYPEATTR); + break; + case CDATEXT: + tgt.setValue(ElementDefinition.PropertyRepresentation.CDATEXT); + break; + default: + tgt.setValue(ElementDefinition.PropertyRepresentation.NULL); + break; + } +} return tgt; } @@ -274,23 +274,23 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ElementDefinition.SlicingRulesEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.SlicingRules.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CLOSED: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.SlicingRules.CLOSED); - break; - case OPEN: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.SlicingRules.OPEN); - break; - case OPENATEND: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.SlicingRules.OPENATEND); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.SlicingRules.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.SlicingRules.CLOSED); + break; + case OPEN: + tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.SlicingRules.OPEN); + break; + case OPENATEND: + tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.SlicingRules.OPENATEND); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.SlicingRules.NULL); + break; + } +} return tgt; } @@ -299,23 +299,23 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new ElementDefinition.SlicingRulesEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(ElementDefinition.SlicingRules.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CLOSED: - tgt.setValue(ElementDefinition.SlicingRules.CLOSED); - break; - case OPEN: - tgt.setValue(ElementDefinition.SlicingRules.OPEN); - break; - case OPENATEND: - tgt.setValue(ElementDefinition.SlicingRules.OPENATEND); - break; - default: - tgt.setValue(ElementDefinition.SlicingRules.NULL); - break; - } - } + tgt.setValue(ElementDefinition.SlicingRules.CLOSED); + break; + case OPEN: + tgt.setValue(ElementDefinition.SlicingRules.OPEN); + break; + case OPENATEND: + tgt.setValue(ElementDefinition.SlicingRules.OPENATEND); + break; + default: + tgt.setValue(ElementDefinition.SlicingRules.NULL); + break; + } +} return tgt; } @@ -408,23 +408,23 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ElementDefinition.AggregationModeEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.AggregationMode.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CONTAINED: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.AggregationMode.CONTAINED); - break; - case REFERENCED: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.AggregationMode.REFERENCED); - break; - case BUNDLED: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.AggregationMode.BUNDLED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.AggregationMode.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.AggregationMode.CONTAINED); + break; + case REFERENCED: + tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.AggregationMode.REFERENCED); + break; + case BUNDLED: + tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.AggregationMode.BUNDLED); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.AggregationMode.NULL); + break; + } +} return tgt; } @@ -433,23 +433,23 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new ElementDefinition.AggregationModeEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(ElementDefinition.AggregationMode.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CONTAINED: - tgt.setValue(ElementDefinition.AggregationMode.CONTAINED); - break; - case REFERENCED: - tgt.setValue(ElementDefinition.AggregationMode.REFERENCED); - break; - case BUNDLED: - tgt.setValue(ElementDefinition.AggregationMode.BUNDLED); - break; - default: - tgt.setValue(ElementDefinition.AggregationMode.NULL); - break; - } - } + tgt.setValue(ElementDefinition.AggregationMode.CONTAINED); + break; + case REFERENCED: + tgt.setValue(ElementDefinition.AggregationMode.REFERENCED); + break; + case BUNDLED: + tgt.setValue(ElementDefinition.AggregationMode.BUNDLED); + break; + default: + tgt.setValue(ElementDefinition.AggregationMode.NULL); + break; + } +} return tgt; } @@ -458,23 +458,23 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ElementDefinition.ReferenceVersionRulesEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ReferenceVersionRules.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case EITHER: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ReferenceVersionRules.EITHER); - break; - case INDEPENDENT: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ReferenceVersionRules.INDEPENDENT); - break; - case SPECIFIC: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ReferenceVersionRules.SPECIFIC); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ReferenceVersionRules.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ReferenceVersionRules.EITHER); + break; + case INDEPENDENT: + tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ReferenceVersionRules.INDEPENDENT); + break; + case SPECIFIC: + tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ReferenceVersionRules.SPECIFIC); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ReferenceVersionRules.NULL); + break; + } +} return tgt; } @@ -483,23 +483,23 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new ElementDefinition.ReferenceVersionRulesEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(ElementDefinition.ReferenceVersionRules.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case EITHER: - tgt.setValue(ElementDefinition.ReferenceVersionRules.EITHER); - break; - case INDEPENDENT: - tgt.setValue(ElementDefinition.ReferenceVersionRules.INDEPENDENT); - break; - case SPECIFIC: - tgt.setValue(ElementDefinition.ReferenceVersionRules.SPECIFIC); - break; - default: - tgt.setValue(ElementDefinition.ReferenceVersionRules.NULL); - break; - } - } + tgt.setValue(ElementDefinition.ReferenceVersionRules.EITHER); + break; + case INDEPENDENT: + tgt.setValue(ElementDefinition.ReferenceVersionRules.INDEPENDENT); + break; + case SPECIFIC: + tgt.setValue(ElementDefinition.ReferenceVersionRules.SPECIFIC); + break; + default: + tgt.setValue(ElementDefinition.ReferenceVersionRules.NULL); + break; + } +} return tgt; } @@ -538,20 +538,20 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ElementDefinition.ConstraintSeverityEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ConstraintSeverity.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case ERROR: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ConstraintSeverity.ERROR); - break; - case WARNING: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ConstraintSeverity.WARNING); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ConstraintSeverity.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ConstraintSeverity.ERROR); + break; + case WARNING: + tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ConstraintSeverity.WARNING); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ConstraintSeverity.NULL); + break; + } +} return tgt; } @@ -560,20 +560,20 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new ElementDefinition.ConstraintSeverityEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(ElementDefinition.ConstraintSeverity.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case ERROR: - tgt.setValue(ElementDefinition.ConstraintSeverity.ERROR); - break; - case WARNING: - tgt.setValue(ElementDefinition.ConstraintSeverity.WARNING); - break; - default: - tgt.setValue(ElementDefinition.ConstraintSeverity.NULL); - break; - } - } + tgt.setValue(ElementDefinition.ConstraintSeverity.ERROR); + break; + case WARNING: + tgt.setValue(ElementDefinition.ConstraintSeverity.WARNING); + break; + default: + tgt.setValue(ElementDefinition.ConstraintSeverity.NULL); + break; + } +} return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/datatypes14_50/Narrative14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/datatypes14_50/Narrative14_50.java index ba41863453..cd4ff43297 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/datatypes14_50/Narrative14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/datatypes14_50/Narrative14_50.java @@ -2,6 +2,7 @@ import org.hl7.fhir.convertors.context.ConversionContext14_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Narrative; public class Narrative14_50 { public static org.hl7.fhir.r5.model.Narrative convertNarrative(org.hl7.fhir.dstu2016may.model.Narrative src) throws FHIRException { @@ -27,26 +28,26 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Narrative.NarrativeStatusEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Narrative.NarrativeStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case GENERATED: - tgt.setValue(org.hl7.fhir.r5.model.Narrative.NarrativeStatus.GENERATED); - break; - case EXTENSIONS: - tgt.setValue(org.hl7.fhir.r5.model.Narrative.NarrativeStatus.EXTENSIONS); - break; - case ADDITIONAL: - tgt.setValue(org.hl7.fhir.r5.model.Narrative.NarrativeStatus.ADDITIONAL); - break; - case EMPTY: - tgt.setValue(org.hl7.fhir.r5.model.Narrative.NarrativeStatus.EMPTY); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Narrative.NarrativeStatus.NULL); - break; - } - } + tgt.setValue(Narrative.NarrativeStatus.GENERATED); + break; + case EXTENSIONS: + tgt.setValue(Narrative.NarrativeStatus.EXTENSIONS); + break; + case ADDITIONAL: + tgt.setValue(Narrative.NarrativeStatus.ADDITIONAL); + break; + case EMPTY: + tgt.setValue(Narrative.NarrativeStatus.EMPTY); + break; + default: + tgt.setValue(Narrative.NarrativeStatus.NULL); + break; + } +} return tgt; } @@ -55,26 +56,26 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Narrative.NarrativeStatusEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.Narrative.NarrativeStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case GENERATED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Narrative.NarrativeStatus.GENERATED); - break; - case EXTENSIONS: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Narrative.NarrativeStatus.EXTENSIONS); - break; - case ADDITIONAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Narrative.NarrativeStatus.ADDITIONAL); - break; - case EMPTY: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Narrative.NarrativeStatus.EMPTY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Narrative.NarrativeStatus.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.Narrative.NarrativeStatus.GENERATED); + break; + case EXTENSIONS: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Narrative.NarrativeStatus.EXTENSIONS); + break; + case ADDITIONAL: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Narrative.NarrativeStatus.ADDITIONAL); + break; + case EMPTY: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Narrative.NarrativeStatus.EMPTY); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Narrative.NarrativeStatus.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/datatypes14_50/complextypes14_50/Address14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/datatypes14_50/complextypes14_50/Address14_50.java index 6aac176b71..8b15c1c37d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/datatypes14_50/complextypes14_50/Address14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/datatypes14_50/complextypes14_50/Address14_50.java @@ -3,6 +3,7 @@ import org.hl7.fhir.convertors.context.ConversionContext14_50; import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.String14_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Address; public class Address14_50 { public static org.hl7.fhir.r5.model.Address convertAddress(org.hl7.fhir.dstu2016may.model.Address src) throws FHIRException { @@ -44,26 +45,26 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Address.AddressUseEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HOME: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressUse.HOME); - break; - case WORK: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressUse.WORK); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressUse.OLD); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressUse.NULL); - break; - } - } + tgt.setValue(Address.AddressUse.HOME); + break; + case WORK: + tgt.setValue(Address.AddressUse.WORK); + break; + case TEMP: + tgt.setValue(Address.AddressUse.TEMP); + break; + case OLD: + tgt.setValue(Address.AddressUse.OLD); + break; + default: + tgt.setValue(Address.AddressUse.NULL); + break; + } +} return tgt; } @@ -72,26 +73,26 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Address.AddressUseEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HOME: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressUse.HOME); - break; - case WORK: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressUse.WORK); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressUse.OLD); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressUse.HOME); + break; + case WORK: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressUse.WORK); + break; + case TEMP: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressUse.TEMP); + break; + case OLD: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressUse.OLD); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressUse.NULL); + break; + } +} return tgt; } @@ -100,23 +101,23 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Address.AddressTypeEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case POSTAL: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressType.POSTAL); - break; - case PHYSICAL: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressType.PHYSICAL); - break; - case BOTH: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressType.BOTH); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressType.NULL); - break; - } - } + tgt.setValue(Address.AddressType.POSTAL); + break; + case PHYSICAL: + tgt.setValue(Address.AddressType.PHYSICAL); + break; + case BOTH: + tgt.setValue(Address.AddressType.BOTH); + break; + default: + tgt.setValue(Address.AddressType.NULL); + break; + } +} return tgt; } @@ -125,23 +126,23 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Address.AddressTypeEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case POSTAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressType.POSTAL); - break; - case PHYSICAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressType.PHYSICAL); - break; - case BOTH: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressType.BOTH); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressType.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressType.POSTAL); + break; + case PHYSICAL: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressType.PHYSICAL); + break; + case BOTH: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressType.BOTH); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Address.AddressType.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/datatypes14_50/complextypes14_50/ContactPoint14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/datatypes14_50/complextypes14_50/ContactPoint14_50.java index 96e3f7b044..f84a315f3f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/datatypes14_50/complextypes14_50/ContactPoint14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/datatypes14_50/complextypes14_50/ContactPoint14_50.java @@ -4,6 +4,7 @@ import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.PositiveInt14_50; import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.String14_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.ContactPoint; public class ContactPoint14_50 { public static org.hl7.fhir.r5.model.ContactPoint convertContactPoint(org.hl7.fhir.dstu2016may.model.ContactPoint src) throws FHIRException { @@ -35,29 +36,29 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ContactPoint.ContactPointSystemEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case PHONE: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.PHONE); - break; - case FAX: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.FAX); - break; - case EMAIL: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.EMAIL); - break; - case PAGER: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.PAGER); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.URL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.NULL); - break; - } - } + tgt.setValue(ContactPoint.ContactPointSystem.PHONE); + break; + case FAX: + tgt.setValue(ContactPoint.ContactPointSystem.FAX); + break; + case EMAIL: + tgt.setValue(ContactPoint.ContactPointSystem.EMAIL); + break; + case PAGER: + tgt.setValue(ContactPoint.ContactPointSystem.PAGER); + break; + case OTHER: + tgt.setValue(ContactPoint.ContactPointSystem.URL); + break; + default: + tgt.setValue(ContactPoint.ContactPointSystem.NULL); + break; + } +} return tgt; } @@ -66,29 +67,29 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystemEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case PHONE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem.PHONE); - break; - case FAX: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem.FAX); - break; - case EMAIL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem.EMAIL); - break; - case PAGER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem.PAGER); - break; - case URL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem.PHONE); + break; + case FAX: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem.FAX); + break; + case EMAIL: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem.EMAIL); + break; + case PAGER: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem.PAGER); + break; + case URL: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem.OTHER); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem.NULL); + break; + } +} return tgt; } @@ -97,29 +98,29 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ContactPoint.ContactPointUseEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HOME: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.HOME); - break; - case WORK: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.WORK); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.OLD); - break; - case MOBILE: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.MOBILE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.NULL); - break; - } - } + tgt.setValue(ContactPoint.ContactPointUse.HOME); + break; + case WORK: + tgt.setValue(ContactPoint.ContactPointUse.WORK); + break; + case TEMP: + tgt.setValue(ContactPoint.ContactPointUse.TEMP); + break; + case OLD: + tgt.setValue(ContactPoint.ContactPointUse.OLD); + break; + case MOBILE: + tgt.setValue(ContactPoint.ContactPointUse.MOBILE); + break; + default: + tgt.setValue(ContactPoint.ContactPointUse.NULL); + break; + } +} return tgt; } @@ -128,29 +129,29 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUseEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HOME: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUse.HOME); - break; - case WORK: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUse.WORK); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUse.OLD); - break; - case MOBILE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUse.MOBILE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUse.HOME); + break; + case WORK: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUse.WORK); + break; + case TEMP: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUse.TEMP); + break; + case OLD: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUse.OLD); + break; + case MOBILE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUse.MOBILE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointUse.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/datatypes14_50/complextypes14_50/HumanName14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/datatypes14_50/complextypes14_50/HumanName14_50.java index 1bb1226be4..217adcdd0a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/datatypes14_50/complextypes14_50/HumanName14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/datatypes14_50/complextypes14_50/HumanName14_50.java @@ -3,6 +3,7 @@ import org.hl7.fhir.convertors.context.ConversionContext14_50; import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.String14_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.HumanName; public class HumanName14_50 { public static org.hl7.fhir.r5.model.HumanName convertHumanName(org.hl7.fhir.dstu2016may.model.HumanName src) throws FHIRException { @@ -38,35 +39,35 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.HumanName.NameUseEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case USUAL: - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.USUAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.OFFICIAL); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.TEMP); - break; - case NICKNAME: - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.NICKNAME); - break; - case ANONYMOUS: - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.ANONYMOUS); - break; - case OLD: - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.OLD); - break; - case MAIDEN: - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.MAIDEN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.NULL); - break; - } - } + tgt.setValue(HumanName.NameUse.USUAL); + break; + case OFFICIAL: + tgt.setValue(HumanName.NameUse.OFFICIAL); + break; + case TEMP: + tgt.setValue(HumanName.NameUse.TEMP); + break; + case NICKNAME: + tgt.setValue(HumanName.NameUse.NICKNAME); + break; + case ANONYMOUS: + tgt.setValue(HumanName.NameUse.ANONYMOUS); + break; + case OLD: + tgt.setValue(HumanName.NameUse.OLD); + break; + case MAIDEN: + tgt.setValue(HumanName.NameUse.MAIDEN); + break; + default: + tgt.setValue(HumanName.NameUse.NULL); + break; + } +} return tgt; } @@ -75,35 +76,35 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.HumanName.NameUseEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case USUAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.USUAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.OFFICIAL); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.TEMP); - break; - case NICKNAME: - tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.NICKNAME); - break; - case ANONYMOUS: - tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.ANONYMOUS); - break; - case OLD: - tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.OLD); - break; - case MAIDEN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.MAIDEN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.USUAL); + break; + case OFFICIAL: + tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.OFFICIAL); + break; + case TEMP: + tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.TEMP); + break; + case NICKNAME: + tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.NICKNAME); + break; + case ANONYMOUS: + tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.ANONYMOUS); + break; + case OLD: + tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.OLD); + break; + case MAIDEN: + tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.MAIDEN); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.HumanName.NameUse.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/datatypes14_50/complextypes14_50/Identifier14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/datatypes14_50/complextypes14_50/Identifier14_50.java index 78476f03f1..5e5c439830 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/datatypes14_50/complextypes14_50/Identifier14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/datatypes14_50/complextypes14_50/Identifier14_50.java @@ -5,6 +5,7 @@ import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.String14_50; import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.Uri14_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Identifier; public class Identifier14_50 { public static org.hl7.fhir.r5.model.Identifier convertIdentifier(org.hl7.fhir.dstu2016may.model.Identifier src) throws FHIRException { @@ -38,26 +39,26 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Identifier.IdentifierUseEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Identifier.IdentifierUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case USUAL: - tgt.setValue(org.hl7.fhir.r5.model.Identifier.IdentifierUse.USUAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.r5.model.Identifier.IdentifierUse.OFFICIAL); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.r5.model.Identifier.IdentifierUse.TEMP); - break; - case SECONDARY: - tgt.setValue(org.hl7.fhir.r5.model.Identifier.IdentifierUse.SECONDARY); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Identifier.IdentifierUse.NULL); - break; - } - } + tgt.setValue(Identifier.IdentifierUse.USUAL); + break; + case OFFICIAL: + tgt.setValue(Identifier.IdentifierUse.OFFICIAL); + break; + case TEMP: + tgt.setValue(Identifier.IdentifierUse.TEMP); + break; + case SECONDARY: + tgt.setValue(Identifier.IdentifierUse.SECONDARY); + break; + default: + tgt.setValue(Identifier.IdentifierUse.NULL); + break; + } +} return tgt; } @@ -66,26 +67,26 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Identifier.IdentifierUseEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.Identifier.IdentifierUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case USUAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Identifier.IdentifierUse.USUAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Identifier.IdentifierUse.OFFICIAL); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Identifier.IdentifierUse.TEMP); - break; - case SECONDARY: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Identifier.IdentifierUse.SECONDARY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Identifier.IdentifierUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.Identifier.IdentifierUse.USUAL); + break; + case OFFICIAL: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Identifier.IdentifierUse.OFFICIAL); + break; + case TEMP: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Identifier.IdentifierUse.TEMP); + break; + case SECONDARY: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Identifier.IdentifierUse.SECONDARY); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Identifier.IdentifierUse.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/datatypes14_50/complextypes14_50/Quantity14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/datatypes14_50/complextypes14_50/Quantity14_50.java index 2883df9e43..2589f42077 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/datatypes14_50/complextypes14_50/Quantity14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/datatypes14_50/complextypes14_50/Quantity14_50.java @@ -5,7 +5,9 @@ import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.Decimal14_50; import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.String14_50; import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.Uri14_50; +import org.hl7.fhir.dstu2016may.model.Quantity; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumerations; public class Quantity14_50 { public static org.hl7.fhir.r5.model.Quantity convertQuantity(org.hl7.fhir.dstu2016may.model.Quantity src) throws FHIRException { @@ -37,26 +39,26 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.QuantityComparatorEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.QuantityComparator.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case LESS_THAN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.QuantityComparator.LESS_THAN); - break; - case LESS_OR_EQUAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.QuantityComparator.LESS_OR_EQUAL); - break; - case GREATER_OR_EQUAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.QuantityComparator.GREATER_OR_EQUAL); - break; - case GREATER_THAN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.QuantityComparator.GREATER_THAN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.QuantityComparator.NULL); - break; - } - } + tgt.setValue(Enumerations.QuantityComparator.LESS_THAN); + break; + case LESS_OR_EQUAL: + tgt.setValue(Enumerations.QuantityComparator.LESS_OR_EQUAL); + break; + case GREATER_OR_EQUAL: + tgt.setValue(Enumerations.QuantityComparator.GREATER_OR_EQUAL); + break; + case GREATER_THAN: + tgt.setValue(Enumerations.QuantityComparator.GREATER_THAN); + break; + default: + tgt.setValue(Enumerations.QuantityComparator.NULL); + break; + } +} return tgt; } @@ -65,26 +67,26 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Quantity.QuantityComparatorEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.Quantity.QuantityComparator.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case LESS_THAN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Quantity.QuantityComparator.LESS_THAN); - break; - case LESS_OR_EQUAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Quantity.QuantityComparator.LESS_OR_EQUAL); - break; - case GREATER_OR_EQUAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Quantity.QuantityComparator.GREATER_OR_EQUAL); - break; - case GREATER_THAN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Quantity.QuantityComparator.GREATER_THAN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Quantity.QuantityComparator.NULL); - break; - } - } + tgt.setValue(Quantity.QuantityComparator.LESS_THAN); + break; + case LESS_OR_EQUAL: + tgt.setValue(Quantity.QuantityComparator.LESS_OR_EQUAL); + break; + case GREATER_OR_EQUAL: + tgt.setValue(Quantity.QuantityComparator.GREATER_OR_EQUAL); + break; + case GREATER_THAN: + tgt.setValue(Quantity.QuantityComparator.GREATER_THAN); + break; + default: + tgt.setValue(Quantity.QuantityComparator.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/datatypes14_50/complextypes14_50/Timing14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/datatypes14_50/complextypes14_50/Timing14_50.java index 27d2e80b47..53b98a8e1a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/datatypes14_50/complextypes14_50/Timing14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/datatypes14_50/complextypes14_50/Timing14_50.java @@ -6,6 +6,7 @@ import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.Decimal14_50; import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.UnsignedInt14_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Timing; public class Timing14_50 { public static org.hl7.fhir.r5.model.Timing convertTiming(org.hl7.fhir.dstu2016may.model.Timing src) throws FHIRException { @@ -75,35 +76,35 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Timing.UnitsOfTimeEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case S: - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.S); - break; - case MIN: - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.MIN); - break; - case H: - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.H); - break; - case D: - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.D); - break; - case WK: - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.WK); - break; - case MO: - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.MO); - break; - case A: - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.A); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.NULL); - break; - } - } + tgt.setValue(Timing.UnitsOfTime.S); + break; + case MIN: + tgt.setValue(Timing.UnitsOfTime.MIN); + break; + case H: + tgt.setValue(Timing.UnitsOfTime.H); + break; + case D: + tgt.setValue(Timing.UnitsOfTime.D); + break; + case WK: + tgt.setValue(Timing.UnitsOfTime.WK); + break; + case MO: + tgt.setValue(Timing.UnitsOfTime.MO); + break; + case A: + tgt.setValue(Timing.UnitsOfTime.A); + break; + default: + tgt.setValue(Timing.UnitsOfTime.NULL); + break; + } +} return tgt; } @@ -112,35 +113,35 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTimeEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case S: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.S); - break; - case MIN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.MIN); - break; - case H: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.H); - break; - case D: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.D); - break; - case WK: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.WK); - break; - case MO: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.MO); - break; - case A: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.A); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.S); + break; + case MIN: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.MIN); + break; + case H: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.H); + break; + case D: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.D); + break; + case WK: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.WK); + break; + case MO: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.MO); + break; + case A: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.A); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.UnitsOfTime.NULL); + break; + } +} return tgt; } @@ -149,56 +150,56 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Timing.EventTimingEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HS: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.HS); - break; - case WAKE: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.WAKE); - break; - case C: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.C); - break; - case CM: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.CM); - break; - case CD: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.CD); - break; - case CV: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.CV); - break; - case AC: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.AC); - break; - case ACM: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.ACM); - break; - case ACD: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.ACD); - break; - case ACV: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.ACV); - break; - case PC: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.PC); - break; - case PCM: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.PCM); - break; - case PCD: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.PCD); - break; - case PCV: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.PCV); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.NULL); - break; - } - } + tgt.setValue(Timing.EventTiming.HS); + break; + case WAKE: + tgt.setValue(Timing.EventTiming.WAKE); + break; + case C: + tgt.setValue(Timing.EventTiming.C); + break; + case CM: + tgt.setValue(Timing.EventTiming.CM); + break; + case CD: + tgt.setValue(Timing.EventTiming.CD); + break; + case CV: + tgt.setValue(Timing.EventTiming.CV); + break; + case AC: + tgt.setValue(Timing.EventTiming.AC); + break; + case ACM: + tgt.setValue(Timing.EventTiming.ACM); + break; + case ACD: + tgt.setValue(Timing.EventTiming.ACD); + break; + case ACV: + tgt.setValue(Timing.EventTiming.ACV); + break; + case PC: + tgt.setValue(Timing.EventTiming.PC); + break; + case PCM: + tgt.setValue(Timing.EventTiming.PCM); + break; + case PCD: + tgt.setValue(Timing.EventTiming.PCD); + break; + case PCV: + tgt.setValue(Timing.EventTiming.PCV); + break; + default: + tgt.setValue(Timing.EventTiming.NULL); + break; + } +} return tgt; } @@ -207,56 +208,56 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Timing.EventTimingEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HS: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.HS); - break; - case WAKE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.WAKE); - break; - case C: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.C); - break; - case CM: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.CM); - break; - case CD: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.CD); - break; - case CV: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.CV); - break; - case AC: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.AC); - break; - case ACM: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.ACM); - break; - case ACD: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.ACD); - break; - case ACV: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.ACV); - break; - case PC: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.PC); - break; - case PCM: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.PCM); - break; - case PCD: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.PCD); - break; - case PCV: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.PCV); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.HS); + break; + case WAKE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.WAKE); + break; + case C: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.C); + break; + case CM: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.CM); + break; + case CD: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.CD); + break; + case CV: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.CV); + break; + case AC: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.AC); + break; + case ACM: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.ACM); + break; + case ACD: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.ACD); + break; + case ACV: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.ACV); + break; + case PC: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.PC); + break; + case PCM: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.PCM); + break; + case PCD: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.PCD); + break; + case PCV: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.PCV); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Timing.EventTiming.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/Bundle14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/Bundle14_50.java index 269e7f65e9..61dfde6cb0 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/Bundle14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/Bundle14_50.java @@ -7,6 +7,8 @@ import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.String14_50; import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.UnsignedInt14_50; import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.Uri14_50; +import org.hl7.fhir.dstu2016may.model.Bundle; +import org.hl7.fhir.dstu2016may.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.Bundle.LinkRelationTypes; @@ -207,176 +209,200 @@ public static org.hl7.fhir.r5.model.Bundle.BundleLinkComponent convertBundleLink } static public org.hl7.fhir.dstu2016may.model.Enumeration convertBundleType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Bundle.BundleTypeEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case DOCUMENT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.DOCUMENT); - break; - case MESSAGE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.MESSAGE); - break; - case TRANSACTION: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.TRANSACTION); - break; - case TRANSACTIONRESPONSE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.TRANSACTIONRESPONSE); - break; - case BATCH: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.BATCH); - break; - case BATCHRESPONSE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.BATCHRESPONSE); - break; - case HISTORY: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.HISTORY); - break; - case SEARCHSET: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.SEARCHSET); - break; - case COLLECTION: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.COLLECTION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.BundleType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Bundle.BundleTypeEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DOCUMENT: + tgt.setValue(Bundle.BundleType.DOCUMENT); + break; + case MESSAGE: + tgt.setValue(Bundle.BundleType.MESSAGE); + break; + case TRANSACTION: + tgt.setValue(Bundle.BundleType.TRANSACTION); + break; + case TRANSACTIONRESPONSE: + tgt.setValue(Bundle.BundleType.TRANSACTIONRESPONSE); + break; + case BATCH: + tgt.setValue(Bundle.BundleType.BATCH); + break; + case BATCHRESPONSE: + tgt.setValue(Bundle.BundleType.BATCHRESPONSE); + break; + case HISTORY: + tgt.setValue(Bundle.BundleType.HISTORY); + break; + case SEARCHSET: + tgt.setValue(Bundle.BundleType.SEARCHSET); + break; + case COLLECTION: + tgt.setValue(Bundle.BundleType.COLLECTION); + break; + default: + tgt.setValue(Bundle.BundleType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertBundleType(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Bundle.BundleTypeEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case DOCUMENT: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.DOCUMENT); - break; - case MESSAGE: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.MESSAGE); - break; - case TRANSACTION: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.TRANSACTION); - break; - case TRANSACTIONRESPONSE: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.TRANSACTIONRESPONSE); - break; - case BATCH: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.BATCH); - break; - case BATCHRESPONSE: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.BATCHRESPONSE); - break; - case HISTORY: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.HISTORY); - break; - case SEARCHSET: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.SEARCHSET); - break; - case COLLECTION: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.COLLECTION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Bundle.BundleTypeEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DOCUMENT: + tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.DOCUMENT); + break; + case MESSAGE: + tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.MESSAGE); + break; + case TRANSACTION: + tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.TRANSACTION); + break; + case TRANSACTIONRESPONSE: + tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.TRANSACTIONRESPONSE); + break; + case BATCH: + tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.BATCH); + break; + case BATCHRESPONSE: + tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.BATCHRESPONSE); + break; + case HISTORY: + tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.HISTORY); + break; + case SEARCHSET: + tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.SEARCHSET); + break; + case COLLECTION: + tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.COLLECTION); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertHTTPVerb(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Bundle.HTTPVerbEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case GET: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.HTTPVerb.GET); - break; - case POST: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.HTTPVerb.POST); - break; - case PUT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.HTTPVerb.PUT); - break; - case DELETE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.HTTPVerb.DELETE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.HTTPVerb.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Bundle.HTTPVerbEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case GET: + tgt.setValue(Bundle.HTTPVerb.GET); + break; + case POST: + tgt.setValue(Bundle.HTTPVerb.POST); + break; + case PUT: + tgt.setValue(Bundle.HTTPVerb.PUT); + break; + case DELETE: + tgt.setValue(Bundle.HTTPVerb.DELETE); + break; + default: + tgt.setValue(Bundle.HTTPVerb.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertHTTPVerb(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Bundle.HTTPVerbEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case GET: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.GET); - break; - case POST: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.POST); - break; - case PUT: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.PUT); - break; - case DELETE: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.DELETE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Bundle.HTTPVerbEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case GET: + tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.GET); + break; + case POST: + tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.POST); + break; + case PUT: + tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.PUT); + break; + case DELETE: + tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.DELETE); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertSearchEntryMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Bundle.SearchEntryModeEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case MATCH: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.SearchEntryMode.MATCH); - break; - case INCLUDE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.SearchEntryMode.INCLUDE); - break; - case OUTCOME: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.SearchEntryMode.OUTCOME); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Bundle.SearchEntryMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Bundle.SearchEntryModeEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MATCH: + tgt.setValue(Bundle.SearchEntryMode.MATCH); + break; + case INCLUDE: + tgt.setValue(Bundle.SearchEntryMode.INCLUDE); + break; + case OUTCOME: + tgt.setValue(Bundle.SearchEntryMode.OUTCOME); + break; + default: + tgt.setValue(Bundle.SearchEntryMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertSearchEntryMode(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Bundle.SearchEntryModeEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case MATCH: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.SearchEntryMode.MATCH); - break; - case INCLUDE: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.SearchEntryMode.INCLUDE); - break; - case OUTCOME: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.SearchEntryMode.OUTCOME); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.SearchEntryMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Bundle.SearchEntryModeEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MATCH: + tgt.setValue(org.hl7.fhir.r5.model.Bundle.SearchEntryMode.MATCH); + break; + case INCLUDE: + tgt.setValue(org.hl7.fhir.r5.model.Bundle.SearchEntryMode.INCLUDE); + break; + case OUTCOME: + tgt.setValue(org.hl7.fhir.r5.model.Bundle.SearchEntryMode.OUTCOME); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.Bundle.SearchEntryMode.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/CodeSystem14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/CodeSystem14_50.java index 4b090d9450..a4c418007a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/CodeSystem14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/CodeSystem14_50.java @@ -11,6 +11,7 @@ import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.String14_50; import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.UnsignedInt14_50; import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.Uri14_50; +import org.hl7.fhir.dstu2016may.model.CodeSystem; import org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionPropertyComponent; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.Enumeration; @@ -153,53 +154,61 @@ public static org.hl7.fhir.r5.model.ContactDetail convertCodeSystemContactCompon } static public org.hl7.fhir.dstu2016may.model.Enumeration convertCodeSystemContentMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContentModeEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case NOTPRESENT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContentMode.NOTPRESENT); - break; - case EXAMPLE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContentMode.EXAMPLAR); - break; - case FRAGMENT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContentMode.FRAGMENT); - break; - case COMPLETE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContentMode.COMPLETE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContentMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new CodeSystem.CodeSystemContentModeEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTPRESENT: + tgt.setValue(CodeSystem.CodeSystemContentMode.NOTPRESENT); + break; + case EXAMPLE: + tgt.setValue(CodeSystem.CodeSystemContentMode.EXAMPLAR); + break; + case FRAGMENT: + tgt.setValue(CodeSystem.CodeSystemContentMode.FRAGMENT); + break; + case COMPLETE: + tgt.setValue(CodeSystem.CodeSystemContentMode.COMPLETE); + break; + default: + tgt.setValue(CodeSystem.CodeSystemContentMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertCodeSystemContentMode(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.CodeSystemContentModeEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case NOTPRESENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CodeSystemContentMode.NOTPRESENT); - break; - case EXAMPLAR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CodeSystemContentMode.EXAMPLE); - break; - case FRAGMENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CodeSystemContentMode.FRAGMENT); - break; - case COMPLETE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CodeSystemContentMode.COMPLETE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CodeSystemContentMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.CodeSystemContentModeEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTPRESENT: + tgt.setValue(Enumerations.CodeSystemContentMode.NOTPRESENT); + break; + case EXAMPLAR: + tgt.setValue(Enumerations.CodeSystemContentMode.EXAMPLE); + break; + case FRAGMENT: + tgt.setValue(Enumerations.CodeSystemContentMode.FRAGMENT); + break; + case COMPLETE: + tgt.setValue(Enumerations.CodeSystemContentMode.COMPLETE); + break; + default: + tgt.setValue(Enumerations.CodeSystemContentMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemFilterComponent convertCodeSystemFilterComponent(org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent src) throws FHIRException { @@ -357,64 +366,72 @@ public static org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemPropertyCompon } static public org.hl7.fhir.r5.model.Enumeration convertPropertyType(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CodeSystem.PropertyTypeEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case CODE: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.CODE); - break; - case CODING: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.CODING); - break; - case STRING: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.STRING); - break; - case INTEGER: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.INTEGER); - break; - case BOOLEAN: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.BOOLEAN); - break; - case DATETIME: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.DATETIME); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new org.hl7.fhir.r5.model.CodeSystem.PropertyTypeEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CODE: + tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.CODE); + break; + case CODING: + tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.CODING); + break; + case STRING: + tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.STRING); + break; + case INTEGER: + tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.INTEGER); + break; + case BOOLEAN: + tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.BOOLEAN); + break; + case DATETIME: + tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.DATETIME); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertPropertyType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyTypeEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case CODE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.CODE); - break; - case CODING: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.CODING); - break; - case STRING: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.STRING); - break; - case INTEGER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.INTEGER); - break; - case BOOLEAN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.BOOLEAN); - break; - case DATETIME: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.DATETIME); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new CodeSystem.PropertyTypeEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CODE: + tgt.setValue(CodeSystem.PropertyType.CODE); + break; + case CODING: + tgt.setValue(CodeSystem.PropertyType.CODING); + break; + case STRING: + tgt.setValue(CodeSystem.PropertyType.STRING); + break; + case INTEGER: + tgt.setValue(CodeSystem.PropertyType.INTEGER); + break; + case BOOLEAN: + tgt.setValue(CodeSystem.PropertyType.BOOLEAN); + break; + case DATETIME: + tgt.setValue(CodeSystem.PropertyType.DATETIME); + break; + default: + tgt.setValue(CodeSystem.PropertyType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/CompartmentDefinition14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/CompartmentDefinition14_50.java index 426c014a20..68e427086c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/CompartmentDefinition14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/CompartmentDefinition14_50.java @@ -7,7 +7,10 @@ import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.DateTime14_50; import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.String14_50; import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.Uri14_50; +import org.hl7.fhir.dstu2016may.model.CompartmentDefinition; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; public class CompartmentDefinition14_50 { @@ -128,58 +131,66 @@ public static org.hl7.fhir.r5.model.CompartmentDefinition.CompartmentDefinitionR } static public org.hl7.fhir.r5.model.Enumeration convertCompartmentType(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.CompartmentTypeEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case PATIENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.PATIENT); - break; - case ENCOUNTER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.ENCOUNTER); - break; - case RELATEDPERSON: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.RELATEDPERSON); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.PRACTITIONER); - break; - case DEVICE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.DEVICE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.CompartmentTypeEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PATIENT: + tgt.setValue(Enumerations.CompartmentType.PATIENT); + break; + case ENCOUNTER: + tgt.setValue(Enumerations.CompartmentType.ENCOUNTER); + break; + case RELATEDPERSON: + tgt.setValue(Enumerations.CompartmentType.RELATEDPERSON); + break; + case PRACTITIONER: + tgt.setValue(Enumerations.CompartmentType.PRACTITIONER); + break; + case DEVICE: + tgt.setValue(Enumerations.CompartmentType.DEVICE); + break; + default: + tgt.setValue(Enumerations.CompartmentType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertCompartmentType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentTypeEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case PATIENT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentType.PATIENT); - break; - case ENCOUNTER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentType.ENCOUNTER); - break; - case RELATEDPERSON: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentType.RELATEDPERSON); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentType.PRACTITIONER); - break; - case DEVICE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentType.DEVICE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.CompartmentDefinition.CompartmentType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new CompartmentDefinition.CompartmentTypeEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PATIENT: + tgt.setValue(CompartmentDefinition.CompartmentType.PATIENT); + break; + case ENCOUNTER: + tgt.setValue(CompartmentDefinition.CompartmentType.ENCOUNTER); + break; + case RELATEDPERSON: + tgt.setValue(CompartmentDefinition.CompartmentType.RELATEDPERSON); + break; + case PRACTITIONER: + tgt.setValue(CompartmentDefinition.CompartmentType.PRACTITIONER); + break; + case DEVICE: + tgt.setValue(CompartmentDefinition.CompartmentType.DEVICE); + break; + default: + tgt.setValue(CompartmentDefinition.CompartmentType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/ConceptMap14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/ConceptMap14_50.java index 6b877363ce..2ef2e7ff52 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/ConceptMap14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/ConceptMap14_50.java @@ -159,66 +159,74 @@ public static org.hl7.fhir.dstu2016may.model.Enumeration if (ccm.hasExtension(VersionConvertorConstants.EXT_OLD_CONCEPTMAP_EQUIVALENCE)) { tgt.setValueAsString(ccm.getExtensionString(VersionConvertorConstants.EXT_OLD_CONCEPTMAP_EQUIVALENCE)); } else { - switch (src.getValue()) { - case EQUIVALENT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence.EQUIVALENT); - break; - case SOURCEISNARROWERTHANTARGET: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence.WIDER); - break; - case SOURCEISBROADERTHANTARGET: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence.NARROWER); - break; - case NOTRELATEDTO: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence.DISJOINT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence.NULL); - break; - } + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUIVALENT: + tgt.setValue(ConceptMapEquivalence.EQUIVALENT); + break; + case SOURCEISNARROWERTHANTARGET: + tgt.setValue(ConceptMapEquivalence.WIDER); + break; + case SOURCEISBROADERTHANTARGET: + tgt.setValue(ConceptMapEquivalence.NARROWER); + break; + case NOTRELATEDTO: + tgt.setValue(ConceptMapEquivalence.DISJOINT); + break; + default: + tgt.setValue(ConceptMapEquivalence.NULL); + break; + } + } } return tgt; } public static Enumeration convertConceptMapRelationship(org.hl7.fhir.dstu2016may.model.Enumeration src, org.hl7.fhir.r5.model.ConceptMap.TargetElementComponent tgtCtxt) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - Enumeration tgt = new Enumeration(new Enumerations.ConceptMapRelationshipEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - ToolingExtensions.setCodeExtensionMod(tgtCtxt, VersionConvertorConstants.EXT_OLD_CONCEPTMAP_EQUIVALENCE, src.getValueAsString()); - switch (src.getValue()) { - case EQUIVALENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.EQUIVALENT); - break; - case EQUAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.EQUIVALENT); - break; - case WIDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.SOURCEISNARROWERTHANTARGET); - break; - case SUBSUMES: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.SOURCEISNARROWERTHANTARGET); - break; - case NARROWER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.SOURCEISBROADERTHANTARGET); - break; - case SPECIALIZES: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.SOURCEISBROADERTHANTARGET); - break; - case INEXACT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.RELATEDTO); - break; - case UNMATCHED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NULL); - break; - case DISJOINT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NOTRELATEDTO); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration(new Enumerations.ConceptMapRelationshipEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + ToolingExtensions.setCodeExtensionMod(tgtCtxt, VersionConvertorConstants.EXT_OLD_CONCEPTMAP_EQUIVALENCE, src.getValueAsString()); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUIVALENT: + tgt.setValue(ConceptMapRelationship.EQUIVALENT); + break; + case EQUAL: + tgt.setValue(ConceptMapRelationship.EQUIVALENT); + break; + case WIDER: + tgt.setValue(ConceptMapRelationship.SOURCEISNARROWERTHANTARGET); + break; + case SUBSUMES: + tgt.setValue(ConceptMapRelationship.SOURCEISNARROWERTHANTARGET); + break; + case NARROWER: + tgt.setValue(ConceptMapRelationship.SOURCEISBROADERTHANTARGET); + break; + case SPECIALIZES: + tgt.setValue(ConceptMapRelationship.SOURCEISBROADERTHANTARGET); + break; + case INEXACT: + tgt.setValue(ConceptMapRelationship.RELATEDTO); + break; + case UNMATCHED: + tgt.setValue(ConceptMapRelationship.NULL); + break; + case DISJOINT: + tgt.setValue(ConceptMapRelationship.NOTRELATEDTO); + break; + default: + tgt.setValue(ConceptMapRelationship.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2016may.model.ConceptMap.OtherElementComponent convertOtherElementComponent(org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent src, org.hl7.fhir.r5.model.ConceptMap srcMap) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/Conformance14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/Conformance14_50.java index afe87693e0..ad11b1eb11 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/Conformance14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/Conformance14_50.java @@ -12,9 +12,13 @@ import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.String14_50; import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.UnsignedInt14_50; import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.Uri14_50; +import org.hl7.fhir.dstu2016may.model.Conformance; +import org.hl7.fhir.dstu2016may.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.CapabilityStatement; import org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestComponent; import org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent; +import org.hl7.fhir.r5.model.Enumerations; public class Conformance14_50 { @@ -27,21 +31,25 @@ public class Conformance14_50 { static public org.hl7.fhir.dstu2016may.model.Enumeration convertConditionalDeleteStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { if (src == null || src.isEmpty()) return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Conformance.ConditionalDeleteStatusEnumFactory()); + Enumeration tgt = new Enumeration<>(new Conformance.ConditionalDeleteStatusEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ConditionalDeleteStatus.NOTSUPPORTED); - break; - case SINGLE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ConditionalDeleteStatus.SINGLE); - break; - case MULTIPLE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ConditionalDeleteStatus.MULTIPLE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ConditionalDeleteStatus.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTSUPPORTED: + tgt.setValue(Conformance.ConditionalDeleteStatus.NOTSUPPORTED); + break; + case SINGLE: + tgt.setValue(Conformance.ConditionalDeleteStatus.SINGLE); + break; + case MULTIPLE: + tgt.setValue(Conformance.ConditionalDeleteStatus.MULTIPLE); + break; + default: + tgt.setValue(Conformance.ConditionalDeleteStatus.NULL); + break; + } } return tgt; } @@ -49,21 +57,25 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration convertConditionalDeleteStatus(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { if (src == null || src.isEmpty()) return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatusEnumFactory()); + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new CapabilityStatement.ConditionalDeleteStatusEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus.NOTSUPPORTED); - break; - case SINGLE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus.SINGLE); - break; - case MULTIPLE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus.MULTIPLE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTSUPPORTED: + tgt.setValue(CapabilityStatement.ConditionalDeleteStatus.NOTSUPPORTED); + break; + case SINGLE: + tgt.setValue(CapabilityStatement.ConditionalDeleteStatus.SINGLE); + break; + case MULTIPLE: + tgt.setValue(CapabilityStatement.ConditionalDeleteStatus.MULTIPLE); + break; + default: + tgt.setValue(CapabilityStatement.ConditionalDeleteStatus.NULL); + break; + } } return tgt; } @@ -565,21 +577,25 @@ public static org.hl7.fhir.dstu2016may.model.Conformance.ConformanceSoftwareComp static public org.hl7.fhir.r5.model.Enumeration convertConformanceStatementKind(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { if (src == null || src.isEmpty()) return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKindEnumFactory()); + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new Enumerations.CapabilityStatementKindEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.INSTANCE); - break; - case CAPABILITY: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.CAPABILITY); - break; - case REQUIREMENTS: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.REQUIREMENTS); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(Enumerations.CapabilityStatementKind.INSTANCE); + break; + case CAPABILITY: + tgt.setValue(Enumerations.CapabilityStatementKind.CAPABILITY); + break; + case REQUIREMENTS: + tgt.setValue(Enumerations.CapabilityStatementKind.REQUIREMENTS); + break; + default: + tgt.setValue(Enumerations.CapabilityStatementKind.NULL); + break; + } } return tgt; } @@ -587,21 +603,25 @@ static public org.hl7.fhir.r5.model.Enumeration convertConformanceStatementKind(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { if (src == null || src.isEmpty()) return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Conformance.ConformanceStatementKindEnumFactory()); + Enumeration tgt = new Enumeration<>(new Conformance.ConformanceStatementKindEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ConformanceStatementKind.INSTANCE); - break; - case CAPABILITY: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ConformanceStatementKind.CAPABILITY); - break; - case REQUIREMENTS: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ConformanceStatementKind.REQUIREMENTS); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ConformanceStatementKind.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(Conformance.ConformanceStatementKind.INSTANCE); + break; + case CAPABILITY: + tgt.setValue(Conformance.ConformanceStatementKind.CAPABILITY); + break; + case REQUIREMENTS: + tgt.setValue(Conformance.ConformanceStatementKind.REQUIREMENTS); + break; + default: + tgt.setValue(Conformance.ConformanceStatementKind.NULL); + break; + } } return tgt; } @@ -609,18 +629,22 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration convertDocumentMode(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { if (src == null || src.isEmpty()) return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.DocumentModeEnumFactory()); + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new CapabilityStatement.DocumentModeEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case PRODUCER: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.DocumentMode.PRODUCER); - break; - case CONSUMER: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.DocumentMode.CONSUMER); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.DocumentMode.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRODUCER: + tgt.setValue(CapabilityStatement.DocumentMode.PRODUCER); + break; + case CONSUMER: + tgt.setValue(CapabilityStatement.DocumentMode.CONSUMER); + break; + default: + tgt.setValue(CapabilityStatement.DocumentMode.NULL); + break; + } } return tgt; } @@ -628,18 +652,22 @@ static public org.hl7.fhir.r5.model.Enumeration convertDocumentMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { if (src == null || src.isEmpty()) return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Conformance.DocumentModeEnumFactory()); + Enumeration tgt = new Enumeration<>(new Conformance.DocumentModeEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case PRODUCER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.DocumentMode.PRODUCER); - break; - case CONSUMER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.DocumentMode.CONSUMER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.DocumentMode.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRODUCER: + tgt.setValue(Conformance.DocumentMode.PRODUCER); + break; + case CONSUMER: + tgt.setValue(Conformance.DocumentMode.CONSUMER); + break; + default: + tgt.setValue(Conformance.DocumentMode.NULL); + break; + } } return tgt; } @@ -671,21 +699,25 @@ public static org.hl7.fhir.dstu2016may.model.Conformance.ResourceInteractionComp static public org.hl7.fhir.r5.model.Enumeration convertResourceVersionPolicy(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { if (src == null || src.isEmpty()) return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicyEnumFactory()); + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new CapabilityStatement.ResourceVersionPolicyEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case NOVERSION: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy.NOVERSION); - break; - case VERSIONED: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy.VERSIONED); - break; - case VERSIONEDUPDATE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy.VERSIONEDUPDATE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOVERSION: + tgt.setValue(CapabilityStatement.ResourceVersionPolicy.NOVERSION); + break; + case VERSIONED: + tgt.setValue(CapabilityStatement.ResourceVersionPolicy.VERSIONED); + break; + case VERSIONEDUPDATE: + tgt.setValue(CapabilityStatement.ResourceVersionPolicy.VERSIONEDUPDATE); + break; + default: + tgt.setValue(CapabilityStatement.ResourceVersionPolicy.NULL); + break; + } } return tgt; } @@ -693,21 +725,25 @@ static public org.hl7.fhir.r5.model.Enumeration convertResourceVersionPolicy(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { if (src == null || src.isEmpty()) return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Conformance.ResourceVersionPolicyEnumFactory()); + Enumeration tgt = new Enumeration<>(new Conformance.ResourceVersionPolicyEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case NOVERSION: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ResourceVersionPolicy.NOVERSION); - break; - case VERSIONED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ResourceVersionPolicy.VERSIONED); - break; - case VERSIONEDUPDATE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ResourceVersionPolicy.VERSIONEDUPDATE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ResourceVersionPolicy.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOVERSION: + tgt.setValue(Conformance.ResourceVersionPolicy.NOVERSION); + break; + case VERSIONED: + tgt.setValue(Conformance.ResourceVersionPolicy.VERSIONED); + break; + case VERSIONEDUPDATE: + tgt.setValue(Conformance.ResourceVersionPolicy.VERSIONEDUPDATE); + break; + default: + tgt.setValue(Conformance.ResourceVersionPolicy.NULL); + break; + } } return tgt; } @@ -715,18 +751,22 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration convertRestfulConformanceMode(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { if (src == null || src.isEmpty()) return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.RestfulCapabilityModeEnumFactory()); + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new CapabilityStatement.RestfulCapabilityModeEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case CLIENT: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.RestfulCapabilityMode.CLIENT); - break; - case SERVER: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.RestfulCapabilityMode.SERVER); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.RestfulCapabilityMode.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CLIENT: + tgt.setValue(CapabilityStatement.RestfulCapabilityMode.CLIENT); + break; + case SERVER: + tgt.setValue(CapabilityStatement.RestfulCapabilityMode.SERVER); + break; + default: + tgt.setValue(CapabilityStatement.RestfulCapabilityMode.NULL); + break; + } } return tgt; } @@ -734,18 +774,22 @@ static public org.hl7.fhir.r5.model.Enumeration convertRestfulConformanceMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { if (src == null || src.isEmpty()) return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Conformance.RestfulConformanceModeEnumFactory()); + Enumeration tgt = new Enumeration<>(new Conformance.RestfulConformanceModeEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case CLIENT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.RestfulConformanceMode.CLIENT); - break; - case SERVER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.RestfulConformanceMode.SERVER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.RestfulConformanceMode.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CLIENT: + tgt.setValue(Conformance.RestfulConformanceMode.CLIENT); + break; + case SERVER: + tgt.setValue(Conformance.RestfulConformanceMode.SERVER); + break; + default: + tgt.setValue(Conformance.RestfulConformanceMode.NULL); + break; + } } return tgt; } @@ -777,21 +821,25 @@ public static org.hl7.fhir.r5.model.CapabilityStatement.SystemInteractionCompone static public org.hl7.fhir.r5.model.Enumeration convertSystemRestfulInteraction(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { if (src == null || src.isEmpty()) return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteractionEnumFactory()); + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new CapabilityStatement.SystemRestfulInteractionEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case TRANSACTION: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.TRANSACTION); - break; - case SEARCHSYSTEM: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.SEARCHSYSTEM); - break; - case HISTORYSYSTEM: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.HISTORYSYSTEM); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case TRANSACTION: + tgt.setValue(CapabilityStatement.SystemRestfulInteraction.TRANSACTION); + break; + case SEARCHSYSTEM: + tgt.setValue(CapabilityStatement.SystemRestfulInteraction.SEARCHSYSTEM); + break; + case HISTORYSYSTEM: + tgt.setValue(CapabilityStatement.SystemRestfulInteraction.HISTORYSYSTEM); + break; + default: + tgt.setValue(CapabilityStatement.SystemRestfulInteraction.NULL); + break; + } } return tgt; } @@ -799,21 +847,25 @@ static public org.hl7.fhir.r5.model.Enumeration convertSystemRestfulInteraction(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { if (src == null || src.isEmpty()) return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Conformance.SystemRestfulInteractionEnumFactory()); + Enumeration tgt = new Enumeration<>(new Conformance.SystemRestfulInteractionEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case TRANSACTION: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.SystemRestfulInteraction.TRANSACTION); - break; - case SEARCHSYSTEM: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.SystemRestfulInteraction.SEARCHSYSTEM); - break; - case HISTORYSYSTEM: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.SystemRestfulInteraction.HISTORYSYSTEM); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.SystemRestfulInteraction.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case TRANSACTION: + tgt.setValue(Conformance.SystemRestfulInteraction.TRANSACTION); + break; + case SEARCHSYSTEM: + tgt.setValue(Conformance.SystemRestfulInteraction.SEARCHSYSTEM); + break; + case HISTORYSYSTEM: + tgt.setValue(Conformance.SystemRestfulInteraction.HISTORYSYSTEM); + break; + default: + tgt.setValue(Conformance.SystemRestfulInteraction.NULL); + break; + } } return tgt; } @@ -821,36 +873,40 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration convertTypeRestfulInteraction(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { if (src == null || src.isEmpty()) return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Conformance.TypeRestfulInteractionEnumFactory()); + Enumeration tgt = new Enumeration<>(new Conformance.TypeRestfulInteractionEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case READ: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.TypeRestfulInteraction.READ); - break; - case VREAD: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.TypeRestfulInteraction.VREAD); - break; - case UPDATE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.TypeRestfulInteraction.UPDATE); - break; - case DELETE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.TypeRestfulInteraction.DELETE); - break; - case HISTORYINSTANCE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.TypeRestfulInteraction.HISTORYINSTANCE); - break; - case HISTORYTYPE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.TypeRestfulInteraction.HISTORYTYPE); - break; - case CREATE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.TypeRestfulInteraction.CREATE); - break; - case SEARCHTYPE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.TypeRestfulInteraction.SEARCHTYPE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.TypeRestfulInteraction.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case READ: + tgt.setValue(Conformance.TypeRestfulInteraction.READ); + break; + case VREAD: + tgt.setValue(Conformance.TypeRestfulInteraction.VREAD); + break; + case UPDATE: + tgt.setValue(Conformance.TypeRestfulInteraction.UPDATE); + break; + case DELETE: + tgt.setValue(Conformance.TypeRestfulInteraction.DELETE); + break; + case HISTORYINSTANCE: + tgt.setValue(Conformance.TypeRestfulInteraction.HISTORYINSTANCE); + break; + case HISTORYTYPE: + tgt.setValue(Conformance.TypeRestfulInteraction.HISTORYTYPE); + break; + case CREATE: + tgt.setValue(Conformance.TypeRestfulInteraction.CREATE); + break; + case SEARCHTYPE: + tgt.setValue(Conformance.TypeRestfulInteraction.SEARCHTYPE); + break; + default: + tgt.setValue(Conformance.TypeRestfulInteraction.NULL); + break; + } } return tgt; } @@ -858,36 +914,40 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration convertTypeRestfulInteraction(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { if (src == null || src.isEmpty()) return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteractionEnumFactory()); + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new CapabilityStatement.TypeRestfulInteractionEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case READ: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.READ); - break; - case VREAD: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.VREAD); - break; - case UPDATE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.UPDATE); - break; - case DELETE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.DELETE); - break; - case HISTORYINSTANCE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.HISTORYINSTANCE); - break; - case HISTORYTYPE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.HISTORYTYPE); - break; - case CREATE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.CREATE); - break; - case SEARCHTYPE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.SEARCHTYPE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case READ: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.READ); + break; + case VREAD: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.VREAD); + break; + case UPDATE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.UPDATE); + break; + case DELETE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.DELETE); + break; + case HISTORYINSTANCE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.HISTORYINSTANCE); + break; + case HISTORYTYPE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.HISTORYTYPE); + break; + case CREATE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.CREATE); + break; + case SEARCHTYPE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.SEARCHTYPE); + break; + default: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.NULL); + break; + } } return tgt; } @@ -897,20 +957,20 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityModeEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityMode.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case SENDER: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityMode.SENDER); - break; - case RECEIVER: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityMode.RECEIVER); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityMode.NULL); - break; - } - } + tgt.setValue(CapabilityStatement.EventCapabilityMode.SENDER); + break; + case RECEIVER: + tgt.setValue(CapabilityStatement.EventCapabilityMode.RECEIVER); + break; + default: + tgt.setValue(CapabilityStatement.EventCapabilityMode.NULL); + break; + } +} return tgt; } @@ -919,20 +979,20 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Conformance.ConformanceEventModeEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ConformanceEventMode.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case SENDER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ConformanceEventMode.SENDER); - break; - case RECEIVER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ConformanceEventMode.RECEIVER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Conformance.ConformanceEventMode.NULL); - break; - } - } + tgt.setValue(Conformance.ConformanceEventMode.SENDER); + break; + case RECEIVER: + tgt.setValue(Conformance.ConformanceEventMode.RECEIVER); + break; + default: + tgt.setValue(Conformance.ConformanceEventMode.NULL); + break; + } +} return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/Enumerations14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/Enumerations14_50.java index 14d514773a..8fe89ee8d1 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/Enumerations14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/Enumerations14_50.java @@ -2,6 +2,7 @@ import org.hl7.fhir.convertors.context.ConversionContext14_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumerations; public class Enumerations14_50 { static public org.hl7.fhir.r5.model.Enumeration convertBindingStrength(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { @@ -9,26 +10,26 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.BindingStrengthEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.BindingStrength.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case REQUIRED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.BindingStrength.REQUIRED); - break; - case EXTENSIBLE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.BindingStrength.EXTENSIBLE); - break; - case PREFERRED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.BindingStrength.PREFERRED); - break; - case EXAMPLE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.BindingStrength.EXAMPLE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.BindingStrength.NULL); - break; - } - } + tgt.setValue(Enumerations.BindingStrength.REQUIRED); + break; + case EXTENSIBLE: + tgt.setValue(Enumerations.BindingStrength.EXTENSIBLE); + break; + case PREFERRED: + tgt.setValue(Enumerations.BindingStrength.PREFERRED); + break; + case EXAMPLE: + tgt.setValue(Enumerations.BindingStrength.EXAMPLE); + break; + default: + tgt.setValue(Enumerations.BindingStrength.NULL); + break; + } +} return tgt; } @@ -37,26 +38,26 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrengthEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case REQUIRED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength.REQUIRED); - break; - case EXTENSIBLE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength.EXTENSIBLE); - break; - case PREFERRED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength.PREFERRED); - break; - case EXAMPLE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength.EXAMPLE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength.REQUIRED); + break; + case EXTENSIBLE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength.EXTENSIBLE); + break; + case PREFERRED: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength.PREFERRED); + break; + case EXAMPLE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength.EXAMPLE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength.NULL); + break; + } +} return tgt; } @@ -65,23 +66,23 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.PublicationStatusEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.ACTIVE); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.RETIRED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.NULL); - break; - } - } + tgt.setValue(Enumerations.PublicationStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(Enumerations.PublicationStatus.ACTIVE); + break; + case RETIRED: + tgt.setValue(Enumerations.PublicationStatus.RETIRED); + break; + default: + tgt.setValue(Enumerations.PublicationStatus.NULL); + break; + } +} return tgt; } @@ -90,23 +91,23 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatusEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case DRAFT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus.ACTIVE); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus.RETIRED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus.ACTIVE); + break; + case RETIRED: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus.RETIRED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus.NULL); + break; + } +} return tgt; } @@ -115,38 +116,38 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.SearchParamTypeEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case NUMBER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.NUMBER); - break; - case DATE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.DATE); - break; - case STRING: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.STRING); - break; - case TOKEN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.TOKEN); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.REFERENCE); - break; - case COMPOSITE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.COMPOSITE); - break; - case QUANTITY: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.QUANTITY); - break; - case URI: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.URI); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.NULL); - break; - } - } + tgt.setValue(Enumerations.SearchParamType.NUMBER); + break; + case DATE: + tgt.setValue(Enumerations.SearchParamType.DATE); + break; + case STRING: + tgt.setValue(Enumerations.SearchParamType.STRING); + break; + case TOKEN: + tgt.setValue(Enumerations.SearchParamType.TOKEN); + break; + case REFERENCE: + tgt.setValue(Enumerations.SearchParamType.REFERENCE); + break; + case COMPOSITE: + tgt.setValue(Enumerations.SearchParamType.COMPOSITE); + break; + case QUANTITY: + tgt.setValue(Enumerations.SearchParamType.QUANTITY); + break; + case URI: + tgt.setValue(Enumerations.SearchParamType.URI); + break; + default: + tgt.setValue(Enumerations.SearchParamType.NULL); + break; + } +} return tgt; } @@ -155,38 +156,38 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamTypeEnumFactory()); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case NUMBER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.NUMBER); - break; - case DATE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.DATE); - break; - case STRING: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.STRING); - break; - case TOKEN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.TOKEN); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.REFERENCE); - break; - case COMPOSITE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.COMPOSITE); - break; - case QUANTITY: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.QUANTITY); - break; - case URI: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.URI); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.NUMBER); + break; + case DATE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.DATE); + break; + case STRING: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.STRING); + break; + case TOKEN: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.TOKEN); + break; + case REFERENCE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.REFERENCE); + break; + case COMPOSITE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.COMPOSITE); + break; + case QUANTITY: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.QUANTITY); + break; + case URI: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.URI); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/NamingSystem14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/NamingSystem14_50.java index a41e3119d4..00dfcaccf4 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/NamingSystem14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/NamingSystem14_50.java @@ -12,6 +12,8 @@ import org.hl7.fhir.dstu2016may.model.Extension; import org.hl7.fhir.dstu2016may.model.StringType; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.NamingSystem; public class NamingSystem14_50 { @@ -121,97 +123,113 @@ public static org.hl7.fhir.r5.model.ContactDetail convertNamingSystemContactComp } static public org.hl7.fhir.r5.model.Enumeration convertNamingSystemIdentifierType(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierTypeEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case OID: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierType.OID); - break; - case UUID: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierType.UUID); - break; - case URI: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierType.URI); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierType.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new NamingSystem.NamingSystemIdentifierTypeEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OID: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.OID); + break; + case UUID: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.UUID); + break; + case URI: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.URI); + break; + case OTHER: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.OTHER); + break; + default: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertNamingSystemIdentifierType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemIdentifierTypeEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case OID: - tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemIdentifierType.OID); - break; - case UUID: - tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemIdentifierType.UUID); - break; - case URI: - tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemIdentifierType.URI); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemIdentifierType.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemIdentifierType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemIdentifierTypeEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OID: + tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemIdentifierType.OID); + break; + case UUID: + tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemIdentifierType.UUID); + break; + case URI: + tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemIdentifierType.URI); + break; + case OTHER: + tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemIdentifierType.OTHER); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemIdentifierType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertNamingSystemType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemTypeEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case CODESYSTEM: - tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemType.CODESYSTEM); - break; - case IDENTIFIER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemType.IDENTIFIER); - break; - case ROOT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemType.ROOT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemTypeEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CODESYSTEM: + tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemType.CODESYSTEM); + break; + case IDENTIFIER: + tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemType.IDENTIFIER); + break; + case ROOT: + tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemType.ROOT); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertNamingSystemType(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.NamingSystem.NamingSystemTypeEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case CODESYSTEM: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemType.CODESYSTEM); - break; - case IDENTIFIER: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemType.IDENTIFIER); - break; - case ROOT: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemType.ROOT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new NamingSystem.NamingSystemTypeEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CODESYSTEM: + tgt.setValue(NamingSystem.NamingSystemType.CODESYSTEM); + break; + case IDENTIFIER: + tgt.setValue(NamingSystem.NamingSystemType.IDENTIFIER); + break; + case ROOT: + tgt.setValue(NamingSystem.NamingSystemType.ROOT); + break; + default: + tgt.setValue(NamingSystem.NamingSystemType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2016may.model.NamingSystem.NamingSystemUniqueIdComponent convertNamingSystemUniqueIdComponent(org.hl7.fhir.r5.model.NamingSystem.NamingSystemUniqueIdComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/OperationDefinition14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/OperationDefinition14_50.java index fa29027bae..cade11b741 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/OperationDefinition14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/OperationDefinition14_50.java @@ -11,6 +11,7 @@ import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.Integer14_50; import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.String14_50; import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.Uri14_50; +import org.hl7.fhir.dstu2016may.model.OperationDefinition; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.DataType; import org.hl7.fhir.r5.model.Enumeration; @@ -246,78 +247,94 @@ private static String fixTypeCode(String type) { } static public org.hl7.fhir.dstu2016may.model.Enumeration convertOperationKind(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationKindEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case OPERATION: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationKind.OPERATION); - break; - case QUERY: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationKind.QUERY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new OperationDefinition.OperationKindEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OPERATION: + tgt.setValue(OperationDefinition.OperationKind.OPERATION); + break; + case QUERY: + tgt.setValue(OperationDefinition.OperationKind.QUERY); + break; + default: + tgt.setValue(OperationDefinition.OperationKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertOperationKind(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.OperationDefinition.OperationKindEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case OPERATION: - tgt.setValue(org.hl7.fhir.r5.model.OperationDefinition.OperationKind.OPERATION); - break; - case QUERY: - tgt.setValue(org.hl7.fhir.r5.model.OperationDefinition.OperationKind.QUERY); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.OperationDefinition.OperationKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new org.hl7.fhir.r5.model.OperationDefinition.OperationKindEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OPERATION: + tgt.setValue(org.hl7.fhir.r5.model.OperationDefinition.OperationKind.OPERATION); + break; + case QUERY: + tgt.setValue(org.hl7.fhir.r5.model.OperationDefinition.OperationKind.QUERY); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.OperationDefinition.OperationKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertOperationParameterUse(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.OperationParameterUseEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case IN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.OperationParameterUse.IN); - break; - case OUT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.OperationParameterUse.OUT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.OperationParameterUse.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.OperationParameterUseEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case IN: + tgt.setValue(Enumerations.OperationParameterUse.IN); + break; + case OUT: + tgt.setValue(Enumerations.OperationParameterUse.OUT); + break; + default: + tgt.setValue(Enumerations.OperationParameterUse.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertOperationParameterUse(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationParameterUseEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case IN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationParameterUse.IN); - break; - case OUT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationParameterUse.OUT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationParameterUse.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new OperationDefinition.OperationParameterUseEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case IN: + tgt.setValue(OperationDefinition.OperationParameterUse.IN); + break; + case OUT: + tgt.setValue(OperationDefinition.OperationParameterUse.OUT); + break; + default: + tgt.setValue(OperationDefinition.OperationParameterUse.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/OperationOutcome14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/OperationOutcome14_50.java index ce5acb6e5b..aebae47640 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/OperationOutcome14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/OperationOutcome14_50.java @@ -4,258 +4,276 @@ import org.hl7.fhir.convertors.conv14_50.datatypes14_50.ElementDefinition14_50; import org.hl7.fhir.convertors.conv14_50.datatypes14_50.complextypes14_50.CodeableConcept14_50; import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.String14_50; +import org.hl7.fhir.dstu2016may.model.Enumeration; +import org.hl7.fhir.dstu2016may.model.OperationOutcome; import org.hl7.fhir.exceptions.FHIRException; public class OperationOutcome14_50 { static public org.hl7.fhir.dstu2016may.model.Enumeration convertIssueSeverity(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueSeverityEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case FATAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueSeverity.FATAL); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueSeverity.ERROR); - break; - case WARNING: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueSeverity.WARNING); - break; - case INFORMATION: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueSeverity.INFORMATION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueSeverity.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new OperationOutcome.IssueSeverityEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FATAL: + tgt.setValue(OperationOutcome.IssueSeverity.FATAL); + break; + case ERROR: + tgt.setValue(OperationOutcome.IssueSeverity.ERROR); + break; + case WARNING: + tgt.setValue(OperationOutcome.IssueSeverity.WARNING); + break; + case INFORMATION: + tgt.setValue(OperationOutcome.IssueSeverity.INFORMATION); + break; + default: + tgt.setValue(OperationOutcome.IssueSeverity.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertIssueSeverity(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.OperationOutcome.IssueSeverityEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case FATAL: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.FATAL); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.ERROR); - break; - case WARNING: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.WARNING); - break; - case INFORMATION: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.INFORMATION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.OperationOutcome.IssueSeverityEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FATAL: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.FATAL); + break; + case ERROR: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.ERROR); + break; + case WARNING: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.WARNING); + break; + case INFORMATION: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.INFORMATION); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertIssueType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueTypeEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case INVALID: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.INVALID); - break; - case STRUCTURE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.STRUCTURE); - break; - case REQUIRED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.REQUIRED); - break; - case VALUE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.VALUE); - break; - case INVARIANT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.INVARIANT); - break; - case SECURITY: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.SECURITY); - break; - case LOGIN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.LOGIN); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.UNKNOWN); - break; - case EXPIRED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.EXPIRED); - break; - case FORBIDDEN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.FORBIDDEN); - break; - case SUPPRESSED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.SUPPRESSED); - break; - case PROCESSING: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.PROCESSING); - break; - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.NOTSUPPORTED); - break; - case DUPLICATE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.DUPLICATE); - break; - case NOTFOUND: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.NOTFOUND); - break; - case TOOLONG: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.TOOLONG); - break; - case CODEINVALID: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.CODEINVALID); - break; - case EXTENSION: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.EXTENSION); - break; - case TOOCOSTLY: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.TOOCOSTLY); - break; - case BUSINESSRULE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.BUSINESSRULE); - break; - case CONFLICT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.CONFLICT); - break; - case INCOMPLETE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.INCOMPLETE); - break; - case TRANSIENT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.TRANSIENT); - break; - case LOCKERROR: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.LOCKERROR); - break; - case NOSTORE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.NOSTORE); - break; - case EXCEPTION: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.EXCEPTION); - break; - case TIMEOUT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.TIMEOUT); - break; - case THROTTLED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.THROTTLED); - break; - case INFORMATIONAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.INFORMATIONAL); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new OperationOutcome.IssueTypeEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INVALID: + tgt.setValue(OperationOutcome.IssueType.INVALID); + break; + case STRUCTURE: + tgt.setValue(OperationOutcome.IssueType.STRUCTURE); + break; + case REQUIRED: + tgt.setValue(OperationOutcome.IssueType.REQUIRED); + break; + case VALUE: + tgt.setValue(OperationOutcome.IssueType.VALUE); + break; + case INVARIANT: + tgt.setValue(OperationOutcome.IssueType.INVARIANT); + break; + case SECURITY: + tgt.setValue(OperationOutcome.IssueType.SECURITY); + break; + case LOGIN: + tgt.setValue(OperationOutcome.IssueType.LOGIN); + break; + case UNKNOWN: + tgt.setValue(OperationOutcome.IssueType.UNKNOWN); + break; + case EXPIRED: + tgt.setValue(OperationOutcome.IssueType.EXPIRED); + break; + case FORBIDDEN: + tgt.setValue(OperationOutcome.IssueType.FORBIDDEN); + break; + case SUPPRESSED: + tgt.setValue(OperationOutcome.IssueType.SUPPRESSED); + break; + case PROCESSING: + tgt.setValue(OperationOutcome.IssueType.PROCESSING); + break; + case NOTSUPPORTED: + tgt.setValue(OperationOutcome.IssueType.NOTSUPPORTED); + break; + case DUPLICATE: + tgt.setValue(OperationOutcome.IssueType.DUPLICATE); + break; + case NOTFOUND: + tgt.setValue(OperationOutcome.IssueType.NOTFOUND); + break; + case TOOLONG: + tgt.setValue(OperationOutcome.IssueType.TOOLONG); + break; + case CODEINVALID: + tgt.setValue(OperationOutcome.IssueType.CODEINVALID); + break; + case EXTENSION: + tgt.setValue(OperationOutcome.IssueType.EXTENSION); + break; + case TOOCOSTLY: + tgt.setValue(OperationOutcome.IssueType.TOOCOSTLY); + break; + case BUSINESSRULE: + tgt.setValue(OperationOutcome.IssueType.BUSINESSRULE); + break; + case CONFLICT: + tgt.setValue(OperationOutcome.IssueType.CONFLICT); + break; + case INCOMPLETE: + tgt.setValue(OperationOutcome.IssueType.INCOMPLETE); + break; + case TRANSIENT: + tgt.setValue(OperationOutcome.IssueType.TRANSIENT); + break; + case LOCKERROR: + tgt.setValue(OperationOutcome.IssueType.LOCKERROR); + break; + case NOSTORE: + tgt.setValue(OperationOutcome.IssueType.NOSTORE); + break; + case EXCEPTION: + tgt.setValue(OperationOutcome.IssueType.EXCEPTION); + break; + case TIMEOUT: + tgt.setValue(OperationOutcome.IssueType.TIMEOUT); + break; + case THROTTLED: + tgt.setValue(OperationOutcome.IssueType.THROTTLED); + break; + case INFORMATIONAL: + tgt.setValue(OperationOutcome.IssueType.INFORMATIONAL); + break; + default: + tgt.setValue(OperationOutcome.IssueType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertIssueType(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.OperationOutcome.IssueTypeEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case INVALID: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.INVALID); - break; - case STRUCTURE: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.STRUCTURE); - break; - case REQUIRED: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.REQUIRED); - break; - case VALUE: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.VALUE); - break; - case INVARIANT: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.INVARIANT); - break; - case SECURITY: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.SECURITY); - break; - case LOGIN: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.LOGIN); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.UNKNOWN); - break; - case EXPIRED: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.EXPIRED); - break; - case FORBIDDEN: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.FORBIDDEN); - break; - case SUPPRESSED: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.SUPPRESSED); - break; - case PROCESSING: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.PROCESSING); - break; - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.NOTSUPPORTED); - break; - case DUPLICATE: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.DUPLICATE); - break; - case NOTFOUND: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.NOTFOUND); - break; - case TOOLONG: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.TOOLONG); - break; - case CODEINVALID: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.CODEINVALID); - break; - case EXTENSION: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.EXTENSION); - break; - case TOOCOSTLY: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.TOOCOSTLY); - break; - case BUSINESSRULE: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.BUSINESSRULE); - break; - case CONFLICT: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.CONFLICT); - break; - case INCOMPLETE: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.INCOMPLETE); - break; - case TRANSIENT: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.TRANSIENT); - break; - case LOCKERROR: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.LOCKERROR); - break; - case NOSTORE: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.NOSTORE); - break; - case EXCEPTION: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.EXCEPTION); - break; - case TIMEOUT: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.TIMEOUT); - break; - case THROTTLED: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.THROTTLED); - break; - case INFORMATIONAL: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.INFORMATIONAL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.OperationOutcome.IssueTypeEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INVALID: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.INVALID); + break; + case STRUCTURE: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.STRUCTURE); + break; + case REQUIRED: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.REQUIRED); + break; + case VALUE: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.VALUE); + break; + case INVARIANT: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.INVARIANT); + break; + case SECURITY: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.SECURITY); + break; + case LOGIN: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.LOGIN); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.UNKNOWN); + break; + case EXPIRED: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.EXPIRED); + break; + case FORBIDDEN: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.FORBIDDEN); + break; + case SUPPRESSED: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.SUPPRESSED); + break; + case PROCESSING: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.PROCESSING); + break; + case NOTSUPPORTED: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.NOTSUPPORTED); + break; + case DUPLICATE: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.DUPLICATE); + break; + case NOTFOUND: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.NOTFOUND); + break; + case TOOLONG: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.TOOLONG); + break; + case CODEINVALID: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.CODEINVALID); + break; + case EXTENSION: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.EXTENSION); + break; + case TOOCOSTLY: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.TOOCOSTLY); + break; + case BUSINESSRULE: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.BUSINESSRULE); + break; + case CONFLICT: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.CONFLICT); + break; + case INCOMPLETE: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.INCOMPLETE); + break; + case TRANSIENT: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.TRANSIENT); + break; + case LOCKERROR: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.LOCKERROR); + break; + case NOSTORE: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.NOSTORE); + break; + case EXCEPTION: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.EXCEPTION); + break; + case TIMEOUT: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.TIMEOUT); + break; + case THROTTLED: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.THROTTLED); + break; + case INFORMATIONAL: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.INFORMATIONAL); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2016may.model.OperationOutcome convertOperationOutcome(org.hl7.fhir.r5.model.OperationOutcome src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/Questionnaire14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/Questionnaire14_50.java index 442fabcf76..35b09d7f2a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/Questionnaire14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/Questionnaire14_50.java @@ -14,11 +14,9 @@ import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.Uri14_50; import org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType; import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.r5.model.CodeType; -import org.hl7.fhir.r5.model.ContactDetail; +import org.hl7.fhir.r5.model.*; import org.hl7.fhir.r5.model.Questionnaire.QuestionnaireAnswerConstraint; import org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemOperator; -import org.hl7.fhir.r5.model.UsageContext; public class Questionnaire14_50 { @@ -225,71 +223,75 @@ public static org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemAnswerOptionC } static public org.hl7.fhir.r5.model.Enumeration convertQuestionnaireItemType(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemTypeEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - tgt.addExtension(VersionConvertorConstants.EXT_QUESTIONNAIRE_ITEM_TYPE_ORIGINAL, new CodeType(src.getValueAsString())); - switch (src.getValue()) { - case GROUP: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.GROUP); - break; - case DISPLAY: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.DISPLAY); - break; - case QUESTION: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.GROUP); - break; - case BOOLEAN: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.BOOLEAN); - break; - case DECIMAL: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.DECIMAL); - break; - case INTEGER: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.INTEGER); - break; - case DATE: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.DATE); - break; - case DATETIME: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.DATETIME); - break; - case INSTANT: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.DATETIME); - break; - case TIME: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.TIME); - break; - case STRING: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.STRING); - break; - case TEXT: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.TEXT); - break; - case URL: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.URL); - break; - case CHOICE: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.CODING); - break; - case OPENCHOICE: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.CODING); - break; - case ATTACHMENT: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.ATTACHMENT); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.REFERENCE); - break; - case QUANTITY: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.QUANTITY); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Questionnaire.QuestionnaireItemTypeEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + tgt.addExtension(VersionConvertorConstants.EXT_QUESTIONNAIRE_ITEM_TYPE_ORIGINAL, new CodeType(src.getValueAsString())); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case GROUP: + tgt.setValue(Questionnaire.QuestionnaireItemType.GROUP); + break; + case DISPLAY: + tgt.setValue(Questionnaire.QuestionnaireItemType.DISPLAY); + break; + case QUESTION: + tgt.setValue(Questionnaire.QuestionnaireItemType.GROUP); + break; + case BOOLEAN: + tgt.setValue(Questionnaire.QuestionnaireItemType.BOOLEAN); + break; + case DECIMAL: + tgt.setValue(Questionnaire.QuestionnaireItemType.DECIMAL); + break; + case INTEGER: + tgt.setValue(Questionnaire.QuestionnaireItemType.INTEGER); + break; + case DATE: + tgt.setValue(Questionnaire.QuestionnaireItemType.DATE); + break; + case DATETIME: + tgt.setValue(Questionnaire.QuestionnaireItemType.DATETIME); + break; + case INSTANT: + tgt.setValue(Questionnaire.QuestionnaireItemType.DATETIME); + break; + case TIME: + tgt.setValue(Questionnaire.QuestionnaireItemType.TIME); + break; + case STRING: + tgt.setValue(Questionnaire.QuestionnaireItemType.STRING); + break; + case TEXT: + tgt.setValue(Questionnaire.QuestionnaireItemType.TEXT); + break; + case URL: + tgt.setValue(Questionnaire.QuestionnaireItemType.URL); + break; + case CHOICE: + tgt.setValue(Questionnaire.QuestionnaireItemType.CODING); + break; + case OPENCHOICE: + tgt.setValue(Questionnaire.QuestionnaireItemType.CODING); + break; + case ATTACHMENT: + tgt.setValue(Questionnaire.QuestionnaireItemType.ATTACHMENT); + break; + case REFERENCE: + tgt.setValue(Questionnaire.QuestionnaireItemType.REFERENCE); + break; + case QUANTITY: + tgt.setValue(Questionnaire.QuestionnaireItemType.QUANTITY); + break; + default: + tgt.setValue(Questionnaire.QuestionnaireItemType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertQuestionnaireItemType(org.hl7.fhir.r5.model.Enumeration src, QuestionnaireAnswerConstraint constraint) throws FHIRException { @@ -300,104 +302,116 @@ static public org.hl7.fhir.dstu2016may.model.Enumeration convertQuestionnaireStatus(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.PublicationStatusEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.DRAFT); - break; - case PUBLISHED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.ACTIVE); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.RETIRED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.PublicationStatusEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(Enumerations.PublicationStatus.DRAFT); + break; + case PUBLISHED: + tgt.setValue(Enumerations.PublicationStatus.ACTIVE); + break; + case RETIRED: + tgt.setValue(Enumerations.PublicationStatus.RETIRED); + break; + default: + tgt.setValue(Enumerations.PublicationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertQuestionnaireStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireStatusEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireStatus.PUBLISHED); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireStatus.RETIRED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireStatusEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireStatus.PUBLISHED); + break; + case RETIRED: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireStatus.RETIRED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/QuestionnaireResponse14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/QuestionnaireResponse14_50.java index 8c861ab968..e2486dd0e2 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/QuestionnaireResponse14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/QuestionnaireResponse14_50.java @@ -5,6 +5,8 @@ import org.hl7.fhir.convertors.conv14_50.datatypes14_50.complextypes14_50.Identifier14_50; import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.DateTime14_50; import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.String14_50; +import org.hl7.fhir.dstu2016may.model.Enumeration; +import org.hl7.fhir.dstu2016may.model.QuestionnaireResponse; import org.hl7.fhir.exceptions.FHIRException; public class QuestionnaireResponse14_50 { @@ -118,46 +120,54 @@ public static org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseI } static public org.hl7.fhir.dstu2016may.model.Enumeration convertQuestionnaireResponseStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.QuestionnaireResponse.QuestionnaireResponseStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED); + break; + case AMENDED: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED); + break; + default: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertQuestionnaireResponseStatus(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED); + break; + case AMENDED: + tgt.setValue(org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/SearchParameter14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/SearchParameter14_50.java index cc50e91fef..1206429f1a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/SearchParameter14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/SearchParameter14_50.java @@ -9,6 +9,7 @@ import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.DateTime14_50; import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.String14_50; import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.Uri14_50; +import org.hl7.fhir.dstu2016may.model.SearchParameter; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.Enumeration; import org.hl7.fhir.r5.model.Enumerations.VersionIndependentResourceTypesAll; @@ -127,53 +128,61 @@ public static org.hl7.fhir.dstu2016may.model.SearchParameter.SearchParameterCont } static public org.hl7.fhir.dstu2016may.model.Enumeration convertXPathUsageType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.SearchParameter.XPathUsageTypeEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case NORMAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.SearchParameter.XPathUsageType.NORMAL); - break; - case PHONETIC: - tgt.setValue(org.hl7.fhir.dstu2016may.model.SearchParameter.XPathUsageType.PHONETIC); - break; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new SearchParameter.XPathUsageTypeEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NORMAL: + tgt.setValue(SearchParameter.XPathUsageType.NORMAL); + break; + case PHONETIC: + tgt.setValue(SearchParameter.XPathUsageType.PHONETIC); + break; - case OTHER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.SearchParameter.XPathUsageType.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.SearchParameter.XPathUsageType.NULL); - break; - } - return tgt; + case OTHER: + tgt.setValue(SearchParameter.XPathUsageType.OTHER); + break; + default: + tgt.setValue(SearchParameter.XPathUsageType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertXPathUsageType(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeTypeEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case NORMAL: - tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.NORMAL); - break; - case PHONETIC: - tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.PHONETIC); - break; - case NEARBY: - tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.OTHER); - break; - case DISTANCE: - tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.OTHER); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeTypeEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NORMAL: + tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.NORMAL); + break; + case PHONETIC: + tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.PHONETIC); + break; + case NEARBY: + tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.OTHER); + break; + case DISTANCE: + tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.OTHER); + break; + case OTHER: + tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.OTHER); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/StructureDefinition14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/StructureDefinition14_50.java index c547f32783..5bdc60b264 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/StructureDefinition14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/StructureDefinition14_50.java @@ -13,58 +13,68 @@ import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.Uri14_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.ElementDefinition; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.StructureDefinition; import org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule; import org.hl7.fhir.utilities.Utilities; public class StructureDefinition14_50 { static public org.hl7.fhir.r5.model.Enumeration convertExtensionContext(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextTypeEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case RESOURCE: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextType.ELEMENT); - break; - case DATATYPE: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextType.ELEMENT); - break; - case EXTENSION: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextType.EXTENSION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureDefinition.ExtensionContextTypeEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case RESOURCE: + tgt.setValue(StructureDefinition.ExtensionContextType.ELEMENT); + break; + case DATATYPE: + tgt.setValue(StructureDefinition.ExtensionContextType.ELEMENT); + break; + case EXTENSION: + tgt.setValue(StructureDefinition.ExtensionContextType.EXTENSION); + break; + default: + tgt.setValue(StructureDefinition.ExtensionContextType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertExtensionContext(org.hl7.fhir.r5.model.Enumeration src, String expression) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContextEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case FHIRPATH: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContext.RESOURCE); - break; - case ELEMENT: - String tn = expression.contains(".") ? expression.substring(0, expression.indexOf(".")) : expression; - if (isResource140(tn)) { - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContext.RESOURCE); - } else { - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContext.DATATYPE); - } - break; - case EXTENSION: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContext.EXTENSION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContext.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContextEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FHIRPATH: + tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContext.RESOURCE); + break; + case ELEMENT: + String tn = expression.contains(".") ? expression.substring(0, expression.indexOf(".")) : expression; + if (isResource140(tn)) { + tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContext.RESOURCE); + } else { + tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContext.DATATYPE); + } + break; + case EXTENSION: + tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContext.EXTENSION); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContext.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2016may.model.StructureDefinition convertStructureDefinition(org.hl7.fhir.r5.model.StructureDefinition src) throws FHIRException { @@ -255,54 +265,62 @@ public static org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionDiffe } static public org.hl7.fhir.dstu2016may.model.Enumeration convertStructureDefinitionKind(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKindEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case PRIMITIVETYPE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKind.DATATYPE); - break; - case COMPLEXTYPE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKind.DATATYPE); - break; - case RESOURCE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKind.RESOURCE); - break; - case LOGICAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKind.LOGICAL); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKindEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRIMITIVETYPE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKind.DATATYPE); + break; + case COMPLEXTYPE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKind.DATATYPE); + break; + case RESOURCE: + tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKind.RESOURCE); + break; + case LOGICAL: + tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKind.LOGICAL); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertStructureDefinitionKind(org.hl7.fhir.dstu2016may.model.Enumeration src, String name) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKindEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case DATATYPE: - if (name.substring(0, 1).toLowerCase().equals(name.substring(0, 1))) { - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind.PRIMITIVETYPE); - } else { - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind.COMPLEXTYPE); - } - break; - case RESOURCE: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind.RESOURCE); - break; - case LOGICAL: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind.LOGICAL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureDefinition.StructureDefinitionKindEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DATATYPE: + if (name.substring(0, 1).toLowerCase().equals(name.substring(0, 1))) { + tgt.setValue(StructureDefinition.StructureDefinitionKind.PRIMITIVETYPE); + } else { + tgt.setValue(StructureDefinition.StructureDefinitionKind.COMPLEXTYPE); + } + break; + case RESOURCE: + tgt.setValue(StructureDefinition.StructureDefinitionKind.RESOURCE); + break; + case LOGICAL: + tgt.setValue(StructureDefinition.StructureDefinitionKind.LOGICAL); + break; + default: + tgt.setValue(StructureDefinition.StructureDefinitionKind.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionMappingComponent convertStructureDefinitionMappingComponent(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionMappingComponent src) throws FHIRException { @@ -358,41 +376,49 @@ public static org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefini } static public org.hl7.fhir.dstu2016may.model.Enumeration convertTypeDerivationRule(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.StructureDefinition.TypeDerivationRuleEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case SPECIALIZATION: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.TypeDerivationRule.SPECIALIZATION); - break; - case CONSTRAINT: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.TypeDerivationRule.CONSTRAINT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.TypeDerivationRule.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.StructureDefinition.TypeDerivationRuleEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SPECIALIZATION: + tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.TypeDerivationRule.SPECIALIZATION); + break; + case CONSTRAINT: + tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.TypeDerivationRule.CONSTRAINT); + break; + default: + tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.TypeDerivationRule.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertTypeDerivationRule(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRuleEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case SPECIALIZATION: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule.SPECIALIZATION); - break; - case CONSTRAINT: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule.CONSTRAINT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureDefinition.TypeDerivationRuleEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SPECIALIZATION: + tgt.setValue(TypeDerivationRule.SPECIALIZATION); + break; + case CONSTRAINT: + tgt.setValue(TypeDerivationRule.CONSTRAINT); + break; + default: + tgt.setValue(TypeDerivationRule.NULL); + break; + } + } + return tgt; } static public boolean isResource140(String tn) { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/StructureMap14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/StructureMap14_50.java index ee7f8a6c03..42807b631c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/StructureMap14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/StructureMap14_50.java @@ -11,6 +11,7 @@ import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.Id14_50; import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.String14_50; import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.Uri14_50; +import org.hl7.fhir.dstu2016may.model.Enumeration; import org.hl7.fhir.dstu2016may.model.StructureMap; import org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapContextType; import org.hl7.fhir.exceptions.FHIRException; @@ -370,79 +371,95 @@ public static org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetPara } static public org.hl7.fhir.dstu2016may.model.Enumeration convertStructureMapInputMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapInputModeEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case SOURCE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapInputMode.SOURCE); - break; - case TARGET: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapInputMode.TARGET); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapInputMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureMap.StructureMapInputModeEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SOURCE: + tgt.setValue(StructureMap.StructureMapInputMode.SOURCE); + break; + case TARGET: + tgt.setValue(StructureMap.StructureMapInputMode.TARGET); + break; + default: + tgt.setValue(StructureMap.StructureMapInputMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertStructureMapInputMode(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureMap.StructureMapInputModeEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case SOURCE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapInputMode.SOURCE); - break; - case TARGET: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapInputMode.TARGET); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapInputMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureMap.StructureMapInputModeEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SOURCE: + tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapInputMode.SOURCE); + break; + case TARGET: + tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapInputMode.TARGET); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapInputMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertStructureMapSourceListMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapListModeEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case FIRST: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapListMode.FIRST); - break; - case LAST: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapListMode.LAST); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapListMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureMap.StructureMapListModeEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FIRST: + tgt.setValue(StructureMap.StructureMapListMode.FIRST); + break; + case LAST: + tgt.setValue(StructureMap.StructureMapListMode.LAST); + break; + default: + tgt.setValue(StructureMap.StructureMapListMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Enumeration convertStructureMapSourceListMode(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListModeEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case FIRST: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListMode.FIRST); - break; - case LAST: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListMode.LAST); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListModeEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FIRST: + tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListMode.FIRST); + break; + case LAST: + tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListMode.LAST); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapStructureComponent convertStructureMapStructureComponent(org.hl7.fhir.r5.model.StructureMap.StructureMapStructureComponent src) throws FHIRException { @@ -474,181 +491,205 @@ public static org.hl7.fhir.r5.model.StructureMap.StructureMapStructureComponent } static public org.hl7.fhir.dstu2016may.model.Enumeration convertStructureMapStructureMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapModelModeEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case PRODUCED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapModelMode.PRODUCED); - break; - case QUERIED: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapModelMode.QUERIED); - break; - case SOURCE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapModelMode.SOURCE); - break; - case TARGET: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapModelMode.TARGET); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapModelMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureMap.StructureMapModelModeEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRODUCED: + tgt.setValue(StructureMap.StructureMapModelMode.PRODUCED); + break; + case QUERIED: + tgt.setValue(StructureMap.StructureMapModelMode.QUERIED); + break; + case SOURCE: + tgt.setValue(StructureMap.StructureMapModelMode.SOURCE); + break; + case TARGET: + tgt.setValue(StructureMap.StructureMapModelMode.TARGET); + break; + default: + tgt.setValue(StructureMap.StructureMapModelMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertStructureMapStructureMode(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureMap.StructureMapModelModeEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case PRODUCED: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapModelMode.PRODUCED); - break; - case QUERIED: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapModelMode.QUERIED); - break; - case SOURCE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapModelMode.SOURCE); - break; - case TARGET: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapModelMode.TARGET); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapModelMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureMap.StructureMapModelModeEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRODUCED: + tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapModelMode.PRODUCED); + break; + case QUERIED: + tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapModelMode.QUERIED); + break; + case SOURCE: + tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapModelMode.SOURCE); + break; + case TARGET: + tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapModelMode.TARGET); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapModelMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertStructureMapTargetListMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapListModeEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case FIRST: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapListMode.FIRST); - break; - case LAST: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapListMode.LAST); - break; - case SHARE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapListMode.SHARE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapListMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureMap.StructureMapListModeEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FIRST: + tgt.setValue(StructureMap.StructureMapListMode.FIRST); + break; + case LAST: + tgt.setValue(StructureMap.StructureMapListMode.LAST); + break; + case SHARE: + tgt.setValue(StructureMap.StructureMapListMode.SHARE); + break; + default: + tgt.setValue(StructureMap.StructureMapListMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Enumeration convertStructureMapTargetListMode(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListModeEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case FIRST: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListMode.FIRST); - break; - case LAST: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListMode.LAST); - break; - case SHARE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListMode.SHARE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListModeEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FIRST: + tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListMode.FIRST); + break; + case LAST: + tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListMode.LAST); + break; + case SHARE: + tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListMode.SHARE); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Enumeration convertStructureMapTransform(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureMap.StructureMapTransformEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case APPEND: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.APPEND); - case CAST: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.CAST); - case COPY: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.COPY); - case CREATE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.CREATE); - case DATEOP: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.DATEOP); - case ESCAPE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.ESCAPE); - case EVALUATE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.EVALUATE); - case POINTER: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.POINTER); - case REFERENCE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.REFERENCE); - case TRANSLATE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.TRANSLATE); - case TRUNCATE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.TRUNCATE); - case UUID: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.UUID); - default: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.NULL); - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureMap.StructureMapTransformEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case APPEND: + tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.APPEND); + case CAST: + tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.CAST); + case COPY: + tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.COPY); + case CREATE: + tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.CREATE); + case DATEOP: + tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.DATEOP); + case ESCAPE: + tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.ESCAPE); + case EVALUATE: + tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.EVALUATE); + case POINTER: + tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.POINTER); + case REFERENCE: + tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.REFERENCE); + case TRANSLATE: + tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.TRANSLATE); + case TRUNCATE: + tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.TRUNCATE); + case UUID: + tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.UUID); + default: + tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.NULL); + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertStructureMapTransform(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapTransformEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case APPEND: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapTransform.APPEND); - break; - case CAST: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapTransform.CAST); - break; - case COPY: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapTransform.COPY); - break; - case CREATE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapTransform.CREATE); - break; - case DATEOP: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapTransform.DATEOP); - break; - case ESCAPE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapTransform.ESCAPE); - break; - case EVALUATE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapTransform.EVALUATE); - break; - case POINTER: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapTransform.POINTER); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapTransform.REFERENCE); - break; - case TRANSLATE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapTransform.TRANSLATE); - break; - case TRUNCATE: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapTransform.TRUNCATE); - break; - case UUID: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapTransform.UUID); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapTransform.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureMap.StructureMapTransformEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case APPEND: + tgt.setValue(StructureMap.StructureMapTransform.APPEND); + break; + case CAST: + tgt.setValue(StructureMap.StructureMapTransform.CAST); + break; + case COPY: + tgt.setValue(StructureMap.StructureMapTransform.COPY); + break; + case CREATE: + tgt.setValue(StructureMap.StructureMapTransform.CREATE); + break; + case DATEOP: + tgt.setValue(StructureMap.StructureMapTransform.DATEOP); + break; + case ESCAPE: + tgt.setValue(StructureMap.StructureMapTransform.ESCAPE); + break; + case EVALUATE: + tgt.setValue(StructureMap.StructureMapTransform.EVALUATE); + break; + case POINTER: + tgt.setValue(StructureMap.StructureMapTransform.POINTER); + break; + case REFERENCE: + tgt.setValue(StructureMap.StructureMapTransform.REFERENCE); + break; + case TRANSLATE: + tgt.setValue(StructureMap.StructureMapTransform.TRANSLATE); + break; + case TRUNCATE: + tgt.setValue(StructureMap.StructureMapTransform.TRUNCATE); + break; + case UUID: + tgt.setValue(StructureMap.StructureMapTransform.UUID); + break; + default: + tgt.setValue(StructureMap.StructureMapTransform.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/ValueSet14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/ValueSet14_50.java index a9c1870974..8f7a675167 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/ValueSet14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/ValueSet14_50.java @@ -11,8 +11,11 @@ import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.Integer14_50; import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.String14_50; import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.Uri14_50; +import org.hl7.fhir.dstu2016may.model.ValueSet; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.BooleanType; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; public class ValueSet14_50 { @@ -133,65 +136,73 @@ public static org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent convertCo } static public org.hl7.fhir.r5.model.Enumeration convertFilterOperator(org.hl7.fhir.dstu2016may.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.FilterOperatorEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case EQUAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.EQUAL); - break; - case ISA: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.ISA); - break; - case ISNOTA: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.ISNOTA); - break; - case REGEX: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.REGEX); - break; - case IN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.NOTIN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.FilterOperatorEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUAL: + tgt.setValue(Enumerations.FilterOperator.EQUAL); + break; + case ISA: + tgt.setValue(Enumerations.FilterOperator.ISA); + break; + case ISNOTA: + tgt.setValue(Enumerations.FilterOperator.ISNOTA); + break; + case REGEX: + tgt.setValue(Enumerations.FilterOperator.REGEX); + break; + case IN: + tgt.setValue(Enumerations.FilterOperator.IN); + break; + case NOTIN: + tgt.setValue(Enumerations.FilterOperator.NOTIN); + break; + default: + tgt.setValue(Enumerations.FilterOperator.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu2016may.model.Enumeration convertFilterOperator(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.ValueSet.FilterOperatorEnumFactory()); - ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); - switch (src.getValue()) { - case EQUAL: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ValueSet.FilterOperator.EQUAL); - break; - case ISA: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ValueSet.FilterOperator.ISA); - break; - case ISNOTA: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ValueSet.FilterOperator.ISNOTA); - break; - case REGEX: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ValueSet.FilterOperator.REGEX); - break; - case IN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ValueSet.FilterOperator.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ValueSet.FilterOperator.NOTIN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu2016may.model.ValueSet.FilterOperator.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu2016may.model.Enumeration tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new ValueSet.FilterOperatorEnumFactory()); + ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUAL: + tgt.setValue(ValueSet.FilterOperator.EQUAL); + break; + case ISA: + tgt.setValue(ValueSet.FilterOperator.ISA); + break; + case ISNOTA: + tgt.setValue(ValueSet.FilterOperator.ISNOTA); + break; + case REGEX: + tgt.setValue(ValueSet.FilterOperator.REGEX); + break; + case IN: + tgt.setValue(ValueSet.FilterOperator.IN); + break; + case NOTIN: + tgt.setValue(ValueSet.FilterOperator.NOTIN); + break; + default: + tgt.setValue(ValueSet.FilterOperator.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.ValueSet convertValueSet(org.hl7.fhir.dstu2016may.model.ValueSet src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/Contributor30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/Contributor30_40.java index 5c40c53779..cf5c99b84f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/Contributor30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/Contributor30_40.java @@ -3,6 +3,7 @@ import org.hl7.fhir.convertors.context.ConversionContext30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Contributor; public class Contributor30_40 { public static org.hl7.fhir.r4.model.Contributor convertContributor(org.hl7.fhir.dstu3.model.Contributor src) throws FHIRException { @@ -32,26 +33,26 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Contributor.ContributorTypeEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Contributor.ContributorType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case AUTHOR: - tgt.setValue(org.hl7.fhir.r4.model.Contributor.ContributorType.AUTHOR); - break; - case EDITOR: - tgt.setValue(org.hl7.fhir.r4.model.Contributor.ContributorType.EDITOR); - break; - case REVIEWER: - tgt.setValue(org.hl7.fhir.r4.model.Contributor.ContributorType.REVIEWER); - break; - case ENDORSER: - tgt.setValue(org.hl7.fhir.r4.model.Contributor.ContributorType.ENDORSER); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Contributor.ContributorType.NULL); - break; - } - } + tgt.setValue(Contributor.ContributorType.AUTHOR); + break; + case EDITOR: + tgt.setValue(Contributor.ContributorType.EDITOR); + break; + case REVIEWER: + tgt.setValue(Contributor.ContributorType.REVIEWER); + break; + case ENDORSER: + tgt.setValue(Contributor.ContributorType.ENDORSER); + break; + default: + tgt.setValue(Contributor.ContributorType.NULL); + break; + } +} return tgt; } @@ -60,26 +61,26 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Contributor.ContributorTypeEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Contributor.ContributorType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case AUTHOR: - tgt.setValue(org.hl7.fhir.dstu3.model.Contributor.ContributorType.AUTHOR); - break; - case EDITOR: - tgt.setValue(org.hl7.fhir.dstu3.model.Contributor.ContributorType.EDITOR); - break; - case REVIEWER: - tgt.setValue(org.hl7.fhir.dstu3.model.Contributor.ContributorType.REVIEWER); - break; - case ENDORSER: - tgt.setValue(org.hl7.fhir.dstu3.model.Contributor.ContributorType.ENDORSER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Contributor.ContributorType.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.Contributor.ContributorType.AUTHOR); + break; + case EDITOR: + tgt.setValue(org.hl7.fhir.dstu3.model.Contributor.ContributorType.EDITOR); + break; + case REVIEWER: + tgt.setValue(org.hl7.fhir.dstu3.model.Contributor.ContributorType.REVIEWER); + break; + case ENDORSER: + tgt.setValue(org.hl7.fhir.dstu3.model.Contributor.ContributorType.ENDORSER); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Contributor.ContributorType.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/ElementDefinition30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/ElementDefinition30_40.java index beb931c19b..f467a0bcac 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/ElementDefinition30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/ElementDefinition30_40.java @@ -134,29 +134,29 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ElementDefinition.PropertyRepresentationEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.PropertyRepresentation.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case XMLATTR: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.PropertyRepresentation.XMLATTR); - break; - case XMLTEXT: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.PropertyRepresentation.XMLTEXT); - break; - case TYPEATTR: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.PropertyRepresentation.TYPEATTR); - break; - case CDATEXT: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.PropertyRepresentation.CDATEXT); - break; - case XHTML: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.PropertyRepresentation.XHTML); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.PropertyRepresentation.NULL); - break; - } - } + tgt.setValue(ElementDefinition.PropertyRepresentation.XMLATTR); + break; + case XMLTEXT: + tgt.setValue(ElementDefinition.PropertyRepresentation.XMLTEXT); + break; + case TYPEATTR: + tgt.setValue(ElementDefinition.PropertyRepresentation.TYPEATTR); + break; + case CDATEXT: + tgt.setValue(ElementDefinition.PropertyRepresentation.CDATEXT); + break; + case XHTML: + tgt.setValue(ElementDefinition.PropertyRepresentation.XHTML); + break; + default: + tgt.setValue(ElementDefinition.PropertyRepresentation.NULL); + break; + } +} return tgt; } @@ -165,29 +165,29 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentationEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case XMLATTR: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation.XMLATTR); - break; - case XMLTEXT: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation.XMLTEXT); - break; - case TYPEATTR: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation.TYPEATTR); - break; - case CDATEXT: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation.CDATEXT); - break; - case XHTML: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation.XHTML); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation.XMLATTR); + break; + case XMLTEXT: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation.XMLTEXT); + break; + case TYPEATTR: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation.TYPEATTR); + break; + case CDATEXT: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation.CDATEXT); + break; + case XHTML: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation.XHTML); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation.NULL); + break; + } +} return tgt; } @@ -220,23 +220,23 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ElementDefinition.SlicingRulesEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.SlicingRules.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CLOSED: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.SlicingRules.CLOSED); - break; - case OPEN: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.SlicingRules.OPEN); - break; - case OPENATEND: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.SlicingRules.OPENATEND); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.SlicingRules.NULL); - break; - } - } + tgt.setValue(ElementDefinition.SlicingRules.CLOSED); + break; + case OPEN: + tgt.setValue(ElementDefinition.SlicingRules.OPEN); + break; + case OPENATEND: + tgt.setValue(ElementDefinition.SlicingRules.OPENATEND); + break; + default: + tgt.setValue(ElementDefinition.SlicingRules.NULL); + break; + } +} return tgt; } @@ -245,23 +245,23 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ElementDefinition.SlicingRulesEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.SlicingRules.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CLOSED: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.SlicingRules.CLOSED); - break; - case OPEN: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.SlicingRules.OPEN); - break; - case OPENATEND: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.SlicingRules.OPENATEND); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.SlicingRules.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.SlicingRules.CLOSED); + break; + case OPEN: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.SlicingRules.OPEN); + break; + case OPENATEND: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.SlicingRules.OPENATEND); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.SlicingRules.NULL); + break; + } +} return tgt; } @@ -288,29 +288,29 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ElementDefinition.DiscriminatorTypeEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.DiscriminatorType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case VALUE: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.DiscriminatorType.VALUE); - break; - case EXISTS: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.DiscriminatorType.EXISTS); - break; - case PATTERN: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.DiscriminatorType.PATTERN); - break; - case TYPE: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.DiscriminatorType.TYPE); - break; - case PROFILE: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.DiscriminatorType.PROFILE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.DiscriminatorType.NULL); - break; - } - } + tgt.setValue(ElementDefinition.DiscriminatorType.VALUE); + break; + case EXISTS: + tgt.setValue(ElementDefinition.DiscriminatorType.EXISTS); + break; + case PATTERN: + tgt.setValue(ElementDefinition.DiscriminatorType.PATTERN); + break; + case TYPE: + tgt.setValue(ElementDefinition.DiscriminatorType.TYPE); + break; + case PROFILE: + tgt.setValue(ElementDefinition.DiscriminatorType.PROFILE); + break; + default: + tgt.setValue(ElementDefinition.DiscriminatorType.NULL); + break; + } +} return tgt; } @@ -319,29 +319,29 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ElementDefinition.DiscriminatorTypeEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.DiscriminatorType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case VALUE: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.DiscriminatorType.VALUE); - break; - case EXISTS: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.DiscriminatorType.EXISTS); - break; - case PATTERN: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.DiscriminatorType.PATTERN); - break; - case TYPE: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.DiscriminatorType.TYPE); - break; - case PROFILE: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.DiscriminatorType.PROFILE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.DiscriminatorType.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.DiscriminatorType.VALUE); + break; + case EXISTS: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.DiscriminatorType.EXISTS); + break; + case PATTERN: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.DiscriminatorType.PATTERN); + break; + case TYPE: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.DiscriminatorType.TYPE); + break; + case PROFILE: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.DiscriminatorType.PROFILE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.DiscriminatorType.NULL); + break; + } +} return tgt; } @@ -422,23 +422,23 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new ElementDefinition.AggregationModeEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(ElementDefinition.AggregationMode.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CONTAINED: - tgt.setValue(ElementDefinition.AggregationMode.CONTAINED); - break; - case REFERENCED: - tgt.setValue(ElementDefinition.AggregationMode.REFERENCED); - break; - case BUNDLED: - tgt.setValue(ElementDefinition.AggregationMode.BUNDLED); - break; - default: - tgt.setValue(ElementDefinition.AggregationMode.NULL); - break; - } - } + tgt.setValue(ElementDefinition.AggregationMode.CONTAINED); + break; + case REFERENCED: + tgt.setValue(ElementDefinition.AggregationMode.REFERENCED); + break; + case BUNDLED: + tgt.setValue(ElementDefinition.AggregationMode.BUNDLED); + break; + default: + tgt.setValue(ElementDefinition.AggregationMode.NULL); + break; + } +} return tgt; } @@ -447,23 +447,23 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ElementDefinition.AggregationModeEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.AggregationMode.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CONTAINED: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.AggregationMode.CONTAINED); - break; - case REFERENCED: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.AggregationMode.REFERENCED); - break; - case BUNDLED: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.AggregationMode.BUNDLED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.AggregationMode.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.AggregationMode.CONTAINED); + break; + case REFERENCED: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.AggregationMode.REFERENCED); + break; + case BUNDLED: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.AggregationMode.BUNDLED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.AggregationMode.NULL); + break; + } +} return tgt; } @@ -472,23 +472,23 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new ElementDefinition.ReferenceVersionRulesEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(ElementDefinition.ReferenceVersionRules.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case EITHER: - tgt.setValue(ElementDefinition.ReferenceVersionRules.EITHER); - break; - case INDEPENDENT: - tgt.setValue(ElementDefinition.ReferenceVersionRules.INDEPENDENT); - break; - case SPECIFIC: - tgt.setValue(ElementDefinition.ReferenceVersionRules.SPECIFIC); - break; - default: - tgt.setValue(ElementDefinition.ReferenceVersionRules.NULL); - break; - } - } + tgt.setValue(ElementDefinition.ReferenceVersionRules.EITHER); + break; + case INDEPENDENT: + tgt.setValue(ElementDefinition.ReferenceVersionRules.INDEPENDENT); + break; + case SPECIFIC: + tgt.setValue(ElementDefinition.ReferenceVersionRules.SPECIFIC); + break; + default: + tgt.setValue(ElementDefinition.ReferenceVersionRules.NULL); + break; + } +} return tgt; } @@ -497,23 +497,23 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ElementDefinition.ReferenceVersionRulesEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.ReferenceVersionRules.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case EITHER: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.ReferenceVersionRules.EITHER); - break; - case INDEPENDENT: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.ReferenceVersionRules.INDEPENDENT); - break; - case SPECIFIC: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.ReferenceVersionRules.SPECIFIC); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.ReferenceVersionRules.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.ReferenceVersionRules.EITHER); + break; + case INDEPENDENT: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.ReferenceVersionRules.INDEPENDENT); + break; + case SPECIFIC: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.ReferenceVersionRules.SPECIFIC); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.ReferenceVersionRules.NULL); + break; + } +} return tgt; } @@ -570,20 +570,20 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new ElementDefinition.ConstraintSeverityEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(ElementDefinition.ConstraintSeverity.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case ERROR: - tgt.setValue(ElementDefinition.ConstraintSeverity.ERROR); - break; - case WARNING: - tgt.setValue(ElementDefinition.ConstraintSeverity.WARNING); - break; - default: - tgt.setValue(ElementDefinition.ConstraintSeverity.NULL); - break; - } - } + tgt.setValue(ElementDefinition.ConstraintSeverity.ERROR); + break; + case WARNING: + tgt.setValue(ElementDefinition.ConstraintSeverity.WARNING); + break; + default: + tgt.setValue(ElementDefinition.ConstraintSeverity.NULL); + break; + } +} return tgt; } @@ -592,20 +592,20 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ElementDefinition.ConstraintSeverityEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.ConstraintSeverity.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case ERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.ConstraintSeverity.ERROR); - break; - case WARNING: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.ConstraintSeverity.WARNING); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.ConstraintSeverity.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.ConstraintSeverity.ERROR); + break; + case WARNING: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.ConstraintSeverity.WARNING); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.ConstraintSeverity.NULL); + break; + } +} return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/Narrative30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/Narrative30_40.java index c0b0777526..fb27924115 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/Narrative30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/Narrative30_40.java @@ -2,6 +2,7 @@ import org.hl7.fhir.convertors.context.ConversionContext30_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Narrative; public class Narrative30_40 { public static org.hl7.fhir.r4.model.Narrative convertNarrative(org.hl7.fhir.dstu3.model.Narrative src) throws FHIRException { @@ -27,26 +28,26 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Narrative.NarrativeStatusEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Narrative.NarrativeStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case GENERATED: - tgt.setValue(org.hl7.fhir.r4.model.Narrative.NarrativeStatus.GENERATED); - break; - case EXTENSIONS: - tgt.setValue(org.hl7.fhir.r4.model.Narrative.NarrativeStatus.EXTENSIONS); - break; - case ADDITIONAL: - tgt.setValue(org.hl7.fhir.r4.model.Narrative.NarrativeStatus.ADDITIONAL); - break; - case EMPTY: - tgt.setValue(org.hl7.fhir.r4.model.Narrative.NarrativeStatus.EMPTY); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Narrative.NarrativeStatus.NULL); - break; - } - } + tgt.setValue(Narrative.NarrativeStatus.GENERATED); + break; + case EXTENSIONS: + tgt.setValue(Narrative.NarrativeStatus.EXTENSIONS); + break; + case ADDITIONAL: + tgt.setValue(Narrative.NarrativeStatus.ADDITIONAL); + break; + case EMPTY: + tgt.setValue(Narrative.NarrativeStatus.EMPTY); + break; + default: + tgt.setValue(Narrative.NarrativeStatus.NULL); + break; + } +} return tgt; } @@ -55,26 +56,26 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Narrative.NarrativeStatusEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case GENERATED: - tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.GENERATED); - break; - case EXTENSIONS: - tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.EXTENSIONS); - break; - case ADDITIONAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.ADDITIONAL); - break; - case EMPTY: - tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.EMPTY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.GENERATED); + break; + case EXTENSIONS: + tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.EXTENSIONS); + break; + case ADDITIONAL: + tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.ADDITIONAL); + break; + case EMPTY: + tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.EMPTY); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/ParameterDefinition30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/ParameterDefinition30_40.java index c242caf2ec..85a80db382 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/ParameterDefinition30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/ParameterDefinition30_40.java @@ -5,6 +5,7 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Integer30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.ParameterDefinition; public class ParameterDefinition30_40 { public static org.hl7.fhir.r4.model.ParameterDefinition convertParameterDefinition(org.hl7.fhir.dstu3.model.ParameterDefinition src) throws FHIRException { @@ -42,20 +43,20 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ParameterDefinition.ParameterUseEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.ParameterDefinition.ParameterUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case IN: - tgt.setValue(org.hl7.fhir.r4.model.ParameterDefinition.ParameterUse.IN); - break; - case OUT: - tgt.setValue(org.hl7.fhir.r4.model.ParameterDefinition.ParameterUse.OUT); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ParameterDefinition.ParameterUse.NULL); - break; - } - } + tgt.setValue(ParameterDefinition.ParameterUse.IN); + break; + case OUT: + tgt.setValue(ParameterDefinition.ParameterUse.OUT); + break; + default: + tgt.setValue(ParameterDefinition.ParameterUse.NULL); + break; + } +} return tgt; } @@ -64,20 +65,20 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ParameterDefinition.ParameterUseEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.ParameterDefinition.ParameterUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case IN: - tgt.setValue(org.hl7.fhir.dstu3.model.ParameterDefinition.ParameterUse.IN); - break; - case OUT: - tgt.setValue(org.hl7.fhir.dstu3.model.ParameterDefinition.ParameterUse.OUT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ParameterDefinition.ParameterUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.ParameterDefinition.ParameterUse.IN); + break; + case OUT: + tgt.setValue(org.hl7.fhir.dstu3.model.ParameterDefinition.ParameterUse.OUT); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.ParameterDefinition.ParameterUse.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/RelatedArtifact30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/RelatedArtifact30_40.java index 820478e03b..1259d135f1 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/RelatedArtifact30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/RelatedArtifact30_40.java @@ -4,6 +4,7 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.Attachment30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.RelatedArtifact; public class RelatedArtifact30_40 { public static org.hl7.fhir.r4.model.RelatedArtifact convertRelatedArtifact(org.hl7.fhir.dstu3.model.RelatedArtifact src) throws FHIRException { @@ -37,38 +38,38 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.RelatedArtifact.RelatedArtifactTypeEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.RelatedArtifact.RelatedArtifactType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case DOCUMENTATION: - tgt.setValue(org.hl7.fhir.r4.model.RelatedArtifact.RelatedArtifactType.DOCUMENTATION); - break; - case JUSTIFICATION: - tgt.setValue(org.hl7.fhir.r4.model.RelatedArtifact.RelatedArtifactType.JUSTIFICATION); - break; - case CITATION: - tgt.setValue(org.hl7.fhir.r4.model.RelatedArtifact.RelatedArtifactType.CITATION); - break; - case PREDECESSOR: - tgt.setValue(org.hl7.fhir.r4.model.RelatedArtifact.RelatedArtifactType.PREDECESSOR); - break; - case SUCCESSOR: - tgt.setValue(org.hl7.fhir.r4.model.RelatedArtifact.RelatedArtifactType.SUCCESSOR); - break; - case DERIVEDFROM: - tgt.setValue(org.hl7.fhir.r4.model.RelatedArtifact.RelatedArtifactType.DERIVEDFROM); - break; - case DEPENDSON: - tgt.setValue(org.hl7.fhir.r4.model.RelatedArtifact.RelatedArtifactType.DEPENDSON); - break; - case COMPOSEDOF: - tgt.setValue(org.hl7.fhir.r4.model.RelatedArtifact.RelatedArtifactType.COMPOSEDOF); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.RelatedArtifact.RelatedArtifactType.NULL); - break; - } - } + tgt.setValue(RelatedArtifact.RelatedArtifactType.DOCUMENTATION); + break; + case JUSTIFICATION: + tgt.setValue(RelatedArtifact.RelatedArtifactType.JUSTIFICATION); + break; + case CITATION: + tgt.setValue(RelatedArtifact.RelatedArtifactType.CITATION); + break; + case PREDECESSOR: + tgt.setValue(RelatedArtifact.RelatedArtifactType.PREDECESSOR); + break; + case SUCCESSOR: + tgt.setValue(RelatedArtifact.RelatedArtifactType.SUCCESSOR); + break; + case DERIVEDFROM: + tgt.setValue(RelatedArtifact.RelatedArtifactType.DERIVEDFROM); + break; + case DEPENDSON: + tgt.setValue(RelatedArtifact.RelatedArtifactType.DEPENDSON); + break; + case COMPOSEDOF: + tgt.setValue(RelatedArtifact.RelatedArtifactType.COMPOSEDOF); + break; + default: + tgt.setValue(RelatedArtifact.RelatedArtifactType.NULL); + break; + } +} return tgt; } @@ -77,38 +78,38 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.RelatedArtifact.RelatedArtifactTypeEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.RelatedArtifact.RelatedArtifactType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case DOCUMENTATION: - tgt.setValue(org.hl7.fhir.dstu3.model.RelatedArtifact.RelatedArtifactType.DOCUMENTATION); - break; - case JUSTIFICATION: - tgt.setValue(org.hl7.fhir.dstu3.model.RelatedArtifact.RelatedArtifactType.JUSTIFICATION); - break; - case CITATION: - tgt.setValue(org.hl7.fhir.dstu3.model.RelatedArtifact.RelatedArtifactType.CITATION); - break; - case PREDECESSOR: - tgt.setValue(org.hl7.fhir.dstu3.model.RelatedArtifact.RelatedArtifactType.PREDECESSOR); - break; - case SUCCESSOR: - tgt.setValue(org.hl7.fhir.dstu3.model.RelatedArtifact.RelatedArtifactType.SUCCESSOR); - break; - case DERIVEDFROM: - tgt.setValue(org.hl7.fhir.dstu3.model.RelatedArtifact.RelatedArtifactType.DERIVEDFROM); - break; - case DEPENDSON: - tgt.setValue(org.hl7.fhir.dstu3.model.RelatedArtifact.RelatedArtifactType.DEPENDSON); - break; - case COMPOSEDOF: - tgt.setValue(org.hl7.fhir.dstu3.model.RelatedArtifact.RelatedArtifactType.COMPOSEDOF); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.RelatedArtifact.RelatedArtifactType.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.RelatedArtifact.RelatedArtifactType.DOCUMENTATION); + break; + case JUSTIFICATION: + tgt.setValue(org.hl7.fhir.dstu3.model.RelatedArtifact.RelatedArtifactType.JUSTIFICATION); + break; + case CITATION: + tgt.setValue(org.hl7.fhir.dstu3.model.RelatedArtifact.RelatedArtifactType.CITATION); + break; + case PREDECESSOR: + tgt.setValue(org.hl7.fhir.dstu3.model.RelatedArtifact.RelatedArtifactType.PREDECESSOR); + break; + case SUCCESSOR: + tgt.setValue(org.hl7.fhir.dstu3.model.RelatedArtifact.RelatedArtifactType.SUCCESSOR); + break; + case DERIVEDFROM: + tgt.setValue(org.hl7.fhir.dstu3.model.RelatedArtifact.RelatedArtifactType.DERIVEDFROM); + break; + case DEPENDSON: + tgt.setValue(org.hl7.fhir.dstu3.model.RelatedArtifact.RelatedArtifactType.DEPENDSON); + break; + case COMPOSEDOF: + tgt.setValue(org.hl7.fhir.dstu3.model.RelatedArtifact.RelatedArtifactType.COMPOSEDOF); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.RelatedArtifact.RelatedArtifactType.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/TriggerDefinition30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/TriggerDefinition30_40.java index d00f21a749..aed23847ad 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/TriggerDefinition30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/TriggerDefinition30_40.java @@ -6,6 +6,7 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Code30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.TriggerDefinition; import org.hl7.fhir.r4.model.Type; public class TriggerDefinition30_40 { @@ -121,35 +122,35 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TriggerDefinition.TriggerTypeEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.TriggerDefinition.TriggerType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case NAMEDEVENT: - tgt.setValue(org.hl7.fhir.r4.model.TriggerDefinition.TriggerType.NAMEDEVENT); - break; - case PERIODIC: - tgt.setValue(org.hl7.fhir.r4.model.TriggerDefinition.TriggerType.PERIODIC); - break; - case DATAADDED: - tgt.setValue(org.hl7.fhir.r4.model.TriggerDefinition.TriggerType.DATAADDED); - break; - case DATAMODIFIED: - tgt.setValue(org.hl7.fhir.r4.model.TriggerDefinition.TriggerType.DATAMODIFIED); - break; - case DATAREMOVED: - tgt.setValue(org.hl7.fhir.r4.model.TriggerDefinition.TriggerType.DATAREMOVED); - break; - case DATAACCESSED: - tgt.setValue(org.hl7.fhir.r4.model.TriggerDefinition.TriggerType.DATAACCESSED); - break; - case DATAACCESSENDED: - tgt.setValue(org.hl7.fhir.r4.model.TriggerDefinition.TriggerType.DATAACCESSENDED); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.TriggerDefinition.TriggerType.NULL); - break; - } - } + tgt.setValue(TriggerDefinition.TriggerType.NAMEDEVENT); + break; + case PERIODIC: + tgt.setValue(TriggerDefinition.TriggerType.PERIODIC); + break; + case DATAADDED: + tgt.setValue(TriggerDefinition.TriggerType.DATAADDED); + break; + case DATAMODIFIED: + tgt.setValue(TriggerDefinition.TriggerType.DATAMODIFIED); + break; + case DATAREMOVED: + tgt.setValue(TriggerDefinition.TriggerType.DATAREMOVED); + break; + case DATAACCESSED: + tgt.setValue(TriggerDefinition.TriggerType.DATAACCESSED); + break; + case DATAACCESSENDED: + tgt.setValue(TriggerDefinition.TriggerType.DATAACCESSENDED); + break; + default: + tgt.setValue(TriggerDefinition.TriggerType.NULL); + break; + } +} return tgt; } @@ -158,35 +159,35 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TriggerDefinition.TriggerTypeEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.TriggerDefinition.TriggerType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case NAMEDEVENT: - tgt.setValue(org.hl7.fhir.dstu3.model.TriggerDefinition.TriggerType.NAMEDEVENT); - break; - case PERIODIC: - tgt.setValue(org.hl7.fhir.dstu3.model.TriggerDefinition.TriggerType.PERIODIC); - break; - case DATAADDED: - tgt.setValue(org.hl7.fhir.dstu3.model.TriggerDefinition.TriggerType.DATAADDED); - break; - case DATAMODIFIED: - tgt.setValue(org.hl7.fhir.dstu3.model.TriggerDefinition.TriggerType.DATAMODIFIED); - break; - case DATAREMOVED: - tgt.setValue(org.hl7.fhir.dstu3.model.TriggerDefinition.TriggerType.DATAREMOVED); - break; - case DATAACCESSED: - tgt.setValue(org.hl7.fhir.dstu3.model.TriggerDefinition.TriggerType.DATAACCESSED); - break; - case DATAACCESSENDED: - tgt.setValue(org.hl7.fhir.dstu3.model.TriggerDefinition.TriggerType.DATAACCESSENDED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.TriggerDefinition.TriggerType.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.TriggerDefinition.TriggerType.NAMEDEVENT); + break; + case PERIODIC: + tgt.setValue(org.hl7.fhir.dstu3.model.TriggerDefinition.TriggerType.PERIODIC); + break; + case DATAADDED: + tgt.setValue(org.hl7.fhir.dstu3.model.TriggerDefinition.TriggerType.DATAADDED); + break; + case DATAMODIFIED: + tgt.setValue(org.hl7.fhir.dstu3.model.TriggerDefinition.TriggerType.DATAMODIFIED); + break; + case DATAREMOVED: + tgt.setValue(org.hl7.fhir.dstu3.model.TriggerDefinition.TriggerType.DATAREMOVED); + break; + case DATAACCESSED: + tgt.setValue(org.hl7.fhir.dstu3.model.TriggerDefinition.TriggerType.DATAACCESSED); + break; + case DATAACCESSENDED: + tgt.setValue(org.hl7.fhir.dstu3.model.TriggerDefinition.TriggerType.DATAACCESSENDED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.TriggerDefinition.TriggerType.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/complextypes30_40/Address30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/complextypes30_40/Address30_40.java index 065d4d65c7..2d6a980b26 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/complextypes30_40/Address30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/complextypes30_40/Address30_40.java @@ -3,6 +3,7 @@ import org.hl7.fhir.convertors.context.ConversionContext30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Address; public class Address30_40 { public static org.hl7.fhir.r4.model.Address convertAddress(org.hl7.fhir.dstu3.model.Address src) throws FHIRException { @@ -44,26 +45,26 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Address.AddressUseEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HOME: - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressUse.HOME); - break; - case WORK: - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressUse.WORK); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressUse.OLD); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressUse.NULL); - break; - } - } + tgt.setValue(Address.AddressUse.HOME); + break; + case WORK: + tgt.setValue(Address.AddressUse.WORK); + break; + case TEMP: + tgt.setValue(Address.AddressUse.TEMP); + break; + case OLD: + tgt.setValue(Address.AddressUse.OLD); + break; + default: + tgt.setValue(Address.AddressUse.NULL); + break; + } +} return tgt; } @@ -72,26 +73,26 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Address.AddressUseEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HOME: - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.HOME); - break; - case WORK: - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.WORK); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.OLD); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.HOME); + break; + case WORK: + tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.WORK); + break; + case TEMP: + tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.TEMP); + break; + case OLD: + tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.OLD); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.NULL); + break; + } +} return tgt; } @@ -100,23 +101,23 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Address.AddressTypeEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case POSTAL: - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressType.POSTAL); - break; - case PHYSICAL: - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressType.PHYSICAL); - break; - case BOTH: - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressType.BOTH); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressType.NULL); - break; - } - } + tgt.setValue(Address.AddressType.POSTAL); + break; + case PHYSICAL: + tgt.setValue(Address.AddressType.PHYSICAL); + break; + case BOTH: + tgt.setValue(Address.AddressType.BOTH); + break; + default: + tgt.setValue(Address.AddressType.NULL); + break; + } +} return tgt; } @@ -125,23 +126,23 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Address.AddressTypeEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case POSTAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressType.POSTAL); - break; - case PHYSICAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressType.PHYSICAL); - break; - case BOTH: - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressType.BOTH); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressType.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressType.POSTAL); + break; + case PHYSICAL: + tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressType.PHYSICAL); + break; + case BOTH: + tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressType.BOTH); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressType.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/complextypes30_40/ContactPoint30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/complextypes30_40/ContactPoint30_40.java index efe337fc3b..98cd6587f8 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/complextypes30_40/ContactPoint30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/complextypes30_40/ContactPoint30_40.java @@ -4,6 +4,7 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.PositiveInt30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.ContactPoint; public class ContactPoint30_40 { public static org.hl7.fhir.r4.model.ContactPoint convertContactPoint(org.hl7.fhir.dstu3.model.ContactPoint src) throws FHIRException { @@ -35,35 +36,35 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ContactPoint.ContactPointSystemEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case PHONE: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem.PHONE); - break; - case FAX: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem.FAX); - break; - case EMAIL: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem.EMAIL); - break; - case PAGER: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem.PAGER); - break; - case URL: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem.URL); - break; - case SMS: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem.SMS); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem.NULL); - break; - } - } + tgt.setValue(ContactPoint.ContactPointSystem.PHONE); + break; + case FAX: + tgt.setValue(ContactPoint.ContactPointSystem.FAX); + break; + case EMAIL: + tgt.setValue(ContactPoint.ContactPointSystem.EMAIL); + break; + case PAGER: + tgt.setValue(ContactPoint.ContactPointSystem.PAGER); + break; + case URL: + tgt.setValue(ContactPoint.ContactPointSystem.URL); + break; + case SMS: + tgt.setValue(ContactPoint.ContactPointSystem.SMS); + break; + case OTHER: + tgt.setValue(ContactPoint.ContactPointSystem.OTHER); + break; + default: + tgt.setValue(ContactPoint.ContactPointSystem.NULL); + break; + } +} return tgt; } @@ -72,35 +73,35 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystemEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case PHONE: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.PHONE); - break; - case FAX: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.FAX); - break; - case EMAIL: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.EMAIL); - break; - case PAGER: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.PAGER); - break; - case URL: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.URL); - break; - case SMS: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.SMS); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.PHONE); + break; + case FAX: + tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.FAX); + break; + case EMAIL: + tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.EMAIL); + break; + case PAGER: + tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.PAGER); + break; + case URL: + tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.URL); + break; + case SMS: + tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.SMS); + break; + case OTHER: + tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.OTHER); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.NULL); + break; + } +} return tgt; } @@ -109,29 +110,29 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ContactPoint.ContactPointUseEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HOME: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointUse.HOME); - break; - case WORK: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointUse.WORK); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointUse.OLD); - break; - case MOBILE: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointUse.MOBILE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointUse.NULL); - break; - } - } + tgt.setValue(ContactPoint.ContactPointUse.HOME); + break; + case WORK: + tgt.setValue(ContactPoint.ContactPointUse.WORK); + break; + case TEMP: + tgt.setValue(ContactPoint.ContactPointUse.TEMP); + break; + case OLD: + tgt.setValue(ContactPoint.ContactPointUse.OLD); + break; + case MOBILE: + tgt.setValue(ContactPoint.ContactPointUse.MOBILE); + break; + default: + tgt.setValue(ContactPoint.ContactPointUse.NULL); + break; + } +} return tgt; } @@ -140,29 +141,29 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUseEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HOME: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.HOME); - break; - case WORK: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.WORK); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.OLD); - break; - case MOBILE: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.MOBILE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.HOME); + break; + case WORK: + tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.WORK); + break; + case TEMP: + tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.TEMP); + break; + case OLD: + tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.OLD); + break; + case MOBILE: + tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.MOBILE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/complextypes30_40/HumanName30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/complextypes30_40/HumanName30_40.java index 51f9702b51..2892090c01 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/complextypes30_40/HumanName30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/complextypes30_40/HumanName30_40.java @@ -3,6 +3,7 @@ import org.hl7.fhir.convertors.context.ConversionContext30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.HumanName; public class HumanName30_40 { public static org.hl7.fhir.r4.model.HumanName convertHumanName(org.hl7.fhir.dstu3.model.HumanName src) throws FHIRException { @@ -38,35 +39,35 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.HumanName.NameUseEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case USUAL: - tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.USUAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.OFFICIAL); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.TEMP); - break; - case NICKNAME: - tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.NICKNAME); - break; - case ANONYMOUS: - tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.ANONYMOUS); - break; - case OLD: - tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.OLD); - break; - case MAIDEN: - tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.MAIDEN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.NULL); - break; - } - } + tgt.setValue(HumanName.NameUse.USUAL); + break; + case OFFICIAL: + tgt.setValue(HumanName.NameUse.OFFICIAL); + break; + case TEMP: + tgt.setValue(HumanName.NameUse.TEMP); + break; + case NICKNAME: + tgt.setValue(HumanName.NameUse.NICKNAME); + break; + case ANONYMOUS: + tgt.setValue(HumanName.NameUse.ANONYMOUS); + break; + case OLD: + tgt.setValue(HumanName.NameUse.OLD); + break; + case MAIDEN: + tgt.setValue(HumanName.NameUse.MAIDEN); + break; + default: + tgt.setValue(HumanName.NameUse.NULL); + break; + } +} return tgt; } @@ -75,35 +76,35 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.HumanName.NameUseEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case USUAL: - tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.USUAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.OFFICIAL); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.TEMP); - break; - case NICKNAME: - tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.NICKNAME); - break; - case ANONYMOUS: - tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.ANONYMOUS); - break; - case OLD: - tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.OLD); - break; - case MAIDEN: - tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.MAIDEN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.USUAL); + break; + case OFFICIAL: + tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.OFFICIAL); + break; + case TEMP: + tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.TEMP); + break; + case NICKNAME: + tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.NICKNAME); + break; + case ANONYMOUS: + tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.ANONYMOUS); + break; + case OLD: + tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.OLD); + break; + case MAIDEN: + tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.MAIDEN); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/complextypes30_40/Identifier30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/complextypes30_40/Identifier30_40.java index c99afbf2c4..dcb440a425 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/complextypes30_40/Identifier30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/complextypes30_40/Identifier30_40.java @@ -5,6 +5,7 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Uri30_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Identifier; public class Identifier30_40 { public static org.hl7.fhir.r4.model.Identifier convertIdentifier(org.hl7.fhir.dstu3.model.Identifier src) throws FHIRException { @@ -38,26 +39,26 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Identifier.IdentifierUseEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Identifier.IdentifierUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case USUAL: - tgt.setValue(org.hl7.fhir.r4.model.Identifier.IdentifierUse.USUAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.r4.model.Identifier.IdentifierUse.OFFICIAL); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.r4.model.Identifier.IdentifierUse.TEMP); - break; - case SECONDARY: - tgt.setValue(org.hl7.fhir.r4.model.Identifier.IdentifierUse.SECONDARY); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Identifier.IdentifierUse.NULL); - break; - } - } + tgt.setValue(Identifier.IdentifierUse.USUAL); + break; + case OFFICIAL: + tgt.setValue(Identifier.IdentifierUse.OFFICIAL); + break; + case TEMP: + tgt.setValue(Identifier.IdentifierUse.TEMP); + break; + case SECONDARY: + tgt.setValue(Identifier.IdentifierUse.SECONDARY); + break; + default: + tgt.setValue(Identifier.IdentifierUse.NULL); + break; + } +} return tgt; } @@ -66,29 +67,29 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Identifier.IdentifierUseEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case USUAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.USUAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.OFFICIAL); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.SECONDARY); - break; - case SECONDARY: - tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.SECONDARY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.USUAL); + break; + case OFFICIAL: + tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.OFFICIAL); + break; + case TEMP: + tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.TEMP); + break; + case OLD: + tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.SECONDARY); + break; + case SECONDARY: + tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.SECONDARY); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/complextypes30_40/Quantity30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/complextypes30_40/Quantity30_40.java index edffc8a838..16f8e122b9 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/complextypes30_40/Quantity30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/complextypes30_40/Quantity30_40.java @@ -6,6 +6,7 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Uri30_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Quantity; public class Quantity30_40 { public static void copyQuantity(org.hl7.fhir.dstu3.model.Quantity src, org.hl7.fhir.r4.model.Quantity tgt) throws FHIRException { @@ -57,26 +58,26 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Quantity.QuantityComparatorEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Quantity.QuantityComparator.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case LESS_THAN: - tgt.setValue(org.hl7.fhir.r4.model.Quantity.QuantityComparator.LESS_THAN); - break; - case LESS_OR_EQUAL: - tgt.setValue(org.hl7.fhir.r4.model.Quantity.QuantityComparator.LESS_OR_EQUAL); - break; - case GREATER_OR_EQUAL: - tgt.setValue(org.hl7.fhir.r4.model.Quantity.QuantityComparator.GREATER_OR_EQUAL); - break; - case GREATER_THAN: - tgt.setValue(org.hl7.fhir.r4.model.Quantity.QuantityComparator.GREATER_THAN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Quantity.QuantityComparator.NULL); - break; - } - } + tgt.setValue(Quantity.QuantityComparator.LESS_THAN); + break; + case LESS_OR_EQUAL: + tgt.setValue(Quantity.QuantityComparator.LESS_OR_EQUAL); + break; + case GREATER_OR_EQUAL: + tgt.setValue(Quantity.QuantityComparator.GREATER_OR_EQUAL); + break; + case GREATER_THAN: + tgt.setValue(Quantity.QuantityComparator.GREATER_THAN); + break; + default: + tgt.setValue(Quantity.QuantityComparator.NULL); + break; + } +} return tgt; } @@ -85,26 +86,26 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Quantity.QuantityComparatorEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Quantity.QuantityComparator.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case LESS_THAN: - tgt.setValue(org.hl7.fhir.dstu3.model.Quantity.QuantityComparator.LESS_THAN); - break; - case LESS_OR_EQUAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Quantity.QuantityComparator.LESS_OR_EQUAL); - break; - case GREATER_OR_EQUAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Quantity.QuantityComparator.GREATER_OR_EQUAL); - break; - case GREATER_THAN: - tgt.setValue(org.hl7.fhir.dstu3.model.Quantity.QuantityComparator.GREATER_THAN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Quantity.QuantityComparator.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.Quantity.QuantityComparator.LESS_THAN); + break; + case LESS_OR_EQUAL: + tgt.setValue(org.hl7.fhir.dstu3.model.Quantity.QuantityComparator.LESS_OR_EQUAL); + break; + case GREATER_OR_EQUAL: + tgt.setValue(org.hl7.fhir.dstu3.model.Quantity.QuantityComparator.GREATER_OR_EQUAL); + break; + case GREATER_THAN: + tgt.setValue(org.hl7.fhir.dstu3.model.Quantity.QuantityComparator.GREATER_THAN); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Quantity.QuantityComparator.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/complextypes30_40/Timing30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/complextypes30_40/Timing30_40.java index 241191ae24..3a3d1795b8 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/complextypes30_40/Timing30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/complextypes30_40/Timing30_40.java @@ -6,6 +6,7 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Decimal30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.UnsignedInt30_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Timing; public class Timing30_40 { public static org.hl7.fhir.r4.model.Timing convertTiming(org.hl7.fhir.dstu3.model.Timing src) throws FHIRException { @@ -83,71 +84,71 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Timing.EventTimingEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case MORN: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.MORN); - break; - case AFT: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.AFT); - break; - case EVE: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.EVE); - break; - case NIGHT: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.NIGHT); - break; - case PHS: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.PHS); - break; - case HS: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.HS); - break; - case WAKE: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.WAKE); - break; - case C: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.C); - break; - case CM: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.CM); - break; - case CD: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.CD); - break; - case CV: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.CV); - break; - case AC: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.AC); - break; - case ACM: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.ACM); - break; - case ACD: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.ACD); - break; - case ACV: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.ACV); - break; - case PC: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.PC); - break; - case PCM: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.PCM); - break; - case PCD: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.PCD); - break; - case PCV: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.PCV); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.NULL); - break; - } - } + tgt.setValue(Timing.EventTiming.MORN); + break; + case AFT: + tgt.setValue(Timing.EventTiming.AFT); + break; + case EVE: + tgt.setValue(Timing.EventTiming.EVE); + break; + case NIGHT: + tgt.setValue(Timing.EventTiming.NIGHT); + break; + case PHS: + tgt.setValue(Timing.EventTiming.PHS); + break; + case HS: + tgt.setValue(Timing.EventTiming.HS); + break; + case WAKE: + tgt.setValue(Timing.EventTiming.WAKE); + break; + case C: + tgt.setValue(Timing.EventTiming.C); + break; + case CM: + tgt.setValue(Timing.EventTiming.CM); + break; + case CD: + tgt.setValue(Timing.EventTiming.CD); + break; + case CV: + tgt.setValue(Timing.EventTiming.CV); + break; + case AC: + tgt.setValue(Timing.EventTiming.AC); + break; + case ACM: + tgt.setValue(Timing.EventTiming.ACM); + break; + case ACD: + tgt.setValue(Timing.EventTiming.ACD); + break; + case ACV: + tgt.setValue(Timing.EventTiming.ACV); + break; + case PC: + tgt.setValue(Timing.EventTiming.PC); + break; + case PCM: + tgt.setValue(Timing.EventTiming.PCM); + break; + case PCD: + tgt.setValue(Timing.EventTiming.PCD); + break; + case PCV: + tgt.setValue(Timing.EventTiming.PCV); + break; + default: + tgt.setValue(Timing.EventTiming.NULL); + break; + } +} return tgt; } @@ -156,71 +157,71 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Timing.EventTimingEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case MORN: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.MORN); - break; - case AFT: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.AFT); - break; - case EVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.EVE); - break; - case NIGHT: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.NIGHT); - break; - case PHS: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.PHS); - break; - case HS: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.HS); - break; - case WAKE: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.WAKE); - break; - case C: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.C); - break; - case CM: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.CM); - break; - case CD: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.CD); - break; - case CV: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.CV); - break; - case AC: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.AC); - break; - case ACM: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.ACM); - break; - case ACD: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.ACD); - break; - case ACV: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.ACV); - break; - case PC: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.PC); - break; - case PCM: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.PCM); - break; - case PCD: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.PCD); - break; - case PCV: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.PCV); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.MORN); + break; + case AFT: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.AFT); + break; + case EVE: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.EVE); + break; + case NIGHT: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.NIGHT); + break; + case PHS: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.PHS); + break; + case HS: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.HS); + break; + case WAKE: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.WAKE); + break; + case C: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.C); + break; + case CM: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.CM); + break; + case CD: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.CD); + break; + case CV: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.CV); + break; + case AC: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.AC); + break; + case ACM: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.ACM); + break; + case ACD: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.ACD); + break; + case ACV: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.ACV); + break; + case PC: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.PC); + break; + case PCM: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.PCM); + break; + case PCD: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.PCD); + break; + case PCV: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.PCV); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.NULL); + break; + } +} return tgt; } @@ -249,35 +250,35 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Timing.DayOfWeekEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.DayOfWeek.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case MON: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.DayOfWeek.MON); - break; - case TUE: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.DayOfWeek.TUE); - break; - case WED: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.DayOfWeek.WED); - break; - case THU: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.DayOfWeek.THU); - break; - case FRI: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.DayOfWeek.FRI); - break; - case SAT: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.DayOfWeek.SAT); - break; - case SUN: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.DayOfWeek.SUN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.DayOfWeek.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.DayOfWeek.MON); + break; + case TUE: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.DayOfWeek.TUE); + break; + case WED: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.DayOfWeek.WED); + break; + case THU: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.DayOfWeek.THU); + break; + case FRI: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.DayOfWeek.FRI); + break; + case SAT: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.DayOfWeek.SAT); + break; + case SUN: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.DayOfWeek.SUN); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.DayOfWeek.NULL); + break; + } +} return tgt; } @@ -286,35 +287,35 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Timing.UnitsOfTimeEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case S: - tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.S); - break; - case MIN: - tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.MIN); - break; - case H: - tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.H); - break; - case D: - tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.D); - break; - case WK: - tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.WK); - break; - case MO: - tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.MO); - break; - case A: - tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.A); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.NULL); - break; - } - } + tgt.setValue(Timing.UnitsOfTime.S); + break; + case MIN: + tgt.setValue(Timing.UnitsOfTime.MIN); + break; + case H: + tgt.setValue(Timing.UnitsOfTime.H); + break; + case D: + tgt.setValue(Timing.UnitsOfTime.D); + break; + case WK: + tgt.setValue(Timing.UnitsOfTime.WK); + break; + case MO: + tgt.setValue(Timing.UnitsOfTime.MO); + break; + case A: + tgt.setValue(Timing.UnitsOfTime.A); + break; + default: + tgt.setValue(Timing.UnitsOfTime.NULL); + break; + } +} return tgt; } @@ -323,35 +324,35 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Timing.UnitsOfTimeEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case S: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.S); - break; - case MIN: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.MIN); - break; - case H: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.H); - break; - case D: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.D); - break; - case WK: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.WK); - break; - case MO: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.MO); - break; - case A: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.A); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.S); + break; + case MIN: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.MIN); + break; + case H: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.H); + break; + case D: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.D); + break; + case WK: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.WK); + break; + case MO: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.MO); + break; + case A: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.A); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.NULL); + break; + } +} return tgt; } @@ -360,35 +361,35 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Timing.DayOfWeekEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Timing.DayOfWeek.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case MON: - tgt.setValue(org.hl7.fhir.r4.model.Timing.DayOfWeek.MON); - break; - case TUE: - tgt.setValue(org.hl7.fhir.r4.model.Timing.DayOfWeek.TUE); - break; - case WED: - tgt.setValue(org.hl7.fhir.r4.model.Timing.DayOfWeek.WED); - break; - case THU: - tgt.setValue(org.hl7.fhir.r4.model.Timing.DayOfWeek.THU); - break; - case FRI: - tgt.setValue(org.hl7.fhir.r4.model.Timing.DayOfWeek.FRI); - break; - case SAT: - tgt.setValue(org.hl7.fhir.r4.model.Timing.DayOfWeek.SAT); - break; - case SUN: - tgt.setValue(org.hl7.fhir.r4.model.Timing.DayOfWeek.SUN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Timing.DayOfWeek.NULL); - break; - } - } + tgt.setValue(Timing.DayOfWeek.MON); + break; + case TUE: + tgt.setValue(Timing.DayOfWeek.TUE); + break; + case WED: + tgt.setValue(Timing.DayOfWeek.WED); + break; + case THU: + tgt.setValue(Timing.DayOfWeek.THU); + break; + case FRI: + tgt.setValue(Timing.DayOfWeek.FRI); + break; + case SAT: + tgt.setValue(Timing.DayOfWeek.SAT); + break; + case SUN: + tgt.setValue(Timing.DayOfWeek.SUN); + break; + default: + tgt.setValue(Timing.DayOfWeek.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Account30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Account30_40.java index 6a87619574..83d94b785d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Account30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Account30_40.java @@ -10,6 +10,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.PositiveInt30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Account; +import org.hl7.fhir.r4.model.Enumeration; /* Copyright (c) 2011+, HL7, Inc. @@ -101,53 +103,61 @@ public static org.hl7.fhir.dstu3.model.Account convertAccount(org.hl7.fhir.r4.mo } static public org.hl7.fhir.r4.model.Enumeration convertAccountStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Account.AccountStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Account.AccountStatus.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Account.AccountStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Account.AccountStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Account.AccountStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Account.AccountStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Account.AccountStatus.ACTIVE); + break; + case INACTIVE: + tgt.setValue(Account.AccountStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(Account.AccountStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Account.AccountStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertAccountStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Account.AccountStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Account.AccountStatus.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Account.AccountStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Account.AccountStatus.ENTEREDINERROR); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.dstu3.model.Account.AccountStatus.ACTIVE); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu3.model.Account.AccountStatus.ACTIVE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Account.AccountStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Account.AccountStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu3.model.Account.AccountStatus.ACTIVE); + break; + case INACTIVE: + tgt.setValue(org.hl7.fhir.dstu3.model.Account.AccountStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu3.model.Account.AccountStatus.ENTEREDINERROR); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.dstu3.model.Account.AccountStatus.ACTIVE); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.dstu3.model.Account.AccountStatus.ACTIVE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Account.AccountStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r4.model.Account.CoverageComponent convertCoverageComponent(org.hl7.fhir.dstu3.model.Account.CoverageComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/ActivityDefinition30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/ActivityDefinition30_40.java index 3ff0b6c01f..f5f02b6210 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/ActivityDefinition30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/ActivityDefinition30_40.java @@ -19,6 +19,8 @@ import org.hl7.fhir.dstu3.model.ContactDetail; import org.hl7.fhir.dstu3.model.Contributor.ContributorType; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.ActivityDefinition; +import org.hl7.fhir.r4.model.Enumeration; public class ActivityDefinition30_40 { @@ -235,122 +237,130 @@ public static org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionDyna } static public org.hl7.fhir.r4.model.Enumeration convertActivityDefinitionKind(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKindEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case APPOINTMENT: - tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.APPOINTMENT); - break; - case APPOINTMENTRESPONSE: - tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.APPOINTMENTRESPONSE); - break; - case CAREPLAN: - tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.CAREPLAN); - break; - case CLAIM: - tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.CLAIM); - break; - case COMMUNICATIONREQUEST: - tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.COMMUNICATIONREQUEST); - break; - case CONTRACT: - tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.CONTRACT); - break; - case DEVICEREQUEST: - tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.DEVICEREQUEST); - break; - case ENROLLMENTREQUEST: - tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.ENROLLMENTREQUEST); - break; - case IMMUNIZATIONRECOMMENDATION: - tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.IMMUNIZATIONRECOMMENDATION); - break; - case MEDICATIONREQUEST: - tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.MEDICATIONREQUEST); - break; - case NUTRITIONORDER: - tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.NUTRITIONORDER); - break; - case PROCEDUREREQUEST: - tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.SERVICEREQUEST); - break; - case REFERRALREQUEST: - tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.SERVICEREQUEST); - break; - case SUPPLYREQUEST: - tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.SUPPLYREQUEST); - break; - case TASK: - tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.TASK); - break; - case VISIONPRESCRIPTION: - tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.VISIONPRESCRIPTION); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ActivityDefinition.ActivityDefinitionKindEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case APPOINTMENT: + tgt.setValue(ActivityDefinition.ActivityDefinitionKind.APPOINTMENT); + break; + case APPOINTMENTRESPONSE: + tgt.setValue(ActivityDefinition.ActivityDefinitionKind.APPOINTMENTRESPONSE); + break; + case CAREPLAN: + tgt.setValue(ActivityDefinition.ActivityDefinitionKind.CAREPLAN); + break; + case CLAIM: + tgt.setValue(ActivityDefinition.ActivityDefinitionKind.CLAIM); + break; + case COMMUNICATIONREQUEST: + tgt.setValue(ActivityDefinition.ActivityDefinitionKind.COMMUNICATIONREQUEST); + break; + case CONTRACT: + tgt.setValue(ActivityDefinition.ActivityDefinitionKind.CONTRACT); + break; + case DEVICEREQUEST: + tgt.setValue(ActivityDefinition.ActivityDefinitionKind.DEVICEREQUEST); + break; + case ENROLLMENTREQUEST: + tgt.setValue(ActivityDefinition.ActivityDefinitionKind.ENROLLMENTREQUEST); + break; + case IMMUNIZATIONRECOMMENDATION: + tgt.setValue(ActivityDefinition.ActivityDefinitionKind.IMMUNIZATIONRECOMMENDATION); + break; + case MEDICATIONREQUEST: + tgt.setValue(ActivityDefinition.ActivityDefinitionKind.MEDICATIONREQUEST); + break; + case NUTRITIONORDER: + tgt.setValue(ActivityDefinition.ActivityDefinitionKind.NUTRITIONORDER); + break; + case PROCEDUREREQUEST: + tgt.setValue(ActivityDefinition.ActivityDefinitionKind.SERVICEREQUEST); + break; + case REFERRALREQUEST: + tgt.setValue(ActivityDefinition.ActivityDefinitionKind.SERVICEREQUEST); + break; + case SUPPLYREQUEST: + tgt.setValue(ActivityDefinition.ActivityDefinitionKind.SUPPLYREQUEST); + break; + case TASK: + tgt.setValue(ActivityDefinition.ActivityDefinitionKind.TASK); + break; + case VISIONPRESCRIPTION: + tgt.setValue(ActivityDefinition.ActivityDefinitionKind.VISIONPRESCRIPTION); + break; + default: + tgt.setValue(ActivityDefinition.ActivityDefinitionKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertActivityDefinitionKind(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKindEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case APPOINTMENT: - tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.APPOINTMENT); - break; - case APPOINTMENTRESPONSE: - tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.APPOINTMENTRESPONSE); - break; - case CAREPLAN: - tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.CAREPLAN); - break; - case CLAIM: - tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.CLAIM); - break; - case COMMUNICATIONREQUEST: - tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.COMMUNICATIONREQUEST); - break; - case CONTRACT: - tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.CONTRACT); - break; - case DEVICEREQUEST: - tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.DEVICEREQUEST); - break; - case ENROLLMENTREQUEST: - tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.ENROLLMENTREQUEST); - break; - case IMMUNIZATIONRECOMMENDATION: - tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.IMMUNIZATIONRECOMMENDATION); - break; - case MEDICATIONREQUEST: - tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.MEDICATIONREQUEST); - break; - case NUTRITIONORDER: - tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.NUTRITIONORDER); - break; - case SERVICEREQUEST: - tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.PROCEDUREREQUEST); - break; - case SUPPLYREQUEST: - tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.SUPPLYREQUEST); - break; - case TASK: - tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.TASK); - break; - case VISIONPRESCRIPTION: - tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.VISIONPRESCRIPTION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKindEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case APPOINTMENT: + tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.APPOINTMENT); + break; + case APPOINTMENTRESPONSE: + tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.APPOINTMENTRESPONSE); + break; + case CAREPLAN: + tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.CAREPLAN); + break; + case CLAIM: + tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.CLAIM); + break; + case COMMUNICATIONREQUEST: + tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.COMMUNICATIONREQUEST); + break; + case CONTRACT: + tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.CONTRACT); + break; + case DEVICEREQUEST: + tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.DEVICEREQUEST); + break; + case ENROLLMENTREQUEST: + tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.ENROLLMENTREQUEST); + break; + case IMMUNIZATIONRECOMMENDATION: + tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.IMMUNIZATIONRECOMMENDATION); + break; + case MEDICATIONREQUEST: + tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.MEDICATIONREQUEST); + break; + case NUTRITIONORDER: + tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.NUTRITIONORDER); + break; + case SERVICEREQUEST: + tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.PROCEDUREREQUEST); + break; + case SUPPLYREQUEST: + tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.SUPPLYREQUEST); + break; + case TASK: + tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.TASK); + break; + case VISIONPRESCRIPTION: + tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.VISIONPRESCRIPTION); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionParticipantComponent convertActivityDefinitionParticipantComponent(org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionParticipantComponent src) throws FHIRException { @@ -378,46 +388,54 @@ public static org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionPartici } static public org.hl7.fhir.r4.model.Enumeration convertActivityParticipantType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ActivityDefinition.ActivityParticipantTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PATIENT: - tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.ActivityParticipantType.PATIENT); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.ActivityParticipantType.PRACTITIONER); - break; - case RELATEDPERSON: - tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.ActivityParticipantType.RELATEDPERSON); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.ActivityParticipantType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ActivityDefinition.ActivityParticipantTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PATIENT: + tgt.setValue(ActivityDefinition.ActivityParticipantType.PATIENT); + break; + case PRACTITIONER: + tgt.setValue(ActivityDefinition.ActivityParticipantType.PRACTITIONER); + break; + case RELATEDPERSON: + tgt.setValue(ActivityDefinition.ActivityParticipantType.RELATEDPERSON); + break; + default: + tgt.setValue(ActivityDefinition.ActivityParticipantType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertActivityParticipantType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityParticipantTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PATIENT: - tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityParticipantType.PATIENT); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityParticipantType.PRACTITIONER); - break; - case RELATEDPERSON: - tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityParticipantType.RELATEDPERSON); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityParticipantType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityParticipantTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PATIENT: + tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityParticipantType.PATIENT); + break; + case PRACTITIONER: + tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityParticipantType.PRACTITIONER); + break; + case RELATEDPERSON: + tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityParticipantType.RELATEDPERSON); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityParticipantType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/AllergyIntolerance30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/AllergyIntolerance30_40.java index 203e88d9a2..c9eaa57f01 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/AllergyIntolerance30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/AllergyIntolerance30_40.java @@ -10,6 +10,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.DateTime30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.AllergyIntolerance; +import org.hl7.fhir.r4.model.Enumeration; public class AllergyIntolerance30_40 { @@ -90,53 +92,61 @@ public static org.hl7.fhir.r4.model.AllergyIntolerance convertAllergyIntolerance } static public org.hl7.fhir.r4.model.Enumeration convertAllergyIntoleranceCategory(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategoryEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case FOOD: - tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory.FOOD); - break; - case MEDICATION: - tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory.MEDICATION); - break; - case ENVIRONMENT: - tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory.ENVIRONMENT); - break; - case BIOLOGIC: - tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory.BIOLOGIC); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new AllergyIntolerance.AllergyIntoleranceCategoryEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FOOD: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceCategory.FOOD); + break; + case MEDICATION: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceCategory.MEDICATION); + break; + case ENVIRONMENT: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceCategory.ENVIRONMENT); + break; + case BIOLOGIC: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceCategory.BIOLOGIC); + break; + default: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceCategory.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertAllergyIntoleranceCategory(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCategoryEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case FOOD: - tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCategory.FOOD); - break; - case MEDICATION: - tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCategory.MEDICATION); - break; - case ENVIRONMENT: - tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCategory.ENVIRONMENT); - break; - case BIOLOGIC: - tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCategory.BIOLOGIC); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCategory.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCategoryEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FOOD: + tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCategory.FOOD); + break; + case MEDICATION: + tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCategory.MEDICATION); + break; + case ENVIRONMENT: + tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCategory.ENVIRONMENT); + break; + case BIOLOGIC: + tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCategory.BIOLOGIC); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCategory.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceClinicalStatus convertAllergyIntoleranceClinicalStatus(org.hl7.fhir.r4.model.CodeableConcept src) throws FHIRException { @@ -167,47 +177,55 @@ static public org.hl7.fhir.r4.model.CodeableConcept convertAllergyIntoleranceCli } static public org.hl7.fhir.r4.model.Enumeration convertAllergyIntoleranceCriticality(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticalityEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case LOW: - tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticality.LOW); - break; - case HIGH: - tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticality.HIGH); - break; - case UNABLETOASSESS: - tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticality.UNABLETOASSESS); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticality.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new AllergyIntolerance.AllergyIntoleranceCriticalityEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case LOW: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceCriticality.LOW); + break; + case HIGH: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceCriticality.HIGH); + break; + case UNABLETOASSESS: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceCriticality.UNABLETOASSESS); + break; + default: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceCriticality.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertAllergyIntoleranceCriticality(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCriticalityEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case LOW: - tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCriticality.LOW); - break; - case HIGH: - tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCriticality.HIGH); - break; - case UNABLETOASSESS: - tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCriticality.UNABLETOASSESS); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCriticality.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCriticalityEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case LOW: + tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCriticality.LOW); + break; + case HIGH: + tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCriticality.HIGH); + break; + case UNABLETOASSESS: + tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCriticality.UNABLETOASSESS); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCriticality.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceReactionComponent convertAllergyIntoleranceReactionComponent(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceReactionComponent src) throws FHIRException { @@ -253,85 +271,101 @@ public static org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceReac } static public org.hl7.fhir.dstu3.model.Enumeration convertAllergyIntoleranceSeverity(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceSeverityEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case MILD: - tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceSeverity.MILD); - break; - case MODERATE: - tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceSeverity.MODERATE); - break; - case SEVERE: - tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceSeverity.SEVERE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceSeverity.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceSeverityEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MILD: + tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceSeverity.MILD); + break; + case MODERATE: + tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceSeverity.MODERATE); + break; + case SEVERE: + tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceSeverity.SEVERE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceSeverity.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertAllergyIntoleranceSeverity(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverityEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case MILD: - tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverity.MILD); - break; - case MODERATE: - tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverity.MODERATE); - break; - case SEVERE: - tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverity.SEVERE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverity.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new AllergyIntolerance.AllergyIntoleranceSeverityEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MILD: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceSeverity.MILD); + break; + case MODERATE: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceSeverity.MODERATE); + break; + case SEVERE: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceSeverity.SEVERE); + break; + default: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceSeverity.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertAllergyIntoleranceType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case ALLERGY: - tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceType.ALLERGY); - break; - case INTOLERANCE: - tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceType.INTOLERANCE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ALLERGY: + tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceType.ALLERGY); + break; + case INTOLERANCE: + tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceType.INTOLERANCE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertAllergyIntoleranceType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case ALLERGY: - tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceType.ALLERGY); - break; - case INTOLERANCE: - tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceType.INTOLERANCE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new AllergyIntolerance.AllergyIntoleranceTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ALLERGY: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceType.ALLERGY); + break; + case INTOLERANCE: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceType.INTOLERANCE); + break; + default: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.CodeableConcept convertAllergyIntoleranceVerificationStatus(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceVerificationStatus src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Appointment30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Appointment30_40.java index 086ed3d695..0034b991cd 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Appointment30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Appointment30_40.java @@ -10,6 +10,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.PositiveInt30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.UnsignedInt30_40; +import org.hl7.fhir.dstu3.model.Appointment; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; public class Appointment30_40 { @@ -141,170 +143,194 @@ public static org.hl7.fhir.r4.model.Appointment.AppointmentParticipantComponent } static public org.hl7.fhir.dstu3.model.Enumeration convertAppointmentStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Appointment.AppointmentStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSED: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.PROPOSED); - break; - case PENDING: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.PENDING); - break; - case BOOKED: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.BOOKED); - break; - case ARRIVED: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.ARRIVED); - break; - case FULFILLED: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.FULFILLED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.CANCELLED); - break; - case NOSHOW: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.NOSHOW); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Appointment.AppointmentStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSED: + tgt.setValue(Appointment.AppointmentStatus.PROPOSED); + break; + case PENDING: + tgt.setValue(Appointment.AppointmentStatus.PENDING); + break; + case BOOKED: + tgt.setValue(Appointment.AppointmentStatus.BOOKED); + break; + case ARRIVED: + tgt.setValue(Appointment.AppointmentStatus.ARRIVED); + break; + case FULFILLED: + tgt.setValue(Appointment.AppointmentStatus.FULFILLED); + break; + case CANCELLED: + tgt.setValue(Appointment.AppointmentStatus.CANCELLED); + break; + case NOSHOW: + tgt.setValue(Appointment.AppointmentStatus.NOSHOW); + break; + case ENTEREDINERROR: + tgt.setValue(Appointment.AppointmentStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Appointment.AppointmentStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertAppointmentStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Appointment.AppointmentStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSED: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.PROPOSED); - break; - case PENDING: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.PENDING); - break; - case BOOKED: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.BOOKED); - break; - case ARRIVED: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.ARRIVED); - break; - case FULFILLED: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.FULFILLED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.CANCELLED); - break; - case NOSHOW: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.NOSHOW); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Appointment.AppointmentStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSED: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.PROPOSED); + break; + case PENDING: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.PENDING); + break; + case BOOKED: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.BOOKED); + break; + case ARRIVED: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.ARRIVED); + break; + case FULFILLED: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.FULFILLED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.CANCELLED); + break; + case NOSHOW: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.NOSHOW); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertParticipantRequired(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Appointment.ParticipantRequiredEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case REQUIRED: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipantRequired.REQUIRED); - break; - case OPTIONAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipantRequired.OPTIONAL); - break; - case INFORMATIONONLY: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipantRequired.INFORMATIONONLY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipantRequired.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Appointment.ParticipantRequiredEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REQUIRED: + tgt.setValue(Appointment.ParticipantRequired.REQUIRED); + break; + case OPTIONAL: + tgt.setValue(Appointment.ParticipantRequired.OPTIONAL); + break; + case INFORMATIONONLY: + tgt.setValue(Appointment.ParticipantRequired.INFORMATIONONLY); + break; + default: + tgt.setValue(Appointment.ParticipantRequired.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertParticipantRequired(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Appointment.ParticipantRequiredEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case REQUIRED: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipantRequired.REQUIRED); - break; - case OPTIONAL: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipantRequired.OPTIONAL); - break; - case INFORMATIONONLY: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipantRequired.INFORMATIONONLY); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipantRequired.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Appointment.ParticipantRequiredEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REQUIRED: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipantRequired.REQUIRED); + break; + case OPTIONAL: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipantRequired.OPTIONAL); + break; + case INFORMATIONONLY: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipantRequired.INFORMATIONONLY); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipantRequired.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertParticipationStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Appointment.ParticipationStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACCEPTED: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipationStatus.ACCEPTED); - break; - case DECLINED: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipationStatus.DECLINED); - break; - case TENTATIVE: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipationStatus.TENTATIVE); - break; - case NEEDSACTION: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipationStatus.NEEDSACTION); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Appointment.ParticipationStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACCEPTED: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipationStatus.ACCEPTED); + break; + case DECLINED: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipationStatus.DECLINED); + break; + case TENTATIVE: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipationStatus.TENTATIVE); + break; + case NEEDSACTION: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipationStatus.NEEDSACTION); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertParticipationStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Appointment.ParticipationStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACCEPTED: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipationStatus.ACCEPTED); - break; - case DECLINED: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipationStatus.DECLINED); - break; - case TENTATIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipationStatus.TENTATIVE); - break; - case NEEDSACTION: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipationStatus.NEEDSACTION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Appointment.ParticipationStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACCEPTED: + tgt.setValue(Appointment.ParticipationStatus.ACCEPTED); + break; + case DECLINED: + tgt.setValue(Appointment.ParticipationStatus.DECLINED); + break; + case TENTATIVE: + tgt.setValue(Appointment.ParticipationStatus.TENTATIVE); + break; + case NEEDSACTION: + tgt.setValue(Appointment.ParticipationStatus.NEEDSACTION); + break; + default: + tgt.setValue(Appointment.ParticipationStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/AppointmentResponse30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/AppointmentResponse30_40.java index fdc92dd6ed..71a3772ba4 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/AppointmentResponse30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/AppointmentResponse30_40.java @@ -6,6 +6,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.Identifier30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Instant30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; +import org.hl7.fhir.dstu3.model.AppointmentResponse; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; public class AppointmentResponse30_40 { @@ -59,52 +61,60 @@ public static org.hl7.fhir.dstu3.model.AppointmentResponse convertAppointmentRes } static public org.hl7.fhir.dstu3.model.Enumeration convertParticipantStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACCEPTED: - tgt.setValue(org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatus.ACCEPTED); - break; - case DECLINED: - tgt.setValue(org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatus.DECLINED); - break; - case TENTATIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatus.TENTATIVE); - break; - case NEEDSACTION: - tgt.setValue(org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatus.NEEDSACTION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new AppointmentResponse.ParticipantStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACCEPTED: + tgt.setValue(AppointmentResponse.ParticipantStatus.ACCEPTED); + break; + case DECLINED: + tgt.setValue(AppointmentResponse.ParticipantStatus.DECLINED); + break; + case TENTATIVE: + tgt.setValue(AppointmentResponse.ParticipantStatus.TENTATIVE); + break; + case NEEDSACTION: + tgt.setValue(AppointmentResponse.ParticipantStatus.NEEDSACTION); + break; + default: + tgt.setValue(AppointmentResponse.ParticipantStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertParticipantStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACCEPTED: - tgt.setValue(org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.ACCEPTED); - break; - case DECLINED: - tgt.setValue(org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.DECLINED); - break; - case TENTATIVE: - tgt.setValue(org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.TENTATIVE); - break; - case NEEDSACTION: - tgt.setValue(org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.NEEDSACTION); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACCEPTED: + tgt.setValue(org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.ACCEPTED); + break; + case DECLINED: + tgt.setValue(org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.DECLINED); + break; + case TENTATIVE: + tgt.setValue(org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.TENTATIVE); + break; + case NEEDSACTION: + tgt.setValue(org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.NEEDSACTION); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/AuditEvent30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/AuditEvent30_40.java index a9d725e9af..e36576556b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/AuditEvent30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/AuditEvent30_40.java @@ -10,6 +10,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Instant30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.AuditEvent; +import org.hl7.fhir.r4.model.Enumeration; public class AuditEvent30_40 { @@ -68,59 +70,67 @@ public static org.hl7.fhir.r4.model.AuditEvent convertAuditEvent(org.hl7.fhir.ds } static public org.hl7.fhir.r4.model.Enumeration convertAuditEventAction(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.AuditEvent.AuditEventActionEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case C: - tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.C); - break; - case R: - tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.R); - break; - case U: - tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.U); - break; - case D: - tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.D); - break; - case E: - tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.E); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new AuditEvent.AuditEventActionEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case C: + tgt.setValue(AuditEvent.AuditEventAction.C); + break; + case R: + tgt.setValue(AuditEvent.AuditEventAction.R); + break; + case U: + tgt.setValue(AuditEvent.AuditEventAction.U); + break; + case D: + tgt.setValue(AuditEvent.AuditEventAction.D); + break; + case E: + tgt.setValue(AuditEvent.AuditEventAction.E); + break; + default: + tgt.setValue(AuditEvent.AuditEventAction.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertAuditEventAction(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventActionEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case C: - tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.C); - break; - case R: - tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.R); - break; - case U: - tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.U); - break; - case D: - tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.D); - break; - case E: - tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.E); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventActionEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case C: + tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.C); + break; + case R: + tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.R); + break; + case U: + tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.U); + break; + case D: + tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.D); + break; + case E: + tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.E); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentComponent convertAuditEventAgentComponent(org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentComponent src) throws FHIRException { @@ -208,59 +218,67 @@ public static org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkComponen } static public org.hl7.fhir.dstu3.model.Enumeration convertAuditEventAgentNetworkType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case _1: - tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType._1); - break; - case _2: - tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType._2); - break; - case _3: - tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType._3); - break; - case _4: - tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType._4); - break; - case _5: - tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType._5); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case _1: + tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType._1); + break; + case _2: + tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType._2); + break; + case _3: + tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType._3); + break; + case _4: + tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType._4); + break; + case _5: + tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType._5); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertAuditEventAgentNetworkType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case _1: - tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType._1); - break; - case _2: - tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType._2); - break; - case _3: - tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType._3); - break; - case _4: - tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType._4); - break; - case _5: - tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType._5); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new AuditEvent.AuditEventAgentNetworkTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case _1: + tgt.setValue(AuditEvent.AuditEventAgentNetworkType._1); + break; + case _2: + tgt.setValue(AuditEvent.AuditEventAgentNetworkType._2); + break; + case _3: + tgt.setValue(AuditEvent.AuditEventAgentNetworkType._3); + break; + case _4: + tgt.setValue(AuditEvent.AuditEventAgentNetworkType._4); + break; + case _5: + tgt.setValue(AuditEvent.AuditEventAgentNetworkType._5); + break; + default: + tgt.setValue(AuditEvent.AuditEventAgentNetworkType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityComponent convertAuditEventEntityComponent(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityComponent src) throws FHIRException { @@ -346,53 +364,61 @@ else if (src.hasValueBase64BinaryType()) } static public org.hl7.fhir.dstu3.model.Enumeration convertAuditEventOutcome(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventOutcomeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case _0: - tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventOutcome._0); - break; - case _4: - tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventOutcome._4); - break; - case _8: - tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventOutcome._8); - break; - case _12: - tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventOutcome._12); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventOutcome.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventOutcomeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case _0: + tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventOutcome._0); + break; + case _4: + tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventOutcome._4); + break; + case _8: + tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventOutcome._8); + break; + case _12: + tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventOutcome._12); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventOutcome.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertAuditEventOutcome(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.AuditEvent.AuditEventOutcomeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case _0: - tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventOutcome._0); - break; - case _4: - tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventOutcome._4); - break; - case _8: - tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventOutcome._8); - break; - case _12: - tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventOutcome._12); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventOutcome.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new AuditEvent.AuditEventOutcomeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case _0: + tgt.setValue(AuditEvent.AuditEventOutcome._0); + break; + case _4: + tgt.setValue(AuditEvent.AuditEventOutcome._4); + break; + case _8: + tgt.setValue(AuditEvent.AuditEventOutcome._8); + break; + case _12: + tgt.setValue(AuditEvent.AuditEventOutcome._12); + break; + default: + tgt.setValue(AuditEvent.AuditEventOutcome.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.AuditEvent.AuditEventSourceComponent convertAuditEventSourceComponent(org.hl7.fhir.r4.model.AuditEvent.AuditEventSourceComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Bundle30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Bundle30_40.java index f70c40d620..1b02145d11 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Bundle30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Bundle30_40.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.UnsignedInt30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Uri30_40; +import org.hl7.fhir.dstu3.model.Bundle; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; public class Bundle30_40 { @@ -215,176 +217,200 @@ public static org.hl7.fhir.r4.model.Bundle.BundleLinkComponent convertBundleLink } static public org.hl7.fhir.dstu3.model.Enumeration convertBundleType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Bundle.BundleTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case DOCUMENT: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.DOCUMENT); - break; - case MESSAGE: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.MESSAGE); - break; - case TRANSACTION: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.TRANSACTION); - break; - case TRANSACTIONRESPONSE: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.TRANSACTIONRESPONSE); - break; - case BATCH: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.BATCH); - break; - case BATCHRESPONSE: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.BATCHRESPONSE); - break; - case HISTORY: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.HISTORY); - break; - case SEARCHSET: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.SEARCHSET); - break; - case COLLECTION: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.COLLECTION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Bundle.BundleTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DOCUMENT: + tgt.setValue(Bundle.BundleType.DOCUMENT); + break; + case MESSAGE: + tgt.setValue(Bundle.BundleType.MESSAGE); + break; + case TRANSACTION: + tgt.setValue(Bundle.BundleType.TRANSACTION); + break; + case TRANSACTIONRESPONSE: + tgt.setValue(Bundle.BundleType.TRANSACTIONRESPONSE); + break; + case BATCH: + tgt.setValue(Bundle.BundleType.BATCH); + break; + case BATCHRESPONSE: + tgt.setValue(Bundle.BundleType.BATCHRESPONSE); + break; + case HISTORY: + tgt.setValue(Bundle.BundleType.HISTORY); + break; + case SEARCHSET: + tgt.setValue(Bundle.BundleType.SEARCHSET); + break; + case COLLECTION: + tgt.setValue(Bundle.BundleType.COLLECTION); + break; + default: + tgt.setValue(Bundle.BundleType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertBundleType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Bundle.BundleTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case DOCUMENT: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.DOCUMENT); - break; - case MESSAGE: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.MESSAGE); - break; - case TRANSACTION: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.TRANSACTION); - break; - case TRANSACTIONRESPONSE: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.TRANSACTIONRESPONSE); - break; - case BATCH: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.BATCH); - break; - case BATCHRESPONSE: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.BATCHRESPONSE); - break; - case HISTORY: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.HISTORY); - break; - case SEARCHSET: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.SEARCHSET); - break; - case COLLECTION: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.COLLECTION); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Bundle.BundleTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DOCUMENT: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.DOCUMENT); + break; + case MESSAGE: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.MESSAGE); + break; + case TRANSACTION: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.TRANSACTION); + break; + case TRANSACTIONRESPONSE: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.TRANSACTIONRESPONSE); + break; + case BATCH: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.BATCH); + break; + case BATCHRESPONSE: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.BATCHRESPONSE); + break; + case HISTORY: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.HISTORY); + break; + case SEARCHSET: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.SEARCHSET); + break; + case COLLECTION: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.COLLECTION); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertHTTPVerb(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Bundle.HTTPVerbEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case GET: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.HTTPVerb.GET); - break; - case POST: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.HTTPVerb.POST); - break; - case PUT: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.HTTPVerb.PUT); - break; - case DELETE: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.HTTPVerb.DELETE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.HTTPVerb.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Bundle.HTTPVerbEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case GET: + tgt.setValue(Bundle.HTTPVerb.GET); + break; + case POST: + tgt.setValue(Bundle.HTTPVerb.POST); + break; + case PUT: + tgt.setValue(Bundle.HTTPVerb.PUT); + break; + case DELETE: + tgt.setValue(Bundle.HTTPVerb.DELETE); + break; + default: + tgt.setValue(Bundle.HTTPVerb.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertHTTPVerb(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Bundle.HTTPVerbEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case GET: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.GET); - break; - case POST: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.POST); - break; - case PUT: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.PUT); - break; - case DELETE: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.DELETE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Bundle.HTTPVerbEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case GET: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.GET); + break; + case POST: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.POST); + break; + case PUT: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.PUT); + break; + case DELETE: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.DELETE); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertSearchEntryMode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Bundle.SearchEntryModeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case MATCH: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.SearchEntryMode.MATCH); - break; - case INCLUDE: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.SearchEntryMode.INCLUDE); - break; - case OUTCOME: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.SearchEntryMode.OUTCOME); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.SearchEntryMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Bundle.SearchEntryModeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MATCH: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.SearchEntryMode.MATCH); + break; + case INCLUDE: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.SearchEntryMode.INCLUDE); + break; + case OUTCOME: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.SearchEntryMode.OUTCOME); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.SearchEntryMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertSearchEntryMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Bundle.SearchEntryModeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case MATCH: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.SearchEntryMode.MATCH); - break; - case INCLUDE: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.SearchEntryMode.INCLUDE); - break; - case OUTCOME: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.SearchEntryMode.OUTCOME); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.SearchEntryMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Bundle.SearchEntryModeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MATCH: + tgt.setValue(Bundle.SearchEntryMode.MATCH); + break; + case INCLUDE: + tgt.setValue(Bundle.SearchEntryMode.INCLUDE); + break; + case OUTCOME: + tgt.setValue(Bundle.SearchEntryMode.OUTCOME); + break; + default: + tgt.setValue(Bundle.SearchEntryMode.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/CapabilityStatement30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/CapabilityStatement30_40.java index 083e81ba62..f38c9d00fe 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/CapabilityStatement30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/CapabilityStatement30_40.java @@ -16,6 +16,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.UnsignedInt30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Uri30_40; +import org.hl7.fhir.dstu3.model.CapabilityStatement; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; public class CapabilityStatement30_40 { @@ -202,47 +204,55 @@ public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementImple } static public org.hl7.fhir.dstu3.model.Enumeration convertCapabilityStatementKind(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementKindEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementKind.INSTANCE); - break; - case CAPABILITY: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementKind.CAPABILITY); - break; - case REQUIREMENTS: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementKind.REQUIREMENTS); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CapabilityStatement.CapabilityStatementKindEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(CapabilityStatement.CapabilityStatementKind.INSTANCE); + break; + case CAPABILITY: + tgt.setValue(CapabilityStatement.CapabilityStatementKind.CAPABILITY); + break; + case REQUIREMENTS: + tgt.setValue(CapabilityStatement.CapabilityStatementKind.REQUIREMENTS); + break; + default: + tgt.setValue(CapabilityStatement.CapabilityStatementKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertCapabilityStatementKind(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKindEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind.INSTANCE); - break; - case CAPABILITY: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind.CAPABILITY); - break; - case REQUIREMENTS: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind.REQUIREMENTS); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKindEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind.INSTANCE); + break; + case CAPABILITY: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind.CAPABILITY); + break; + case REQUIREMENTS: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind.REQUIREMENTS); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingComponent convertCapabilityStatementMessagingComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingComponent src) throws FHIRException { @@ -601,229 +611,269 @@ public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementSoftw } static public org.hl7.fhir.dstu3.model.Enumeration convertConditionalDeleteStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalDeleteStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalDeleteStatus.NOTSUPPORTED); - break; - case SINGLE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalDeleteStatus.SINGLE); - break; - case MULTIPLE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalDeleteStatus.MULTIPLE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalDeleteStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CapabilityStatement.ConditionalDeleteStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTSUPPORTED: + tgt.setValue(CapabilityStatement.ConditionalDeleteStatus.NOTSUPPORTED); + break; + case SINGLE: + tgt.setValue(CapabilityStatement.ConditionalDeleteStatus.SINGLE); + break; + case MULTIPLE: + tgt.setValue(CapabilityStatement.ConditionalDeleteStatus.MULTIPLE); + break; + default: + tgt.setValue(CapabilityStatement.ConditionalDeleteStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertConditionalDeleteStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus.NOTSUPPORTED); - break; - case SINGLE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus.SINGLE); - break; - case MULTIPLE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus.MULTIPLE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTSUPPORTED: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus.NOTSUPPORTED); + break; + case SINGLE: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus.SINGLE); + break; + case MULTIPLE: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus.MULTIPLE); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertConditionalReadStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalReadStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalReadStatus.NOTSUPPORTED); - break; - case MODIFIEDSINCE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalReadStatus.MODIFIEDSINCE); - break; - case NOTMATCH: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalReadStatus.NOTMATCH); - break; - case FULLSUPPORT: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalReadStatus.FULLSUPPORT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalReadStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CapabilityStatement.ConditionalReadStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTSUPPORTED: + tgt.setValue(CapabilityStatement.ConditionalReadStatus.NOTSUPPORTED); + break; + case MODIFIEDSINCE: + tgt.setValue(CapabilityStatement.ConditionalReadStatus.MODIFIEDSINCE); + break; + case NOTMATCH: + tgt.setValue(CapabilityStatement.ConditionalReadStatus.NOTMATCH); + break; + case FULLSUPPORT: + tgt.setValue(CapabilityStatement.ConditionalReadStatus.FULLSUPPORT); + break; + default: + tgt.setValue(CapabilityStatement.ConditionalReadStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertConditionalReadStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus.NOTSUPPORTED); - break; - case MODIFIEDSINCE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus.MODIFIEDSINCE); - break; - case NOTMATCH: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus.NOTMATCH); - break; - case FULLSUPPORT: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus.FULLSUPPORT); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTSUPPORTED: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus.NOTSUPPORTED); + break; + case MODIFIEDSINCE: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus.MODIFIEDSINCE); + break; + case NOTMATCH: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus.NOTMATCH); + break; + case FULLSUPPORT: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus.FULLSUPPORT); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertDocumentMode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.DocumentModeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PRODUCER: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.DocumentMode.PRODUCER); - break; - case CONSUMER: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.DocumentMode.CONSUMER); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.DocumentMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.DocumentModeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRODUCER: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.DocumentMode.PRODUCER); + break; + case CONSUMER: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.DocumentMode.CONSUMER); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.DocumentMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertDocumentMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.DocumentModeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PRODUCER: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.DocumentMode.PRODUCER); - break; - case CONSUMER: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.DocumentMode.CONSUMER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.DocumentMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CapabilityStatement.DocumentModeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRODUCER: + tgt.setValue(CapabilityStatement.DocumentMode.PRODUCER); + break; + case CONSUMER: + tgt.setValue(CapabilityStatement.DocumentMode.CONSUMER); + break; + default: + tgt.setValue(CapabilityStatement.DocumentMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertEventCapabilityMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.EventCapabilityModeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case SENDER: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.EventCapabilityMode.SENDER); - break; - case RECEIVER: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.EventCapabilityMode.RECEIVER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.EventCapabilityMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CapabilityStatement.EventCapabilityModeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SENDER: + tgt.setValue(CapabilityStatement.EventCapabilityMode.SENDER); + break; + case RECEIVER: + tgt.setValue(CapabilityStatement.EventCapabilityMode.RECEIVER); + break; + default: + tgt.setValue(CapabilityStatement.EventCapabilityMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertEventCapabilityMode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityModeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case SENDER: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityMode.SENDER); - break; - case RECEIVER: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityMode.RECEIVER); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityModeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SENDER: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityMode.SENDER); + break; + case RECEIVER: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityMode.RECEIVER); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertReferenceHandlingPolicy(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicyEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case LITERAL: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.LITERAL); - break; - case LOGICAL: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.LOGICAL); - break; - case RESOLVES: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.RESOLVES); - break; - case ENFORCED: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.ENFORCED); - break; - case LOCAL: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.LOCAL); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicyEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case LITERAL: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.LITERAL); + break; + case LOGICAL: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.LOGICAL); + break; + case RESOLVES: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.RESOLVES); + break; + case ENFORCED: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.ENFORCED); + break; + case LOCAL: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.LOCAL); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertReferenceHandlingPolicy(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.ReferenceHandlingPolicyEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case LITERAL: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ReferenceHandlingPolicy.LITERAL); - break; - case LOGICAL: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ReferenceHandlingPolicy.LOGICAL); - break; - case RESOLVES: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ReferenceHandlingPolicy.RESOLVES); - break; - case ENFORCED: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ReferenceHandlingPolicy.ENFORCED); - break; - case LOCAL: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ReferenceHandlingPolicy.LOCAL); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ReferenceHandlingPolicy.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CapabilityStatement.ReferenceHandlingPolicyEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case LITERAL: + tgt.setValue(CapabilityStatement.ReferenceHandlingPolicy.LITERAL); + break; + case LOGICAL: + tgt.setValue(CapabilityStatement.ReferenceHandlingPolicy.LOGICAL); + break; + case RESOLVES: + tgt.setValue(CapabilityStatement.ReferenceHandlingPolicy.RESOLVES); + break; + case ENFORCED: + tgt.setValue(CapabilityStatement.ReferenceHandlingPolicy.ENFORCED); + break; + case LOCAL: + tgt.setValue(CapabilityStatement.ReferenceHandlingPolicy.LOCAL); + break; + default: + tgt.setValue(CapabilityStatement.ReferenceHandlingPolicy.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceInteractionComponent convertResourceInteractionComponent(org.hl7.fhir.r4.model.CapabilityStatement.ResourceInteractionComponent src) throws FHIRException { @@ -851,85 +901,101 @@ public static org.hl7.fhir.r4.model.CapabilityStatement.ResourceInteractionCompo } static public org.hl7.fhir.r4.model.Enumeration convertResourceVersionPolicy(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicyEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case NOVERSION: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy.NOVERSION); - break; - case VERSIONED: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy.VERSIONED); - break; - case VERSIONEDUPDATE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy.VERSIONEDUPDATE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicyEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOVERSION: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy.NOVERSION); + break; + case VERSIONED: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy.VERSIONED); + break; + case VERSIONEDUPDATE: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy.VERSIONEDUPDATE); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertResourceVersionPolicy(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceVersionPolicyEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case NOVERSION: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceVersionPolicy.NOVERSION); - break; - case VERSIONED: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceVersionPolicy.VERSIONED); - break; - case VERSIONEDUPDATE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceVersionPolicy.VERSIONEDUPDATE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceVersionPolicy.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CapabilityStatement.ResourceVersionPolicyEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOVERSION: + tgt.setValue(CapabilityStatement.ResourceVersionPolicy.NOVERSION); + break; + case VERSIONED: + tgt.setValue(CapabilityStatement.ResourceVersionPolicy.VERSIONED); + break; + case VERSIONEDUPDATE: + tgt.setValue(CapabilityStatement.ResourceVersionPolicy.VERSIONEDUPDATE); + break; + default: + tgt.setValue(CapabilityStatement.ResourceVersionPolicy.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertRestfulCapabilityMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.RestfulCapabilityModeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case CLIENT: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.RestfulCapabilityMode.CLIENT); - break; - case SERVER: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.RestfulCapabilityMode.SERVER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.RestfulCapabilityMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CapabilityStatement.RestfulCapabilityModeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CLIENT: + tgt.setValue(CapabilityStatement.RestfulCapabilityMode.CLIENT); + break; + case SERVER: + tgt.setValue(CapabilityStatement.RestfulCapabilityMode.SERVER); + break; + default: + tgt.setValue(CapabilityStatement.RestfulCapabilityMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertRestfulCapabilityMode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityModeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case CLIENT: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityMode.CLIENT); - break; - case SERVER: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityMode.SERVER); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityModeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CLIENT: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityMode.CLIENT); + break; + case SERVER: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityMode.SERVER); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.CapabilityStatement.SystemInteractionComponent convertSystemInteractionComponent(org.hl7.fhir.r4.model.CapabilityStatement.SystemInteractionComponent src) throws FHIRException { @@ -957,132 +1023,148 @@ public static org.hl7.fhir.r4.model.CapabilityStatement.SystemInteractionCompone } static public org.hl7.fhir.dstu3.model.Enumeration convertSystemRestfulInteraction(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.SystemRestfulInteractionEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case TRANSACTION: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.SystemRestfulInteraction.TRANSACTION); - break; - case BATCH: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.SystemRestfulInteraction.BATCH); - break; - case SEARCHSYSTEM: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.SystemRestfulInteraction.SEARCHSYSTEM); - break; - case HISTORYSYSTEM: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.SystemRestfulInteraction.HISTORYSYSTEM); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.SystemRestfulInteraction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CapabilityStatement.SystemRestfulInteractionEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case TRANSACTION: + tgt.setValue(CapabilityStatement.SystemRestfulInteraction.TRANSACTION); + break; + case BATCH: + tgt.setValue(CapabilityStatement.SystemRestfulInteraction.BATCH); + break; + case SEARCHSYSTEM: + tgt.setValue(CapabilityStatement.SystemRestfulInteraction.SEARCHSYSTEM); + break; + case HISTORYSYSTEM: + tgt.setValue(CapabilityStatement.SystemRestfulInteraction.HISTORYSYSTEM); + break; + default: + tgt.setValue(CapabilityStatement.SystemRestfulInteraction.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertSystemRestfulInteraction(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteractionEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case TRANSACTION: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.TRANSACTION); - break; - case BATCH: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.BATCH); - break; - case SEARCHSYSTEM: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.SEARCHSYSTEM); - break; - case HISTORYSYSTEM: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.HISTORYSYSTEM); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteractionEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case TRANSACTION: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.TRANSACTION); + break; + case BATCH: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.BATCH); + break; + case SEARCHSYSTEM: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.SEARCHSYSTEM); + break; + case HISTORYSYSTEM: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.HISTORYSYSTEM); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertTypeRestfulInteraction(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteractionEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case READ: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.READ); - break; - case VREAD: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.VREAD); - break; - case UPDATE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.UPDATE); - break; - case PATCH: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.PATCH); - break; - case DELETE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.DELETE); - break; - case HISTORYINSTANCE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.HISTORYINSTANCE); - break; - case HISTORYTYPE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.HISTORYTYPE); - break; - case CREATE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.CREATE); - break; - case SEARCHTYPE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.SEARCHTYPE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CapabilityStatement.TypeRestfulInteractionEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case READ: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.READ); + break; + case VREAD: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.VREAD); + break; + case UPDATE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.UPDATE); + break; + case PATCH: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.PATCH); + break; + case DELETE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.DELETE); + break; + case HISTORYINSTANCE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.HISTORYINSTANCE); + break; + case HISTORYTYPE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.HISTORYTYPE); + break; + case CREATE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.CREATE); + break; + case SEARCHTYPE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.SEARCHTYPE); + break; + default: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertTypeRestfulInteraction(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteractionEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case READ: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.READ); - break; - case VREAD: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.VREAD); - break; - case UPDATE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.UPDATE); - break; - case PATCH: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.PATCH); - break; - case DELETE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.DELETE); - break; - case HISTORYINSTANCE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.HISTORYINSTANCE); - break; - case HISTORYTYPE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.HISTORYTYPE); - break; - case CREATE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.CREATE); - break; - case SEARCHTYPE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.SEARCHTYPE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteractionEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case READ: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.READ); + break; + case VREAD: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.VREAD); + break; + case UPDATE: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.UPDATE); + break; + case PATCH: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.PATCH); + break; + case DELETE: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.DELETE); + break; + case HISTORYINSTANCE: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.HISTORYINSTANCE); + break; + case HISTORYTYPE: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.HISTORYTYPE); + break; + case CREATE: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.CREATE); + break; + case SEARCHTYPE: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.SEARCHTYPE); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/CarePlan30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/CarePlan30_40.java index 84d78f9155..dd72148ebc 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/CarePlan30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/CarePlan30_40.java @@ -11,6 +11,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.SimpleQuantity30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Boolean30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; +import org.hl7.fhir.dstu3.model.CarePlan; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.dstu3.model.Reference; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4.model.Coding; @@ -355,188 +357,212 @@ public static org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityDetailComponent } static public org.hl7.fhir.dstu3.model.Enumeration convertCarePlanActivityStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus.CANCELLED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus.COMPLETED); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus.INPROGRESS); - break; - case NOTSTARTED: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus.NOTSTARTED); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus.ONHOLD); - break; - case SCHEDULED: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus.SCHEDULED); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CarePlan.CarePlanActivityStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CANCELLED: + tgt.setValue(CarePlan.CarePlanActivityStatus.CANCELLED); + break; + case COMPLETED: + tgt.setValue(CarePlan.CarePlanActivityStatus.COMPLETED); + break; + case INPROGRESS: + tgt.setValue(CarePlan.CarePlanActivityStatus.INPROGRESS); + break; + case NOTSTARTED: + tgt.setValue(CarePlan.CarePlanActivityStatus.NOTSTARTED); + break; + case ONHOLD: + tgt.setValue(CarePlan.CarePlanActivityStatus.ONHOLD); + break; + case SCHEDULED: + tgt.setValue(CarePlan.CarePlanActivityStatus.SCHEDULED); + break; + case UNKNOWN: + tgt.setValue(CarePlan.CarePlanActivityStatus.UNKNOWN); + break; + default: + tgt.setValue(CarePlan.CarePlanActivityStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertCarePlanActivityStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.CANCELLED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.COMPLETED); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.INPROGRESS); - break; - case NOTSTARTED: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.NOTSTARTED); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.ONHOLD); - break; - case SCHEDULED: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.SCHEDULED); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.CANCELLED); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.COMPLETED); + break; + case INPROGRESS: + tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.INPROGRESS); + break; + case NOTSTARTED: + tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.NOTSTARTED); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.ONHOLD); + break; + case SCHEDULED: + tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.SCHEDULED); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertCarePlanIntent(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CarePlan.CarePlanIntentEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case OPTION: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanIntent.OPTION); - break; - case ORDER: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanIntent.ORDER); - break; - case PLAN: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanIntent.PLAN); - break; - case PROPOSAL: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanIntent.PROPOSAL); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanIntent.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CarePlan.CarePlanIntentEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OPTION: + tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanIntent.OPTION); + break; + case ORDER: + tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanIntent.ORDER); + break; + case PLAN: + tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanIntent.PLAN); + break; + case PROPOSAL: + tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanIntent.PROPOSAL); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanIntent.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertCarePlanIntent(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CarePlan.CarePlanIntentEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case OPTION: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanIntent.OPTION); - break; - case ORDER: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanIntent.ORDER); - break; - case PLAN: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanIntent.PLAN); - break; - case PROPOSAL: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanIntent.PROPOSAL); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanIntent.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CarePlan.CarePlanIntentEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OPTION: + tgt.setValue(CarePlan.CarePlanIntent.OPTION); + break; + case ORDER: + tgt.setValue(CarePlan.CarePlanIntent.ORDER); + break; + case PLAN: + tgt.setValue(CarePlan.CarePlanIntent.PLAN); + break; + case PROPOSAL: + tgt.setValue(CarePlan.CarePlanIntent.PROPOSAL); + break; + default: + tgt.setValue(CarePlan.CarePlanIntent.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertCarePlanStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus.ACTIVE); - break; - case REVOKED: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus.CANCELLED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus.COMPLETED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus.ENTEREDINERROR); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus.SUSPENDED); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CarePlan.CarePlanStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(CarePlan.CarePlanStatus.ACTIVE); + break; + case REVOKED: + tgt.setValue(CarePlan.CarePlanStatus.CANCELLED); + break; + case COMPLETED: + tgt.setValue(CarePlan.CarePlanStatus.COMPLETED); + break; + case DRAFT: + tgt.setValue(CarePlan.CarePlanStatus.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(CarePlan.CarePlanStatus.ENTEREDINERROR); + break; + case ONHOLD: + tgt.setValue(CarePlan.CarePlanStatus.SUSPENDED); + break; + case UNKNOWN: + tgt.setValue(CarePlan.CarePlanStatus.UNKNOWN); + break; + default: + tgt.setValue(CarePlan.CarePlanStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertCarePlanStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CarePlan.CarePlanStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.REVOKED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.COMPLETED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.ENTEREDINERROR); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.ONHOLD); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CarePlan.CarePlanStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.ACTIVE); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.REVOKED); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.COMPLETED); + break; + case DRAFT: + tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.ENTEREDINERROR); + break; + case SUSPENDED: + tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.ONHOLD); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/CareTeam30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/CareTeam30_40.java index 6d7791133e..34cc9a599e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/CareTeam30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/CareTeam30_40.java @@ -7,6 +7,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.Identifier30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.Period30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; +import org.hl7.fhir.dstu3.model.CareTeam; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; public class CareTeam30_40 { @@ -106,58 +108,66 @@ public static org.hl7.fhir.r4.model.CareTeam.CareTeamParticipantComponent conver } static public org.hl7.fhir.dstu3.model.Enumeration convertCareTeamStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CareTeam.CareTeamStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSED: - tgt.setValue(org.hl7.fhir.dstu3.model.CareTeam.CareTeamStatus.PROPOSED); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.CareTeam.CareTeamStatus.ACTIVE); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.dstu3.model.CareTeam.CareTeamStatus.SUSPENDED); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.CareTeam.CareTeamStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.CareTeam.CareTeamStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CareTeam.CareTeamStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CareTeam.CareTeamStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSED: + tgt.setValue(CareTeam.CareTeamStatus.PROPOSED); + break; + case ACTIVE: + tgt.setValue(CareTeam.CareTeamStatus.ACTIVE); + break; + case SUSPENDED: + tgt.setValue(CareTeam.CareTeamStatus.SUSPENDED); + break; + case INACTIVE: + tgt.setValue(CareTeam.CareTeamStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(CareTeam.CareTeamStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(CareTeam.CareTeamStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertCareTeamStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CareTeam.CareTeamStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSED: - tgt.setValue(org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.PROPOSED); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.ACTIVE); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.SUSPENDED); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CareTeam.CareTeamStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSED: + tgt.setValue(org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.PROPOSED); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.ACTIVE); + break; + case SUSPENDED: + tgt.setValue(org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.SUSPENDED); + break; + case INACTIVE: + tgt.setValue(org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/ClinicalImpression30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/ClinicalImpression30_40.java index 5e471fee7b..fe855693b2 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/ClinicalImpression30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/ClinicalImpression30_40.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.DateTime30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.ClinicalImpression; +import org.hl7.fhir.r4.model.Enumeration; public class ClinicalImpression30_40 { @@ -144,46 +146,54 @@ public static org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionInve } static public org.hl7.fhir.r4.model.Enumeration convertClinicalImpressionStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ClinicalImpression.ClinicalImpressionStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(ClinicalImpression.ClinicalImpressionStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(ClinicalImpression.ClinicalImpressionStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(ClinicalImpression.ClinicalImpressionStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(ClinicalImpression.ClinicalImpressionStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertClinicalImpressionStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionStatus.DRAFT); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionStatus.DRAFT); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/CodeSystem30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/CodeSystem30_40.java index bbbabcd577..3c4f22d59d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/CodeSystem30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/CodeSystem30_40.java @@ -15,6 +15,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.UnsignedInt30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Uri30_40; +import org.hl7.fhir.dstu3.model.CodeSystem; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; public class CodeSystem30_40 { @@ -136,53 +138,61 @@ public static org.hl7.fhir.dstu3.model.CodeSystem convertCodeSystem(org.hl7.fhir } static public org.hl7.fhir.dstu3.model.Enumeration convertCodeSystemContentMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemContentModeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case NOTPRESENT: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemContentMode.NOTPRESENT); - break; - case EXAMPLE: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemContentMode.EXAMPLE); - break; - case FRAGMENT: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemContentMode.FRAGMENT); - break; - case COMPLETE: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemContentMode.COMPLETE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemContentMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CodeSystem.CodeSystemContentModeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTPRESENT: + tgt.setValue(CodeSystem.CodeSystemContentMode.NOTPRESENT); + break; + case EXAMPLE: + tgt.setValue(CodeSystem.CodeSystemContentMode.EXAMPLE); + break; + case FRAGMENT: + tgt.setValue(CodeSystem.CodeSystemContentMode.FRAGMENT); + break; + case COMPLETE: + tgt.setValue(CodeSystem.CodeSystemContentMode.COMPLETE); + break; + default: + tgt.setValue(CodeSystem.CodeSystemContentMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertCodeSystemContentMode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentModeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case NOTPRESENT: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.NOTPRESENT); - break; - case EXAMPLE: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.EXAMPLE); - break; - case FRAGMENT: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.FRAGMENT); - break; - case COMPLETE: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.COMPLETE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentModeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTPRESENT: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.NOTPRESENT); + break; + case EXAMPLE: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.EXAMPLE); + break; + case FRAGMENT: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.FRAGMENT); + break; + case COMPLETE: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.COMPLETE); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemFilterComponent convertCodeSystemFilterComponent(org.hl7.fhir.r4.model.CodeSystem.CodeSystemFilterComponent src) throws FHIRException { @@ -220,53 +230,61 @@ public static org.hl7.fhir.r4.model.CodeSystem.CodeSystemFilterComponent convert } static public org.hl7.fhir.dstu3.model.Enumeration convertCodeSystemHierarchyMeaning(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemHierarchyMeaningEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case GROUPEDBY: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemHierarchyMeaning.GROUPEDBY); - break; - case ISA: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemHierarchyMeaning.ISA); - break; - case PARTOF: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemHierarchyMeaning.PARTOF); - break; - case CLASSIFIEDWITH: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemHierarchyMeaning.CLASSIFIEDWITH); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemHierarchyMeaning.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CodeSystem.CodeSystemHierarchyMeaningEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case GROUPEDBY: + tgt.setValue(CodeSystem.CodeSystemHierarchyMeaning.GROUPEDBY); + break; + case ISA: + tgt.setValue(CodeSystem.CodeSystemHierarchyMeaning.ISA); + break; + case PARTOF: + tgt.setValue(CodeSystem.CodeSystemHierarchyMeaning.PARTOF); + break; + case CLASSIFIEDWITH: + tgt.setValue(CodeSystem.CodeSystemHierarchyMeaning.CLASSIFIEDWITH); + break; + default: + tgt.setValue(CodeSystem.CodeSystemHierarchyMeaning.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertCodeSystemHierarchyMeaning(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaningEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case GROUPEDBY: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.GROUPEDBY); - break; - case ISA: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.ISA); - break; - case PARTOF: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.PARTOF); - break; - case CLASSIFIEDWITH: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.CLASSIFIEDWITH); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaningEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case GROUPEDBY: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.GROUPEDBY); + break; + case ISA: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.ISA); + break; + case PARTOF: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.PARTOF); + break; + case CLASSIFIEDWITH: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.CLASSIFIEDWITH); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent convertConceptDefinitionComponent(org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent src) throws FHIRException { @@ -394,144 +412,160 @@ public static org.hl7.fhir.dstu3.model.CodeSystem.PropertyComponent convertPrope } static public org.hl7.fhir.r4.model.Enumeration convertPropertyType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CodeSystem.PropertyTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case CODE: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.CODE); - break; - case CODING: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.CODING); - break; - case STRING: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.STRING); - break; - case INTEGER: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.INTEGER); - break; - case BOOLEAN: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.BOOLEAN); - break; - case DATETIME: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.DATETIME); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CodeSystem.PropertyTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CODE: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.CODE); + break; + case CODING: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.CODING); + break; + case STRING: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.STRING); + break; + case INTEGER: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.INTEGER); + break; + case BOOLEAN: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.BOOLEAN); + break; + case DATETIME: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.DATETIME); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertPropertyType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CodeSystem.PropertyTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case CODE: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.PropertyType.CODE); - break; - case CODING: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.PropertyType.CODING); - break; - case STRING: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.PropertyType.STRING); - break; - case INTEGER: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.PropertyType.INTEGER); - break; - case BOOLEAN: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.PropertyType.BOOLEAN); - break; - case DATETIME: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.PropertyType.DATETIME); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.PropertyType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CodeSystem.PropertyTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CODE: + tgt.setValue(CodeSystem.PropertyType.CODE); + break; + case CODING: + tgt.setValue(CodeSystem.PropertyType.CODING); + break; + case STRING: + tgt.setValue(CodeSystem.PropertyType.STRING); + break; + case INTEGER: + tgt.setValue(CodeSystem.PropertyType.INTEGER); + break; + case BOOLEAN: + tgt.setValue(CodeSystem.PropertyType.BOOLEAN); + break; + case DATETIME: + tgt.setValue(CodeSystem.PropertyType.DATETIME); + break; + default: + tgt.setValue(CodeSystem.PropertyType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertFilterOperator(org.hl7.fhir.dstu3.model.Enumeration src) { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CodeSystem.FilterOperatorEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case EQUAL: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.EQUAL); - break; - case ISA: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.ISA); - break; - case DESCENDENTOF: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.DESCENDENTOF); - break; - case ISNOTA: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.ISNOTA); - break; - case REGEX: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.REGEX); - break; - case IN: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.NOTIN); - break; - case GENERALIZES: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.GENERALIZES); - break; - case EXISTS: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.EXISTS); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CodeSystem.FilterOperatorEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUAL: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.EQUAL); + break; + case ISA: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.ISA); + break; + case DESCENDENTOF: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.DESCENDENTOF); + break; + case ISNOTA: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.ISNOTA); + break; + case REGEX: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.REGEX); + break; + case IN: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.IN); + break; + case NOTIN: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.NOTIN); + break; + case GENERALIZES: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.GENERALIZES); + break; + case EXISTS: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.EXISTS); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertFilterOperator(org.hl7.fhir.r4.model.Enumeration src) { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CodeSystem.FilterOperatorEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case EQUAL: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.FilterOperator.EQUAL); - break; - case ISA: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.FilterOperator.ISA); - break; - case DESCENDENTOF: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.FilterOperator.DESCENDENTOF); - break; - case ISNOTA: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.FilterOperator.ISNOTA); - break; - case REGEX: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.FilterOperator.REGEX); - break; - case IN: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.FilterOperator.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.FilterOperator.NOTIN); - break; - case GENERALIZES: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.FilterOperator.GENERALIZES); - break; - case EXISTS: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.FilterOperator.EXISTS); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.FilterOperator.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CodeSystem.FilterOperatorEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUAL: + tgt.setValue(CodeSystem.FilterOperator.EQUAL); + break; + case ISA: + tgt.setValue(CodeSystem.FilterOperator.ISA); + break; + case DESCENDENTOF: + tgt.setValue(CodeSystem.FilterOperator.DESCENDENTOF); + break; + case ISNOTA: + tgt.setValue(CodeSystem.FilterOperator.ISNOTA); + break; + case REGEX: + tgt.setValue(CodeSystem.FilterOperator.REGEX); + break; + case IN: + tgt.setValue(CodeSystem.FilterOperator.IN); + break; + case NOTIN: + tgt.setValue(CodeSystem.FilterOperator.NOTIN); + break; + case GENERALIZES: + tgt.setValue(CodeSystem.FilterOperator.GENERALIZES); + break; + case EXISTS: + tgt.setValue(CodeSystem.FilterOperator.EXISTS); + break; + default: + tgt.setValue(CodeSystem.FilterOperator.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Communication30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Communication30_40.java index da212de937..52618c1605 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Communication30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Communication30_40.java @@ -6,6 +6,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.CodeableConcept30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.Identifier30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.DateTime30_40; +import org.hl7.fhir.dstu3.model.Communication; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; public class Communication30_40 { @@ -116,70 +118,78 @@ public static org.hl7.fhir.r4.model.Communication.CommunicationPayloadComponent } static public org.hl7.fhir.dstu3.model.Enumeration convertCommunicationStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Communication.CommunicationStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PREPARATION: - tgt.setValue(org.hl7.fhir.dstu3.model.Communication.CommunicationStatus.PREPARATION); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu3.model.Communication.CommunicationStatus.INPROGRESS); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.dstu3.model.Communication.CommunicationStatus.SUSPENDED); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.dstu3.model.Communication.CommunicationStatus.ABORTED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.Communication.CommunicationStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Communication.CommunicationStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu3.model.Communication.CommunicationStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Communication.CommunicationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Communication.CommunicationStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PREPARATION: + tgt.setValue(Communication.CommunicationStatus.PREPARATION); + break; + case INPROGRESS: + tgt.setValue(Communication.CommunicationStatus.INPROGRESS); + break; + case ONHOLD: + tgt.setValue(Communication.CommunicationStatus.SUSPENDED); + break; + case STOPPED: + tgt.setValue(Communication.CommunicationStatus.ABORTED); + break; + case COMPLETED: + tgt.setValue(Communication.CommunicationStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(Communication.CommunicationStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Communication.CommunicationStatus.UNKNOWN); + break; + default: + tgt.setValue(Communication.CommunicationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertCommunicationStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Communication.CommunicationStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PREPARATION: - tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationStatus.PREPARATION); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationStatus.INPROGRESS); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationStatus.ONHOLD); - break; - case ABORTED: - tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationStatus.STOPPED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Communication.CommunicationStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PREPARATION: + tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationStatus.PREPARATION); + break; + case INPROGRESS: + tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationStatus.INPROGRESS); + break; + case SUSPENDED: + tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationStatus.ONHOLD); + break; + case ABORTED: + tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationStatus.STOPPED); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/CompartmentDefinition30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/CompartmentDefinition30_40.java index 1779e6f17d..71af81edc4 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/CompartmentDefinition30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/CompartmentDefinition30_40.java @@ -11,6 +11,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Uri30_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.CompartmentDefinition; +import org.hl7.fhir.r4.model.Enumeration; public class CompartmentDefinition30_40 { @@ -117,58 +119,66 @@ public static org.hl7.fhir.dstu3.model.CompartmentDefinition.CompartmentDefiniti } static public org.hl7.fhir.r4.model.Enumeration convertCompartmentType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PATIENT: - tgt.setValue(org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.PATIENT); - break; - case ENCOUNTER: - tgt.setValue(org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.ENCOUNTER); - break; - case RELATEDPERSON: - tgt.setValue(org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.RELATEDPERSON); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.PRACTITIONER); - break; - case DEVICE: - tgt.setValue(org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.DEVICE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CompartmentDefinition.CompartmentTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PATIENT: + tgt.setValue(CompartmentDefinition.CompartmentType.PATIENT); + break; + case ENCOUNTER: + tgt.setValue(CompartmentDefinition.CompartmentType.ENCOUNTER); + break; + case RELATEDPERSON: + tgt.setValue(CompartmentDefinition.CompartmentType.RELATEDPERSON); + break; + case PRACTITIONER: + tgt.setValue(CompartmentDefinition.CompartmentType.PRACTITIONER); + break; + case DEVICE: + tgt.setValue(CompartmentDefinition.CompartmentType.DEVICE); + break; + default: + tgt.setValue(CompartmentDefinition.CompartmentType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertCompartmentType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CompartmentDefinition.CompartmentTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PATIENT: - tgt.setValue(org.hl7.fhir.dstu3.model.CompartmentDefinition.CompartmentType.PATIENT); - break; - case ENCOUNTER: - tgt.setValue(org.hl7.fhir.dstu3.model.CompartmentDefinition.CompartmentType.ENCOUNTER); - break; - case RELATEDPERSON: - tgt.setValue(org.hl7.fhir.dstu3.model.CompartmentDefinition.CompartmentType.RELATEDPERSON); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.dstu3.model.CompartmentDefinition.CompartmentType.PRACTITIONER); - break; - case DEVICE: - tgt.setValue(org.hl7.fhir.dstu3.model.CompartmentDefinition.CompartmentType.DEVICE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CompartmentDefinition.CompartmentType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CompartmentDefinition.CompartmentTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PATIENT: + tgt.setValue(org.hl7.fhir.dstu3.model.CompartmentDefinition.CompartmentType.PATIENT); + break; + case ENCOUNTER: + tgt.setValue(org.hl7.fhir.dstu3.model.CompartmentDefinition.CompartmentType.ENCOUNTER); + break; + case RELATEDPERSON: + tgt.setValue(org.hl7.fhir.dstu3.model.CompartmentDefinition.CompartmentType.RELATEDPERSON); + break; + case PRACTITIONER: + tgt.setValue(org.hl7.fhir.dstu3.model.CompartmentDefinition.CompartmentType.PRACTITIONER); + break; + case DEVICE: + tgt.setValue(org.hl7.fhir.dstu3.model.CompartmentDefinition.CompartmentType.DEVICE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.CompartmentDefinition.CompartmentType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Composition30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Composition30_40.java index e5821f0002..ef1fa23996 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Composition30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Composition30_40.java @@ -10,6 +10,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.Period30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.DateTime30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; +import org.hl7.fhir.dstu3.model.Composition; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; public class Composition30_40 { @@ -91,53 +93,61 @@ public static org.hl7.fhir.r4.model.Composition convertComposition(org.hl7.fhir. } static public org.hl7.fhir.dstu3.model.Enumeration convertCompositionAttestationMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Composition.CompositionAttestationModeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PERSONAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode.PERSONAL); - break; - case PROFESSIONAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode.PROFESSIONAL); - break; - case LEGAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode.LEGAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode.OFFICIAL); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Composition.CompositionAttestationModeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PERSONAL: + tgt.setValue(Composition.CompositionAttestationMode.PERSONAL); + break; + case PROFESSIONAL: + tgt.setValue(Composition.CompositionAttestationMode.PROFESSIONAL); + break; + case LEGAL: + tgt.setValue(Composition.CompositionAttestationMode.LEGAL); + break; + case OFFICIAL: + tgt.setValue(Composition.CompositionAttestationMode.OFFICIAL); + break; + default: + tgt.setValue(Composition.CompositionAttestationMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertCompositionAttestationMode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Composition.CompositionAttestationModeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PERSONAL: - tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionAttestationMode.PERSONAL); - break; - case PROFESSIONAL: - tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionAttestationMode.PROFESSIONAL); - break; - case LEGAL: - tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionAttestationMode.LEGAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionAttestationMode.OFFICIAL); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionAttestationMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Composition.CompositionAttestationModeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PERSONAL: + tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionAttestationMode.PERSONAL); + break; + case PROFESSIONAL: + tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionAttestationMode.PROFESSIONAL); + break; + case LEGAL: + tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionAttestationMode.LEGAL); + break; + case OFFICIAL: + tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionAttestationMode.OFFICIAL); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionAttestationMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.Composition.CompositionAttesterComponent convertCompositionAttesterComponent(org.hl7.fhir.r4.model.Composition.CompositionAttesterComponent src) throws FHIRException { @@ -221,115 +231,131 @@ public static org.hl7.fhir.dstu3.model.Composition.CompositionRelatesToComponent } static public org.hl7.fhir.r4.model.Enumeration convertCompositionStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Composition.CompositionStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionStatus.AMENDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Composition.CompositionStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRELIMINARY: + tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionStatus.FINAL); + break; + case AMENDED: + tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionStatus.AMENDED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertCompositionStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Composition.CompositionStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionStatus.AMENDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Composition.CompositionStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRELIMINARY: + tgt.setValue(Composition.CompositionStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(Composition.CompositionStatus.FINAL); + break; + case AMENDED: + tgt.setValue(Composition.CompositionStatus.AMENDED); + break; + case ENTEREDINERROR: + tgt.setValue(Composition.CompositionStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Composition.CompositionStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertDocumentConfidentiality(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Composition.DocumentConfidentialityEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case U: - tgt.setValue(org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.U); - break; - case L: - tgt.setValue(org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.L); - break; - case M: - tgt.setValue(org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.M); - break; - case N: - tgt.setValue(org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.N); - break; - case R: - tgt.setValue(org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.R); - break; - case V: - tgt.setValue(org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.V); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Composition.DocumentConfidentialityEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case U: + tgt.setValue(org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.U); + break; + case L: + tgt.setValue(org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.L); + break; + case M: + tgt.setValue(org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.M); + break; + case N: + tgt.setValue(org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.N); + break; + case R: + tgt.setValue(org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.R); + break; + case V: + tgt.setValue(org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.V); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertDocumentConfidentiality(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Composition.DocumentConfidentialityEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case U: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.DocumentConfidentiality.U); - break; - case L: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.DocumentConfidentiality.L); - break; - case M: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.DocumentConfidentiality.M); - break; - case N: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.DocumentConfidentiality.N); - break; - case R: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.DocumentConfidentiality.R); - break; - case V: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.DocumentConfidentiality.V); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.DocumentConfidentiality.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Composition.DocumentConfidentialityEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case U: + tgt.setValue(Composition.DocumentConfidentiality.U); + break; + case L: + tgt.setValue(Composition.DocumentConfidentiality.L); + break; + case M: + tgt.setValue(Composition.DocumentConfidentiality.M); + break; + case N: + tgt.setValue(Composition.DocumentConfidentiality.N); + break; + case R: + tgt.setValue(Composition.DocumentConfidentiality.R); + break; + case V: + tgt.setValue(Composition.DocumentConfidentiality.V); + break; + default: + tgt.setValue(Composition.DocumentConfidentiality.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.Composition.SectionComponent convertSectionComponent(org.hl7.fhir.r4.model.Composition.SectionComponent src) throws FHIRException { @@ -381,97 +407,113 @@ public static org.hl7.fhir.r4.model.Composition.SectionComponent convertSectionC } static public org.hl7.fhir.r4.model.Enumeration convertSectionMode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Composition.SectionModeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case WORKING: - tgt.setValue(org.hl7.fhir.r4.model.Composition.SectionMode.WORKING); - break; - case SNAPSHOT: - tgt.setValue(org.hl7.fhir.r4.model.Composition.SectionMode.SNAPSHOT); - break; - case CHANGES: - tgt.setValue(org.hl7.fhir.r4.model.Composition.SectionMode.CHANGES); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Composition.SectionMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Composition.SectionModeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case WORKING: + tgt.setValue(org.hl7.fhir.r4.model.Composition.SectionMode.WORKING); + break; + case SNAPSHOT: + tgt.setValue(org.hl7.fhir.r4.model.Composition.SectionMode.SNAPSHOT); + break; + case CHANGES: + tgt.setValue(org.hl7.fhir.r4.model.Composition.SectionMode.CHANGES); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Composition.SectionMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertSectionMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Composition.SectionModeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case WORKING: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.SectionMode.WORKING); - break; - case SNAPSHOT: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.SectionMode.SNAPSHOT); - break; - case CHANGES: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.SectionMode.CHANGES); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.SectionMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Composition.SectionModeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case WORKING: + tgt.setValue(Composition.SectionMode.WORKING); + break; + case SNAPSHOT: + tgt.setValue(Composition.SectionMode.SNAPSHOT); + break; + case CHANGES: + tgt.setValue(Composition.SectionMode.CHANGES); + break; + default: + tgt.setValue(Composition.SectionMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertDocumentRelationshipType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Composition.DocumentRelationshipTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case REPLACES: - tgt.setValue(org.hl7.fhir.r4.model.Composition.DocumentRelationshipType.REPLACES); - break; - case TRANSFORMS: - tgt.setValue(org.hl7.fhir.r4.model.Composition.DocumentRelationshipType.TRANSFORMS); - break; - case SIGNS: - tgt.setValue(org.hl7.fhir.r4.model.Composition.DocumentRelationshipType.SIGNS); - break; - case APPENDS: - tgt.setValue(org.hl7.fhir.r4.model.Composition.DocumentRelationshipType.APPENDS); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Composition.DocumentRelationshipType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Composition.DocumentRelationshipTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REPLACES: + tgt.setValue(org.hl7.fhir.r4.model.Composition.DocumentRelationshipType.REPLACES); + break; + case TRANSFORMS: + tgt.setValue(org.hl7.fhir.r4.model.Composition.DocumentRelationshipType.TRANSFORMS); + break; + case SIGNS: + tgt.setValue(org.hl7.fhir.r4.model.Composition.DocumentRelationshipType.SIGNS); + break; + case APPENDS: + tgt.setValue(org.hl7.fhir.r4.model.Composition.DocumentRelationshipType.APPENDS); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Composition.DocumentRelationshipType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertDocumentRelationshipType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Composition.DocumentRelationshipTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case REPLACES: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.DocumentRelationshipType.REPLACES); - break; - case TRANSFORMS: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.DocumentRelationshipType.TRANSFORMS); - break; - case SIGNS: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.DocumentRelationshipType.SIGNS); - break; - case APPENDS: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.DocumentRelationshipType.APPENDS); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.DocumentRelationshipType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Composition.DocumentRelationshipTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REPLACES: + tgt.setValue(Composition.DocumentRelationshipType.REPLACES); + break; + case TRANSFORMS: + tgt.setValue(Composition.DocumentRelationshipType.TRANSFORMS); + break; + case SIGNS: + tgt.setValue(Composition.DocumentRelationshipType.SIGNS); + break; + case APPENDS: + tgt.setValue(Composition.DocumentRelationshipType.APPENDS); + break; + default: + tgt.setValue(Composition.DocumentRelationshipType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/ConceptMap30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/ConceptMap30_40.java index 7582683d73..37bd2dbf96 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/ConceptMap30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/ConceptMap30_40.java @@ -11,7 +11,10 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.MarkDown30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Uri30_40; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.Enumerations; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.ConceptMap; public class ConceptMap30_40 { @@ -108,89 +111,97 @@ public static org.hl7.fhir.r4.model.ConceptMap convertConceptMap(org.hl7.fhir.ds } static public org.hl7.fhir.dstu3.model.Enumeration convertConceptMapEquivalence(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalenceEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case RELATEDTO: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.RELATEDTO); - break; - case EQUIVALENT: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.EQUIVALENT); - break; - case EQUAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.EQUAL); - break; - case WIDER: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.WIDER); - break; - case SUBSUMES: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.SUBSUMES); - break; - case NARROWER: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.NARROWER); - break; - case SPECIALIZES: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.SPECIALIZES); - break; - case INEXACT: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.INEXACT); - break; - case UNMATCHED: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.UNMATCHED); - break; - case DISJOINT: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.DISJOINT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ConceptMapEquivalenceEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case RELATEDTO: + tgt.setValue(Enumerations.ConceptMapEquivalence.RELATEDTO); + break; + case EQUIVALENT: + tgt.setValue(Enumerations.ConceptMapEquivalence.EQUIVALENT); + break; + case EQUAL: + tgt.setValue(Enumerations.ConceptMapEquivalence.EQUAL); + break; + case WIDER: + tgt.setValue(Enumerations.ConceptMapEquivalence.WIDER); + break; + case SUBSUMES: + tgt.setValue(Enumerations.ConceptMapEquivalence.SUBSUMES); + break; + case NARROWER: + tgt.setValue(Enumerations.ConceptMapEquivalence.NARROWER); + break; + case SPECIALIZES: + tgt.setValue(Enumerations.ConceptMapEquivalence.SPECIALIZES); + break; + case INEXACT: + tgt.setValue(Enumerations.ConceptMapEquivalence.INEXACT); + break; + case UNMATCHED: + tgt.setValue(Enumerations.ConceptMapEquivalence.UNMATCHED); + break; + case DISJOINT: + tgt.setValue(Enumerations.ConceptMapEquivalence.DISJOINT); + break; + default: + tgt.setValue(Enumerations.ConceptMapEquivalence.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertConceptMapEquivalence(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalenceEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case RELATEDTO: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.RELATEDTO); - break; - case EQUIVALENT: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.EQUIVALENT); - break; - case EQUAL: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.EQUAL); - break; - case WIDER: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.WIDER); - break; - case SUBSUMES: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.SUBSUMES); - break; - case NARROWER: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.NARROWER); - break; - case SPECIALIZES: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.SPECIALIZES); - break; - case INEXACT: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.INEXACT); - break; - case UNMATCHED: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.UNMATCHED); - break; - case DISJOINT: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.DISJOINT); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalenceEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case RELATEDTO: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.RELATEDTO); + break; + case EQUIVALENT: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.EQUIVALENT); + break; + case EQUAL: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.EQUAL); + break; + case WIDER: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.WIDER); + break; + case SUBSUMES: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.SUBSUMES); + break; + case NARROWER: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.NARROWER); + break; + case SPECIALIZES: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.SPECIALIZES); + break; + case INEXACT: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.INEXACT); + break; + case UNMATCHED: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.UNMATCHED); + break; + case DISJOINT: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.DISJOINT); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupComponent convertConceptMapGroupComponent(org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupComponent src) throws FHIRException { @@ -266,47 +277,55 @@ public static org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedCompone } static public org.hl7.fhir.r4.model.Enumeration convertConceptMapGroupUnmappedMode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedModeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PROVIDED: - tgt.setValue(org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode.PROVIDED); - break; - case FIXED: - tgt.setValue(org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode.FIXED); - break; - case OTHERMAP: - tgt.setValue(org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode.OTHERMAP); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new ConceptMap.ConceptMapGroupUnmappedModeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROVIDED: + tgt.setValue(ConceptMap.ConceptMapGroupUnmappedMode.PROVIDED); + break; + case FIXED: + tgt.setValue(ConceptMap.ConceptMapGroupUnmappedMode.FIXED); + break; + case OTHERMAP: + tgt.setValue(ConceptMap.ConceptMapGroupUnmappedMode.OTHERMAP); + break; + default: + tgt.setValue(ConceptMap.ConceptMapGroupUnmappedMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertConceptMapGroupUnmappedMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedModeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PROVIDED: - tgt.setValue(org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedMode.PROVIDED); - break; - case FIXED: - tgt.setValue(org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedMode.FIXED); - break; - case OTHERMAP: - tgt.setValue(org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedMode.OTHERMAP); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedModeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROVIDED: + tgt.setValue(org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedMode.PROVIDED); + break; + case FIXED: + tgt.setValue(org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedMode.FIXED); + break; + case OTHERMAP: + tgt.setValue(org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedMode.OTHERMAP); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent convertOtherElementComponent(org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Consent30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Consent30_40.java index 41dec2516f..262f4fb308 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Consent30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Consent30_40.java @@ -13,6 +13,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Uri30_40; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4.model.CodeableConcept; +import org.hl7.fhir.r4.model.Consent; +import org.hl7.fhir.r4.model.Enumeration; import org.hl7.fhir.r4.model.Identifier; public class Consent30_40 { @@ -172,91 +174,107 @@ static public org.hl7.fhir.dstu3.model.Consent.ConsentDataComponent convertConse } static public org.hl7.fhir.r4.model.Enumeration convertConsentDataMeaning(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Consent.ConsentDataMeaningEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.r4.model.Consent.ConsentDataMeaning.INSTANCE); - break; - case RELATED: - tgt.setValue(org.hl7.fhir.r4.model.Consent.ConsentDataMeaning.RELATED); - break; - case DEPENDENTS: - tgt.setValue(org.hl7.fhir.r4.model.Consent.ConsentDataMeaning.DEPENDENTS); - break; - case AUTHOREDBY: - tgt.setValue(org.hl7.fhir.r4.model.Consent.ConsentDataMeaning.AUTHOREDBY); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Consent.ConsentDataMeaning.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Consent.ConsentDataMeaningEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(Consent.ConsentDataMeaning.INSTANCE); + break; + case RELATED: + tgt.setValue(Consent.ConsentDataMeaning.RELATED); + break; + case DEPENDENTS: + tgt.setValue(Consent.ConsentDataMeaning.DEPENDENTS); + break; + case AUTHOREDBY: + tgt.setValue(Consent.ConsentDataMeaning.AUTHOREDBY); + break; + default: + tgt.setValue(Consent.ConsentDataMeaning.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertConsentDataMeaning(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Consent.ConsentDataMeaningEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.dstu3.model.Consent.ConsentDataMeaning.INSTANCE); - break; - case RELATED: - tgt.setValue(org.hl7.fhir.dstu3.model.Consent.ConsentDataMeaning.RELATED); - break; - case DEPENDENTS: - tgt.setValue(org.hl7.fhir.dstu3.model.Consent.ConsentDataMeaning.DEPENDENTS); - break; - case AUTHOREDBY: - tgt.setValue(org.hl7.fhir.dstu3.model.Consent.ConsentDataMeaning.AUTHOREDBY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Consent.ConsentDataMeaning.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Consent.ConsentDataMeaningEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(org.hl7.fhir.dstu3.model.Consent.ConsentDataMeaning.INSTANCE); + break; + case RELATED: + tgt.setValue(org.hl7.fhir.dstu3.model.Consent.ConsentDataMeaning.RELATED); + break; + case DEPENDENTS: + tgt.setValue(org.hl7.fhir.dstu3.model.Consent.ConsentDataMeaning.DEPENDENTS); + break; + case AUTHOREDBY: + tgt.setValue(org.hl7.fhir.dstu3.model.Consent.ConsentDataMeaning.AUTHOREDBY); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Consent.ConsentDataMeaning.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertConsentExceptType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Consent.ConsentProvisionTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case DENY: - tgt.setValue(org.hl7.fhir.r4.model.Consent.ConsentProvisionType.DENY); - break; - case PERMIT: - tgt.setValue(org.hl7.fhir.r4.model.Consent.ConsentProvisionType.PERMIT); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Consent.ConsentProvisionType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Consent.ConsentProvisionTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DENY: + tgt.setValue(Consent.ConsentProvisionType.DENY); + break; + case PERMIT: + tgt.setValue(Consent.ConsentProvisionType.PERMIT); + break; + default: + tgt.setValue(Consent.ConsentProvisionType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertConsentExceptType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Consent.ConsentExceptTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case DENY: - tgt.setValue(org.hl7.fhir.dstu3.model.Consent.ConsentExceptType.DENY); - break; - case PERMIT: - tgt.setValue(org.hl7.fhir.dstu3.model.Consent.ConsentExceptType.PERMIT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Consent.ConsentExceptType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Consent.ConsentExceptTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DENY: + tgt.setValue(org.hl7.fhir.dstu3.model.Consent.ConsentExceptType.DENY); + break; + case PERMIT: + tgt.setValue(org.hl7.fhir.dstu3.model.Consent.ConsentExceptType.PERMIT); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Consent.ConsentExceptType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Consent.ConsentPolicyComponent convertConsentPolicyComponent(org.hl7.fhir.r4.model.Consent.ConsentPolicyComponent src) throws FHIRException { @@ -284,65 +302,73 @@ static public org.hl7.fhir.r4.model.Consent.ConsentPolicyComponent convertConsen } static public org.hl7.fhir.dstu3.model.Enumeration convertConsentState(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Consent.ConsentStateEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.dstu3.model.Consent.ConsentState.DRAFT); - break; - case PROPOSED: - tgt.setValue(org.hl7.fhir.dstu3.model.Consent.ConsentState.PROPOSED); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Consent.ConsentState.ACTIVE); - break; - case REJECTED: - tgt.setValue(org.hl7.fhir.dstu3.model.Consent.ConsentState.REJECTED); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Consent.ConsentState.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Consent.ConsentState.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Consent.ConsentState.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Consent.ConsentStateEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(org.hl7.fhir.dstu3.model.Consent.ConsentState.DRAFT); + break; + case PROPOSED: + tgt.setValue(org.hl7.fhir.dstu3.model.Consent.ConsentState.PROPOSED); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu3.model.Consent.ConsentState.ACTIVE); + break; + case REJECTED: + tgt.setValue(org.hl7.fhir.dstu3.model.Consent.ConsentState.REJECTED); + break; + case INACTIVE: + tgt.setValue(org.hl7.fhir.dstu3.model.Consent.ConsentState.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu3.model.Consent.ConsentState.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Consent.ConsentState.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertConsentState(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Consent.ConsentStateEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r4.model.Consent.ConsentState.DRAFT); - break; - case PROPOSED: - tgt.setValue(org.hl7.fhir.r4.model.Consent.ConsentState.PROPOSED); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Consent.ConsentState.ACTIVE); - break; - case REJECTED: - tgt.setValue(org.hl7.fhir.r4.model.Consent.ConsentState.REJECTED); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Consent.ConsentState.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Consent.ConsentState.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Consent.ConsentState.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Consent.ConsentStateEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(Consent.ConsentState.DRAFT); + break; + case PROPOSED: + tgt.setValue(Consent.ConsentState.PROPOSED); + break; + case ACTIVE: + tgt.setValue(Consent.ConsentState.ACTIVE); + break; + case REJECTED: + tgt.setValue(Consent.ConsentState.REJECTED); + break; + case INACTIVE: + tgt.setValue(Consent.ConsentState.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(Consent.ConsentState.ENTEREDINERROR); + break; + default: + tgt.setValue(Consent.ConsentState.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Consent.ExceptActorComponent convertExceptActorComponent(org.hl7.fhir.r4.model.Consent.provisionActorComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Coverage30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Coverage30_40.java index 6a54d11479..0954685842 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Coverage30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Coverage30_40.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.Period30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.PositiveInt30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; +import org.hl7.fhir.dstu3.model.Coverage; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; /* @@ -110,53 +112,61 @@ public static org.hl7.fhir.r4.model.Coverage convertCoverage(org.hl7.fhir.dstu3. } static public org.hl7.fhir.dstu3.model.Enumeration convertCoverageStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Coverage.CoverageStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Coverage.CoverageStatus.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu3.model.Coverage.CoverageStatus.CANCELLED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.dstu3.model.Coverage.CoverageStatus.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Coverage.CoverageStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Coverage.CoverageStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Coverage.CoverageStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Coverage.CoverageStatus.ACTIVE); + break; + case CANCELLED: + tgt.setValue(Coverage.CoverageStatus.CANCELLED); + break; + case DRAFT: + tgt.setValue(Coverage.CoverageStatus.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(Coverage.CoverageStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Coverage.CoverageStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertCoverageStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Coverage.CoverageStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Coverage.CoverageStatus.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.Coverage.CoverageStatus.CANCELLED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r4.model.Coverage.CoverageStatus.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Coverage.CoverageStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Coverage.CoverageStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Coverage.CoverageStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4.model.Coverage.CoverageStatus.ACTIVE); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4.model.Coverage.CoverageStatus.CANCELLED); + break; + case DRAFT: + tgt.setValue(org.hl7.fhir.r4.model.Coverage.CoverageStatus.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.Coverage.CoverageStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Coverage.CoverageStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/DetectedIssue30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/DetectedIssue30_40.java index 284cf051f3..36afe40892 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/DetectedIssue30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/DetectedIssue30_40.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Uri30_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.DetectedIssue; +import org.hl7.fhir.r4.model.Enumeration; public class DetectedIssue30_40 { @@ -99,120 +101,136 @@ public static org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueMitigationComp } static public org.hl7.fhir.r4.model.Enumeration convertDetectedIssueSeverity(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverityEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case HIGH: - tgt.setValue(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverity.HIGH); - break; - case MODERATE: - tgt.setValue(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverity.MODERATE); - break; - case LOW: - tgt.setValue(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverity.LOW); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverity.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DetectedIssue.DetectedIssueSeverityEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case HIGH: + tgt.setValue(DetectedIssue.DetectedIssueSeverity.HIGH); + break; + case MODERATE: + tgt.setValue(DetectedIssue.DetectedIssueSeverity.MODERATE); + break; + case LOW: + tgt.setValue(DetectedIssue.DetectedIssueSeverity.LOW); + break; + default: + tgt.setValue(DetectedIssue.DetectedIssueSeverity.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertDetectedIssueSeverity(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueSeverityEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case HIGH: - tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueSeverity.HIGH); - break; - case MODERATE: - tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueSeverity.MODERATE); - break; - case LOW: - tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueSeverity.LOW); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueSeverity.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueSeverityEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case HIGH: + tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueSeverity.HIGH); + break; + case MODERATE: + tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueSeverity.MODERATE); + break; + case LOW: + tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueSeverity.LOW); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueSeverity.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertDetectedIssueStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.REGISTERED); - break; - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.AMENDED); - break; - case CORRECTED: - tgt.setValue(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.CORRECTED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DetectedIssue.DetectedIssueStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(DetectedIssue.DetectedIssueStatus.REGISTERED); + break; + case PRELIMINARY: + tgt.setValue(DetectedIssue.DetectedIssueStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(DetectedIssue.DetectedIssueStatus.FINAL); + break; + case AMENDED: + tgt.setValue(DetectedIssue.DetectedIssueStatus.AMENDED); + break; + case CORRECTED: + tgt.setValue(DetectedIssue.DetectedIssueStatus.CORRECTED); + break; + case CANCELLED: + tgt.setValue(DetectedIssue.DetectedIssueStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(DetectedIssue.DetectedIssueStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(DetectedIssue.DetectedIssueStatus.UNKNOWN); + break; + default: + tgt.setValue(DetectedIssue.DetectedIssueStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertDetectedIssueStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueStatus.REGISTERED); - break; - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueStatus.AMENDED); - break; - case CORRECTED: - tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueStatus.CORRECTED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueStatus.REGISTERED); + break; + case PRELIMINARY: + tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueStatus.FINAL); + break; + case AMENDED: + tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueStatus.AMENDED); + break; + case CORRECTED: + tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueStatus.CORRECTED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Device30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Device30_40.java index e2d639fda1..2ff1855510 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Device30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Device30_40.java @@ -16,6 +16,7 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Uri30_40; import org.hl7.fhir.dstu3.model.Device; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Enumeration; /* Copyright (c) 2011+, HL7, Inc. @@ -156,114 +157,130 @@ public static org.hl7.fhir.dstu3.model.Device convertDevice(org.hl7.fhir.r4.mode } static public org.hl7.fhir.r4.model.Enumeration convertFHIRDeviceStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Device.FHIRDeviceStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Device.FHIRDeviceStatus.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Device.FHIRDeviceStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Device.FHIRDeviceStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.Device.FHIRDeviceStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Device.FHIRDeviceStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new org.hl7.fhir.r4.model.Device.FHIRDeviceStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4.model.Device.FHIRDeviceStatus.ACTIVE); + break; + case INACTIVE: + tgt.setValue(org.hl7.fhir.r4.model.Device.FHIRDeviceStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.Device.FHIRDeviceStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4.model.Device.FHIRDeviceStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Device.FHIRDeviceStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertFHIRDeviceStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Device.FHIRDeviceStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Device.FHIRDeviceStatus.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Device.FHIRDeviceStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Device.FHIRDeviceStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu3.model.Device.FHIRDeviceStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Device.FHIRDeviceStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new Device.FHIRDeviceStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Device.FHIRDeviceStatus.ACTIVE); + break; + case INACTIVE: + tgt.setValue(Device.FHIRDeviceStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(Device.FHIRDeviceStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Device.FHIRDeviceStatus.UNKNOWN); + break; + default: + tgt.setValue(Device.FHIRDeviceStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertUDIEntryType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Device.UDIEntryTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case BARCODE: - tgt.setValue(org.hl7.fhir.r4.model.Device.UDIEntryType.BARCODE); - break; - case RFID: - tgt.setValue(org.hl7.fhir.r4.model.Device.UDIEntryType.RFID); - break; - case MANUAL: - tgt.setValue(org.hl7.fhir.r4.model.Device.UDIEntryType.MANUAL); - break; - case CARD: - tgt.setValue(org.hl7.fhir.r4.model.Device.UDIEntryType.CARD); - break; - case SELFREPORTED: - tgt.setValue(org.hl7.fhir.r4.model.Device.UDIEntryType.SELFREPORTED); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.Device.UDIEntryType.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Device.UDIEntryType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new org.hl7.fhir.r4.model.Device.UDIEntryTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case BARCODE: + tgt.setValue(org.hl7.fhir.r4.model.Device.UDIEntryType.BARCODE); + break; + case RFID: + tgt.setValue(org.hl7.fhir.r4.model.Device.UDIEntryType.RFID); + break; + case MANUAL: + tgt.setValue(org.hl7.fhir.r4.model.Device.UDIEntryType.MANUAL); + break; + case CARD: + tgt.setValue(org.hl7.fhir.r4.model.Device.UDIEntryType.CARD); + break; + case SELFREPORTED: + tgt.setValue(org.hl7.fhir.r4.model.Device.UDIEntryType.SELFREPORTED); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4.model.Device.UDIEntryType.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Device.UDIEntryType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertUDIEntryType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Device.UDIEntryTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case BARCODE: - tgt.setValue(org.hl7.fhir.dstu3.model.Device.UDIEntryType.BARCODE); - break; - case RFID: - tgt.setValue(org.hl7.fhir.dstu3.model.Device.UDIEntryType.RFID); - break; - case MANUAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Device.UDIEntryType.MANUAL); - break; - case CARD: - tgt.setValue(org.hl7.fhir.dstu3.model.Device.UDIEntryType.CARD); - break; - case SELFREPORTED: - tgt.setValue(org.hl7.fhir.dstu3.model.Device.UDIEntryType.SELFREPORTED); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu3.model.Device.UDIEntryType.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Device.UDIEntryType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new Device.UDIEntryTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case BARCODE: + tgt.setValue(Device.UDIEntryType.BARCODE); + break; + case RFID: + tgt.setValue(Device.UDIEntryType.RFID); + break; + case MANUAL: + tgt.setValue(Device.UDIEntryType.MANUAL); + break; + case CARD: + tgt.setValue(Device.UDIEntryType.CARD); + break; + case SELFREPORTED: + tgt.setValue(Device.UDIEntryType.SELFREPORTED); + break; + case UNKNOWN: + tgt.setValue(Device.UDIEntryType.UNKNOWN); + break; + default: + tgt.setValue(Device.UDIEntryType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/DeviceUseStatement30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/DeviceUseStatement30_40.java index 869861a965..f7c2f067a5 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/DeviceUseStatement30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/DeviceUseStatement30_40.java @@ -7,6 +7,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.Identifier30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.DateTime30_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.DeviceUseStatement; +import org.hl7.fhir.r4.model.Enumeration; public class DeviceUseStatement30_40 { @@ -65,64 +67,72 @@ public static org.hl7.fhir.dstu3.model.DeviceUseStatement convertDeviceUseStatem } static public org.hl7.fhir.r4.model.Enumeration convertDeviceUseStatementStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatus.ACTIVE); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatus.ENTEREDINERROR); - break; - case INTENDED: - tgt.setValue(org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatus.INTENDED); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatus.STOPPED); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatus.ONHOLD); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DeviceUseStatement.DeviceUseStatementStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(DeviceUseStatement.DeviceUseStatementStatus.ACTIVE); + break; + case COMPLETED: + tgt.setValue(DeviceUseStatement.DeviceUseStatementStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(DeviceUseStatement.DeviceUseStatementStatus.ENTEREDINERROR); + break; + case INTENDED: + tgt.setValue(DeviceUseStatement.DeviceUseStatementStatus.INTENDED); + break; + case STOPPED: + tgt.setValue(DeviceUseStatement.DeviceUseStatementStatus.STOPPED); + break; + case ONHOLD: + tgt.setValue(DeviceUseStatement.DeviceUseStatementStatus.ONHOLD); + break; + default: + tgt.setValue(DeviceUseStatement.DeviceUseStatementStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertDeviceUseStatementStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DeviceUseStatement.DeviceUseStatementStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceUseStatement.DeviceUseStatementStatus.ACTIVE); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceUseStatement.DeviceUseStatementStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceUseStatement.DeviceUseStatementStatus.ENTEREDINERROR); - break; - case INTENDED: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceUseStatement.DeviceUseStatementStatus.INTENDED); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceUseStatement.DeviceUseStatementStatus.STOPPED); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceUseStatement.DeviceUseStatementStatus.ONHOLD); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceUseStatement.DeviceUseStatementStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DeviceUseStatement.DeviceUseStatementStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu3.model.DeviceUseStatement.DeviceUseStatementStatus.ACTIVE); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.dstu3.model.DeviceUseStatement.DeviceUseStatementStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu3.model.DeviceUseStatement.DeviceUseStatementStatus.ENTEREDINERROR); + break; + case INTENDED: + tgt.setValue(org.hl7.fhir.dstu3.model.DeviceUseStatement.DeviceUseStatementStatus.INTENDED); + break; + case STOPPED: + tgt.setValue(org.hl7.fhir.dstu3.model.DeviceUseStatement.DeviceUseStatementStatus.STOPPED); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.dstu3.model.DeviceUseStatement.DeviceUseStatementStatus.ONHOLD); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.DeviceUseStatement.DeviceUseStatementStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/DiagnosticReport30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/DiagnosticReport30_40.java index 26d5a8d193..92ee08479d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/DiagnosticReport30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/DiagnosticReport30_40.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Instant30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.DiagnosticReport; +import org.hl7.fhir.r4.model.Enumeration; public class DiagnosticReport30_40 { @@ -110,88 +112,96 @@ public static org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportImageCom } static public org.hl7.fhir.r4.model.Enumeration convertDiagnosticReportStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.REGISTERED); - break; - case PARTIAL: - tgt.setValue(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.PARTIAL); - break; - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.AMENDED); - break; - case CORRECTED: - tgt.setValue(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.CORRECTED); - break; - case APPENDED: - tgt.setValue(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.APPENDED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DiagnosticReport.DiagnosticReportStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.REGISTERED); + break; + case PARTIAL: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.PARTIAL); + break; + case PRELIMINARY: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.FINAL); + break; + case AMENDED: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.AMENDED); + break; + case CORRECTED: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.CORRECTED); + break; + case APPENDED: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.APPENDED); + break; + case CANCELLED: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.UNKNOWN); + break; + default: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertDiagnosticReportStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.REGISTERED); - break; - case PARTIAL: - tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.PARTIAL); - break; - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.AMENDED); - break; - case CORRECTED: - tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.CORRECTED); - break; - case APPENDED: - tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.APPENDED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.REGISTERED); + break; + case PARTIAL: + tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.PARTIAL); + break; + case PRELIMINARY: + tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.FINAL); + break; + case AMENDED: + tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.AMENDED); + break; + case CORRECTED: + tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.CORRECTED); + break; + case APPENDED: + tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.APPENDED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/DocumentReference30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/DocumentReference30_40.java index c52abbec39..365c887240 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/DocumentReference30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/DocumentReference30_40.java @@ -8,6 +8,9 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.Identifier30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.Period30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; +import org.hl7.fhir.dstu3.model.DocumentReference; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.Enumerations; import org.hl7.fhir.exceptions.FHIRException; public class DocumentReference30_40 { @@ -214,21 +217,25 @@ public static org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceRelate static public org.hl7.fhir.dstu3.model.Enumeration convertDocumentReferenceStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { if (src == null || src.isEmpty()) return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatusEnumFactory()); + Enumeration tgt = new Enumeration<>(new Enumerations.DocumentReferenceStatusEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case CURRENT: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatus.CURRENT); - break; - case SUPERSEDED: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatus.SUPERSEDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatus.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CURRENT: + tgt.setValue(Enumerations.DocumentReferenceStatus.CURRENT); + break; + case SUPERSEDED: + tgt.setValue(Enumerations.DocumentReferenceStatus.SUPERSEDED); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.DocumentReferenceStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Enumerations.DocumentReferenceStatus.NULL); + break; + } } return tgt; } @@ -238,19 +245,23 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatusEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case CURRENT: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.CURRENT); - break; - case SUPERSEDED: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.SUPERSEDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CURRENT: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.CURRENT); + break; + case SUPERSEDED: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.SUPERSEDED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.NULL); + break; + } } return tgt; } @@ -272,23 +283,27 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatusEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatus.AMENDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatus.NULL); - break; - } + if (src.getValue() == null) { + tgt.setValue(null); +} else { + switch(src.getValue()) { + case PRELIMINARY: + tgt.setValue(DocumentReference.ReferredDocumentStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(DocumentReference.ReferredDocumentStatus.FINAL); + break; + case AMENDED: + tgt.setValue(DocumentReference.ReferredDocumentStatus.AMENDED); + break; + case ENTEREDINERROR: + tgt.setValue(DocumentReference.ReferredDocumentStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(DocumentReference.ReferredDocumentStatus.NULL); + break; + } +} return tgt; } @@ -297,79 +312,83 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatusEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus.AMENDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus.NULL); - break; - } - return tgt; - } - - static public org.hl7.fhir.r4.model.Enumeration convertDocumentRelationshipType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.NULL); + tgt.setValue(null); } else { switch (src.getValue()) { - case REPLACES: - tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.REPLACES); + case PRELIMINARY: + tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus.PRELIMINARY); break; - case TRANSFORMS: - tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.TRANSFORMS); + case FINAL: + tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus.FINAL); break; - case SIGNS: - tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.SIGNS); + case AMENDED: + tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus.AMENDED); break; - case APPENDS: - tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.APPENDS); + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus.ENTEREDINERROR); break; default: - tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.NULL); + tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus.NULL); break; } } return tgt; } + static public org.hl7.fhir.r4.model.Enumeration convertDocumentRelationshipType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { + if (src == null || src.isEmpty()) return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); +} else { + switch(src.getValue()) { + case REPLACES: + tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.REPLACES); + break; + case TRANSFORMS: + tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.TRANSFORMS); + break; + case SIGNS: + tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.SIGNS); + break; + case APPENDS: + tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.APPENDS); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.NULL); + break; + } +} + return tgt; + } + static public org.hl7.fhir.dstu3.model.Enumeration convertDocumentRelationshipType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipTypeEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case REPLACES: - tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType.REPLACES); - break; - case TRANSFORMS: - tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType.TRANSFORMS); - break; - case SIGNS: - tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType.SIGNS); - break; - case APPENDS: - tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType.APPENDS); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType.NULL); - break; - } - } + tgt.setValue(DocumentReference.DocumentRelationshipType.REPLACES); + break; + case TRANSFORMS: + tgt.setValue(DocumentReference.DocumentRelationshipType.TRANSFORMS); + break; + case SIGNS: + tgt.setValue(DocumentReference.DocumentRelationshipType.SIGNS); + break; + case APPENDS: + tgt.setValue(DocumentReference.DocumentRelationshipType.APPENDS); + break; + default: + tgt.setValue(DocumentReference.DocumentRelationshipType.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Encounter30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Encounter30_40.java index d5dc275475..7f3cb6cac3 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Encounter30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Encounter30_40.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.Identifier30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.Period30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.PositiveInt30_40; +import org.hl7.fhir.dstu3.model.Encounter; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; public class Encounter30_40 { @@ -215,53 +217,61 @@ public static org.hl7.fhir.dstu3.model.Encounter.EncounterLocationComponent conv } static public org.hl7.fhir.dstu3.model.Enumeration convertEncounterLocationStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Encounter.EncounterLocationStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterLocationStatus.PLANNED); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterLocationStatus.ACTIVE); - break; - case RESERVED: - tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterLocationStatus.RESERVED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterLocationStatus.COMPLETED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterLocationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Encounter.EncounterLocationStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(Encounter.EncounterLocationStatus.PLANNED); + break; + case ACTIVE: + tgt.setValue(Encounter.EncounterLocationStatus.ACTIVE); + break; + case RESERVED: + tgt.setValue(Encounter.EncounterLocationStatus.RESERVED); + break; + case COMPLETED: + tgt.setValue(Encounter.EncounterLocationStatus.COMPLETED); + break; + default: + tgt.setValue(Encounter.EncounterLocationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertEncounterLocationStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Encounter.EncounterLocationStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus.PLANNED); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus.ACTIVE); - break; - case RESERVED: - tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus.RESERVED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus.COMPLETED); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Encounter.EncounterLocationStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus.PLANNED); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus.ACTIVE); + break; + case RESERVED: + tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus.RESERVED); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus.COMPLETED); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.Encounter.EncounterParticipantComponent convertEncounterParticipantComponent(org.hl7.fhir.r4.model.Encounter.EncounterParticipantComponent src) throws FHIRException { @@ -293,83 +303,91 @@ public static org.hl7.fhir.r4.model.Encounter.EncounterParticipantComponent conv } static public org.hl7.fhir.r4.model.Enumeration convertEncounterStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Encounter.EncounterStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterStatus.PLANNED); - break; - case ARRIVED: - tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterStatus.ARRIVED); - break; - case TRIAGED: - tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterStatus.TRIAGED); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterStatus.INPROGRESS); - break; - case ONLEAVE: - tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterStatus.ONLEAVE); - break; - case FINISHED: - tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterStatus.FINISHED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Encounter.EncounterStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterStatus.PLANNED); + break; + case ARRIVED: + tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterStatus.ARRIVED); + break; + case TRIAGED: + tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterStatus.TRIAGED); + break; + case INPROGRESS: + tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterStatus.INPROGRESS); + break; + case ONLEAVE: + tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterStatus.ONLEAVE); + break; + case FINISHED: + tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterStatus.FINISHED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertEncounterStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Encounter.EncounterStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterStatus.PLANNED); - break; - case ARRIVED: - tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterStatus.ARRIVED); - break; - case TRIAGED: - tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterStatus.TRIAGED); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterStatus.INPROGRESS); - break; - case ONLEAVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterStatus.ONLEAVE); - break; - case FINISHED: - tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterStatus.FINISHED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Encounter.EncounterStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(Encounter.EncounterStatus.PLANNED); + break; + case ARRIVED: + tgt.setValue(Encounter.EncounterStatus.ARRIVED); + break; + case TRIAGED: + tgt.setValue(Encounter.EncounterStatus.TRIAGED); + break; + case INPROGRESS: + tgt.setValue(Encounter.EncounterStatus.INPROGRESS); + break; + case ONLEAVE: + tgt.setValue(Encounter.EncounterStatus.ONLEAVE); + break; + case FINISHED: + tgt.setValue(Encounter.EncounterStatus.FINISHED); + break; + case CANCELLED: + tgt.setValue(Encounter.EncounterStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(Encounter.EncounterStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Encounter.EncounterStatus.UNKNOWN); + break; + default: + tgt.setValue(Encounter.EncounterStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r4.model.Encounter.StatusHistoryComponent convertStatusHistoryComponent(org.hl7.fhir.dstu3.model.Encounter.StatusHistoryComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Endpoint30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Endpoint30_40.java index 7c52a77c6c..52fe50f615 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Endpoint30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Endpoint30_40.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.Period30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Endpoint; +import org.hl7.fhir.r4.model.Enumeration; public class Endpoint30_40 { @@ -69,64 +71,72 @@ public static org.hl7.fhir.dstu3.model.Endpoint convertEndpoint(org.hl7.fhir.r4. } static public org.hl7.fhir.r4.model.Enumeration convertEndpointStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Endpoint.EndpointStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Endpoint.EndpointStatus.ACTIVE); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.r4.model.Endpoint.EndpointStatus.SUSPENDED); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.r4.model.Endpoint.EndpointStatus.ERROR); - break; - case OFF: - tgt.setValue(org.hl7.fhir.r4.model.Endpoint.EndpointStatus.OFF); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Endpoint.EndpointStatus.ENTEREDINERROR); - break; - case TEST: - tgt.setValue(org.hl7.fhir.r4.model.Endpoint.EndpointStatus.TEST); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Endpoint.EndpointStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Endpoint.EndpointStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Endpoint.EndpointStatus.ACTIVE); + break; + case SUSPENDED: + tgt.setValue(Endpoint.EndpointStatus.SUSPENDED); + break; + case ERROR: + tgt.setValue(Endpoint.EndpointStatus.ERROR); + break; + case OFF: + tgt.setValue(Endpoint.EndpointStatus.OFF); + break; + case ENTEREDINERROR: + tgt.setValue(Endpoint.EndpointStatus.ENTEREDINERROR); + break; + case TEST: + tgt.setValue(Endpoint.EndpointStatus.TEST); + break; + default: + tgt.setValue(Endpoint.EndpointStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertEndpointStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Endpoint.EndpointStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Endpoint.EndpointStatus.ACTIVE); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.dstu3.model.Endpoint.EndpointStatus.SUSPENDED); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Endpoint.EndpointStatus.ERROR); - break; - case OFF: - tgt.setValue(org.hl7.fhir.dstu3.model.Endpoint.EndpointStatus.OFF); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Endpoint.EndpointStatus.ENTEREDINERROR); - break; - case TEST: - tgt.setValue(org.hl7.fhir.dstu3.model.Endpoint.EndpointStatus.TEST); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Endpoint.EndpointStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Endpoint.EndpointStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu3.model.Endpoint.EndpointStatus.ACTIVE); + break; + case SUSPENDED: + tgt.setValue(org.hl7.fhir.dstu3.model.Endpoint.EndpointStatus.SUSPENDED); + break; + case ERROR: + tgt.setValue(org.hl7.fhir.dstu3.model.Endpoint.EndpointStatus.ERROR); + break; + case OFF: + tgt.setValue(org.hl7.fhir.dstu3.model.Endpoint.EndpointStatus.OFF); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu3.model.Endpoint.EndpointStatus.ENTEREDINERROR); + break; + case TEST: + tgt.setValue(org.hl7.fhir.dstu3.model.Endpoint.EndpointStatus.TEST); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Endpoint.EndpointStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Enumerations30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Enumerations30_40.java index f7d1175013..09157ef447 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Enumerations30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Enumerations30_40.java @@ -2,6 +2,7 @@ import org.hl7.fhir.convertors.context.ConversionContext30_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Enumerations; public class Enumerations30_40 { static public org.hl7.fhir.r4.model.Enumeration convertBindingStrength(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { @@ -9,26 +10,26 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.BindingStrengthEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.BindingStrength.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case REQUIRED: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.BindingStrength.REQUIRED); - break; - case EXTENSIBLE: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.BindingStrength.EXTENSIBLE); - break; - case PREFERRED: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.BindingStrength.PREFERRED); - break; - case EXAMPLE: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.BindingStrength.EXAMPLE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.BindingStrength.NULL); - break; - } - } + tgt.setValue(Enumerations.BindingStrength.REQUIRED); + break; + case EXTENSIBLE: + tgt.setValue(Enumerations.BindingStrength.EXTENSIBLE); + break; + case PREFERRED: + tgt.setValue(Enumerations.BindingStrength.PREFERRED); + break; + case EXAMPLE: + tgt.setValue(Enumerations.BindingStrength.EXAMPLE); + break; + default: + tgt.setValue(Enumerations.BindingStrength.NULL); + break; + } +} return tgt; } @@ -37,26 +38,26 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Enumerations.BindingStrengthEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case REQUIRED: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.REQUIRED); - break; - case EXTENSIBLE: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.EXTENSIBLE); - break; - case PREFERRED: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.PREFERRED); - break; - case EXAMPLE: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.EXAMPLE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.REQUIRED); + break; + case EXTENSIBLE: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.EXTENSIBLE); + break; + case PREFERRED: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.PREFERRED); + break; + case EXAMPLE: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.EXAMPLE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.NULL); + break; + } +} return tgt; } @@ -65,26 +66,26 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.PublicationStatusEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case DRAFT: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.ACTIVE); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.RETIRED); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.NULL); - break; - } - } + tgt.setValue(Enumerations.PublicationStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(Enumerations.PublicationStatus.ACTIVE); + break; + case RETIRED: + tgt.setValue(Enumerations.PublicationStatus.RETIRED); + break; + case UNKNOWN: + tgt.setValue(Enumerations.PublicationStatus.UNKNOWN); + break; + default: + tgt.setValue(Enumerations.PublicationStatus.NULL); + break; + } +} return tgt; } @@ -93,26 +94,26 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Enumerations.PublicationStatusEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case DRAFT: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.ACTIVE); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.RETIRED); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.ACTIVE); + break; + case RETIRED: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.RETIRED); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.NULL); + break; + } +} return tgt; } @@ -121,38 +122,38 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.SearchParamTypeEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case NUMBER: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.NUMBER); - break; - case DATE: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.DATE); - break; - case STRING: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.STRING); - break; - case TOKEN: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.TOKEN); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.REFERENCE); - break; - case COMPOSITE: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.COMPOSITE); - break; - case QUANTITY: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.QUANTITY); - break; - case URI: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.URI); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.NULL); - break; - } - } + tgt.setValue(Enumerations.SearchParamType.NUMBER); + break; + case DATE: + tgt.setValue(Enumerations.SearchParamType.DATE); + break; + case STRING: + tgt.setValue(Enumerations.SearchParamType.STRING); + break; + case TOKEN: + tgt.setValue(Enumerations.SearchParamType.TOKEN); + break; + case REFERENCE: + tgt.setValue(Enumerations.SearchParamType.REFERENCE); + break; + case COMPOSITE: + tgt.setValue(Enumerations.SearchParamType.COMPOSITE); + break; + case QUANTITY: + tgt.setValue(Enumerations.SearchParamType.QUANTITY); + break; + case URI: + tgt.setValue(Enumerations.SearchParamType.URI); + break; + default: + tgt.setValue(Enumerations.SearchParamType.NULL); + break; + } +} return tgt; } @@ -161,38 +162,38 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Enumerations.SearchParamTypeEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case NUMBER: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.NUMBER); - break; - case DATE: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.DATE); - break; - case STRING: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.STRING); - break; - case TOKEN: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.TOKEN); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.REFERENCE); - break; - case COMPOSITE: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.COMPOSITE); - break; - case QUANTITY: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.QUANTITY); - break; - case URI: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.URI); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.NUMBER); + break; + case DATE: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.DATE); + break; + case STRING: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.STRING); + break; + case TOKEN: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.TOKEN); + break; + case REFERENCE: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.REFERENCE); + break; + case COMPOSITE: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.COMPOSITE); + break; + case QUANTITY: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.QUANTITY); + break; + case URI: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.URI); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.NULL); + break; + } +} return tgt; } @@ -201,26 +202,26 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.AdministrativeGenderEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case MALE: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.MALE); - break; - case FEMALE: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.FEMALE); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.OTHER); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.NULL); - break; - } - } + tgt.setValue(Enumerations.AdministrativeGender.MALE); + break; + case FEMALE: + tgt.setValue(Enumerations.AdministrativeGender.FEMALE); + break; + case OTHER: + tgt.setValue(Enumerations.AdministrativeGender.OTHER); + break; + case UNKNOWN: + tgt.setValue(Enumerations.AdministrativeGender.UNKNOWN); + break; + default: + tgt.setValue(Enumerations.AdministrativeGender.NULL); + break; + } +} return tgt; } @@ -229,26 +230,26 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGenderEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case MALE: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender.MALE); - break; - case FEMALE: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender.FEMALE); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender.OTHER); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender.MALE); + break; + case FEMALE: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender.FEMALE); + break; + case OTHER: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender.OTHER); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/EpisodeOfCare30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/EpisodeOfCare30_40.java index 5378715ba2..a21ff8f52b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/EpisodeOfCare30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/EpisodeOfCare30_40.java @@ -7,6 +7,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.Period30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.PositiveInt30_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Enumeration; +import org.hl7.fhir.r4.model.EpisodeOfCare; public class EpisodeOfCare30_40 { @@ -71,71 +73,79 @@ public static org.hl7.fhir.dstu3.model.EpisodeOfCare convertEpisodeOfCare(org.hl } static public org.hl7.fhir.r4.model.Enumeration convertEpisodeOfCareStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.PLANNED); - break; - case WAITLIST: - tgt.setValue(org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.WAITLIST); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.ONHOLD); - break; - case FINISHED: - tgt.setValue(org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.FINISHED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new EpisodeOfCare.EpisodeOfCareStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.PLANNED); + break; + case WAITLIST: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.WAITLIST); + break; + case ACTIVE: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.ONHOLD); + break; + case FINISHED: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.FINISHED); + break; + case CANCELLED: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertEpisodeOfCareStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.PLANNED); - break; - case WAITLIST: - tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.WAITLIST); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.ONHOLD); - break; - case FINISHED: - tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.FINISHED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.PLANNED); + break; + case WAITLIST: + tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.WAITLIST); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.ONHOLD); + break; + case FINISHED: + tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.FINISHED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent convertEpisodeOfCareStatusHistoryComponent(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/FamilyMemberHistory30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/FamilyMemberHistory30_40.java index 531599f10c..04bfad1937 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/FamilyMemberHistory30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/FamilyMemberHistory30_40.java @@ -8,58 +8,68 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Boolean30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.DateTime30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.FamilyMemberHistory; import org.hl7.fhir.exceptions.FHIRException; public class FamilyMemberHistory30_40 { static public org.hl7.fhir.dstu3.model.Enumeration convertFamilyHistoryStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.FamilyMemberHistory.FamilyHistoryStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PARTIAL: - tgt.setValue(org.hl7.fhir.dstu3.model.FamilyMemberHistory.FamilyHistoryStatus.PARTIAL); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.FamilyMemberHistory.FamilyHistoryStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.FamilyMemberHistory.FamilyHistoryStatus.ENTEREDINERROR); - break; - case HEALTHUNKNOWN: - tgt.setValue(org.hl7.fhir.dstu3.model.FamilyMemberHistory.FamilyHistoryStatus.HEALTHUNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.FamilyMemberHistory.FamilyHistoryStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new FamilyMemberHistory.FamilyHistoryStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PARTIAL: + tgt.setValue(FamilyMemberHistory.FamilyHistoryStatus.PARTIAL); + break; + case COMPLETED: + tgt.setValue(FamilyMemberHistory.FamilyHistoryStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(FamilyMemberHistory.FamilyHistoryStatus.ENTEREDINERROR); + break; + case HEALTHUNKNOWN: + tgt.setValue(FamilyMemberHistory.FamilyHistoryStatus.HEALTHUNKNOWN); + break; + default: + tgt.setValue(FamilyMemberHistory.FamilyHistoryStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertFamilyHistoryStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PARTIAL: - tgt.setValue(org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus.PARTIAL); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus.ENTEREDINERROR); - break; - case HEALTHUNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus.HEALTHUNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PARTIAL: + tgt.setValue(org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus.PARTIAL); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus.ENTEREDINERROR); + break; + case HEALTHUNKNOWN: + tgt.setValue(org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus.HEALTHUNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.FamilyMemberHistory convertFamilyMemberHistory(org.hl7.fhir.r4.model.FamilyMemberHistory src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Flag30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Flag30_40.java index 2020278cbf..ca9d934b32 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Flag30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Flag30_40.java @@ -5,6 +5,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.CodeableConcept30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.Identifier30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.Period30_40; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.Flag; import org.hl7.fhir.exceptions.FHIRException; public class Flag30_40 { @@ -58,46 +60,54 @@ public static org.hl7.fhir.r4.model.Flag convertFlag(org.hl7.fhir.dstu3.model.Fl } static public org.hl7.fhir.dstu3.model.Enumeration convertFlagStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Flag.FlagStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Flag.FlagStatus.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Flag.FlagStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Flag.FlagStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Flag.FlagStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Flag.FlagStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Flag.FlagStatus.ACTIVE); + break; + case INACTIVE: + tgt.setValue(Flag.FlagStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(Flag.FlagStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Flag.FlagStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertFlagStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Flag.FlagStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Flag.FlagStatus.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Flag.FlagStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Flag.FlagStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Flag.FlagStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Flag.FlagStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4.model.Flag.FlagStatus.ACTIVE); + break; + case INACTIVE: + tgt.setValue(org.hl7.fhir.r4.model.Flag.FlagStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.Flag.FlagStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Flag.FlagStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Goal30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Goal30_40.java index 4cae755de4..142addc8d5 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Goal30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Goal30_40.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Date30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Enumeration; +import org.hl7.fhir.r4.model.Goal; public class Goal30_40 { @@ -85,95 +87,103 @@ public static org.hl7.fhir.r4.model.Goal convertGoal(org.hl7.fhir.dstu3.model.Go } static public org.hl7.fhir.r4.model.Enumeration convertGoalStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Goal.GoalLifecycleStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSED: - tgt.setValue(org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.PROPOSED); - break; - case ACCEPTED: - tgt.setValue(org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.ACCEPTED); - break; - case PLANNED: - tgt.setValue(org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.PLANNED); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.ACTIVE); - break; - case ONTARGET: - tgt.setValue(org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.ACTIVE); - break; - case AHEADOFTARGET: - tgt.setValue(org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.ACTIVE); - break; - case BEHINDTARGET: - tgt.setValue(org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.ACTIVE); - break; - case SUSTAINING: - tgt.setValue(org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.ACTIVE); - break; - case ACHIEVED: - tgt.setValue(org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.COMPLETED); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.ONHOLD); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.ENTEREDINERROR); - break; - case REJECTED: - tgt.setValue(org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.REJECTED); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Goal.GoalLifecycleStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSED: + tgt.setValue(Goal.GoalLifecycleStatus.PROPOSED); + break; + case ACCEPTED: + tgt.setValue(Goal.GoalLifecycleStatus.ACCEPTED); + break; + case PLANNED: + tgt.setValue(Goal.GoalLifecycleStatus.PLANNED); + break; + case INPROGRESS: + tgt.setValue(Goal.GoalLifecycleStatus.ACTIVE); + break; + case ONTARGET: + tgt.setValue(Goal.GoalLifecycleStatus.ACTIVE); + break; + case AHEADOFTARGET: + tgt.setValue(Goal.GoalLifecycleStatus.ACTIVE); + break; + case BEHINDTARGET: + tgt.setValue(Goal.GoalLifecycleStatus.ACTIVE); + break; + case SUSTAINING: + tgt.setValue(Goal.GoalLifecycleStatus.ACTIVE); + break; + case ACHIEVED: + tgt.setValue(Goal.GoalLifecycleStatus.COMPLETED); + break; + case ONHOLD: + tgt.setValue(Goal.GoalLifecycleStatus.ONHOLD); + break; + case CANCELLED: + tgt.setValue(Goal.GoalLifecycleStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(Goal.GoalLifecycleStatus.ENTEREDINERROR); + break; + case REJECTED: + tgt.setValue(Goal.GoalLifecycleStatus.REJECTED); + break; + default: + tgt.setValue(Goal.GoalLifecycleStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertGoalStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Goal.GoalStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSED: - tgt.setValue(org.hl7.fhir.dstu3.model.Goal.GoalStatus.PROPOSED); - break; - case ACCEPTED: - tgt.setValue(org.hl7.fhir.dstu3.model.Goal.GoalStatus.ACCEPTED); - break; - case PLANNED: - tgt.setValue(org.hl7.fhir.dstu3.model.Goal.GoalStatus.PLANNED); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Goal.GoalStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.Goal.GoalStatus.ACHIEVED); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.dstu3.model.Goal.GoalStatus.ONHOLD); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu3.model.Goal.GoalStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Goal.GoalStatus.ENTEREDINERROR); - break; - case REJECTED: - tgt.setValue(org.hl7.fhir.dstu3.model.Goal.GoalStatus.REJECTED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Goal.GoalStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Goal.GoalStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSED: + tgt.setValue(org.hl7.fhir.dstu3.model.Goal.GoalStatus.PROPOSED); + break; + case ACCEPTED: + tgt.setValue(org.hl7.fhir.dstu3.model.Goal.GoalStatus.ACCEPTED); + break; + case PLANNED: + tgt.setValue(org.hl7.fhir.dstu3.model.Goal.GoalStatus.PLANNED); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu3.model.Goal.GoalStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.dstu3.model.Goal.GoalStatus.ACHIEVED); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.dstu3.model.Goal.GoalStatus.ONHOLD); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.dstu3.model.Goal.GoalStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu3.model.Goal.GoalStatus.ENTEREDINERROR); + break; + case REJECTED: + tgt.setValue(org.hl7.fhir.dstu3.model.Goal.GoalStatus.REJECTED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Goal.GoalStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r4.model.Goal.GoalTargetComponent convertGoalTargetComponent(org.hl7.fhir.dstu3.model.Goal.GoalTargetComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/GraphDefinition30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/GraphDefinition30_40.java index 6b7f7da025..4c8b99faa1 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/GraphDefinition30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/GraphDefinition30_40.java @@ -12,113 +12,131 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Uri30_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Enumeration; +import org.hl7.fhir.r4.model.GraphDefinition; public class GraphDefinition30_40 { static public org.hl7.fhir.r4.model.Enumeration convertCompartmentCode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.GraphDefinition.CompartmentCodeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PATIENT: - tgt.setValue(org.hl7.fhir.r4.model.GraphDefinition.CompartmentCode.PATIENT); - break; - case ENCOUNTER: - tgt.setValue(org.hl7.fhir.r4.model.GraphDefinition.CompartmentCode.ENCOUNTER); - break; - case RELATEDPERSON: - tgt.setValue(org.hl7.fhir.r4.model.GraphDefinition.CompartmentCode.RELATEDPERSON); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.r4.model.GraphDefinition.CompartmentCode.PRACTITIONER); - break; - case DEVICE: - tgt.setValue(org.hl7.fhir.r4.model.GraphDefinition.CompartmentCode.DEVICE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.GraphDefinition.CompartmentCode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new GraphDefinition.CompartmentCodeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PATIENT: + tgt.setValue(GraphDefinition.CompartmentCode.PATIENT); + break; + case ENCOUNTER: + tgt.setValue(GraphDefinition.CompartmentCode.ENCOUNTER); + break; + case RELATEDPERSON: + tgt.setValue(GraphDefinition.CompartmentCode.RELATEDPERSON); + break; + case PRACTITIONER: + tgt.setValue(GraphDefinition.CompartmentCode.PRACTITIONER); + break; + case DEVICE: + tgt.setValue(GraphDefinition.CompartmentCode.DEVICE); + break; + default: + tgt.setValue(GraphDefinition.CompartmentCode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertCompartmentCode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.GraphDefinition.CompartmentCodeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PATIENT: - tgt.setValue(org.hl7.fhir.dstu3.model.GraphDefinition.CompartmentCode.PATIENT); - break; - case ENCOUNTER: - tgt.setValue(org.hl7.fhir.dstu3.model.GraphDefinition.CompartmentCode.ENCOUNTER); - break; - case RELATEDPERSON: - tgt.setValue(org.hl7.fhir.dstu3.model.GraphDefinition.CompartmentCode.RELATEDPERSON); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.dstu3.model.GraphDefinition.CompartmentCode.PRACTITIONER); - break; - case DEVICE: - tgt.setValue(org.hl7.fhir.dstu3.model.GraphDefinition.CompartmentCode.DEVICE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.GraphDefinition.CompartmentCode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.GraphDefinition.CompartmentCodeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PATIENT: + tgt.setValue(org.hl7.fhir.dstu3.model.GraphDefinition.CompartmentCode.PATIENT); + break; + case ENCOUNTER: + tgt.setValue(org.hl7.fhir.dstu3.model.GraphDefinition.CompartmentCode.ENCOUNTER); + break; + case RELATEDPERSON: + tgt.setValue(org.hl7.fhir.dstu3.model.GraphDefinition.CompartmentCode.RELATEDPERSON); + break; + case PRACTITIONER: + tgt.setValue(org.hl7.fhir.dstu3.model.GraphDefinition.CompartmentCode.PRACTITIONER); + break; + case DEVICE: + tgt.setValue(org.hl7.fhir.dstu3.model.GraphDefinition.CompartmentCode.DEVICE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.GraphDefinition.CompartmentCode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertGraphCompartmentRule(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentRuleEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case IDENTICAL: - tgt.setValue(org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentRule.IDENTICAL); - break; - case MATCHING: - tgt.setValue(org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentRule.MATCHING); - break; - case DIFFERENT: - tgt.setValue(org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentRule.DIFFERENT); - break; - case CUSTOM: - tgt.setValue(org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentRule.CUSTOM); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentRule.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new GraphDefinition.GraphCompartmentRuleEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case IDENTICAL: + tgt.setValue(GraphDefinition.GraphCompartmentRule.IDENTICAL); + break; + case MATCHING: + tgt.setValue(GraphDefinition.GraphCompartmentRule.MATCHING); + break; + case DIFFERENT: + tgt.setValue(GraphDefinition.GraphCompartmentRule.DIFFERENT); + break; + case CUSTOM: + tgt.setValue(GraphDefinition.GraphCompartmentRule.CUSTOM); + break; + default: + tgt.setValue(GraphDefinition.GraphCompartmentRule.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertGraphCompartmentRule(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.GraphDefinition.GraphCompartmentRuleEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case IDENTICAL: - tgt.setValue(org.hl7.fhir.dstu3.model.GraphDefinition.GraphCompartmentRule.IDENTICAL); - break; - case MATCHING: - tgt.setValue(org.hl7.fhir.dstu3.model.GraphDefinition.GraphCompartmentRule.MATCHING); - break; - case DIFFERENT: - tgt.setValue(org.hl7.fhir.dstu3.model.GraphDefinition.GraphCompartmentRule.DIFFERENT); - break; - case CUSTOM: - tgt.setValue(org.hl7.fhir.dstu3.model.GraphDefinition.GraphCompartmentRule.CUSTOM); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.GraphDefinition.GraphCompartmentRule.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.GraphDefinition.GraphCompartmentRuleEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case IDENTICAL: + tgt.setValue(org.hl7.fhir.dstu3.model.GraphDefinition.GraphCompartmentRule.IDENTICAL); + break; + case MATCHING: + tgt.setValue(org.hl7.fhir.dstu3.model.GraphDefinition.GraphCompartmentRule.MATCHING); + break; + case DIFFERENT: + tgt.setValue(org.hl7.fhir.dstu3.model.GraphDefinition.GraphCompartmentRule.DIFFERENT); + break; + case CUSTOM: + tgt.setValue(org.hl7.fhir.dstu3.model.GraphDefinition.GraphCompartmentRule.CUSTOM); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.GraphDefinition.GraphCompartmentRule.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.GraphDefinition convertGraphDefinition(org.hl7.fhir.r4.model.GraphDefinition src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Group30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Group30_40.java index 1ff5fa7c3f..2ef5b6ad1f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Group30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Group30_40.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Boolean30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.UnsignedInt30_40; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.Group; import org.hl7.fhir.exceptions.FHIRException; public class Group30_40 { @@ -125,64 +127,72 @@ public static org.hl7.fhir.dstu3.model.Group.GroupMemberComponent convertGroupMe } static public org.hl7.fhir.dstu3.model.Enumeration convertGroupType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Group.GroupTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PERSON: - tgt.setValue(org.hl7.fhir.dstu3.model.Group.GroupType.PERSON); - break; - case ANIMAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Group.GroupType.ANIMAL); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.dstu3.model.Group.GroupType.PRACTITIONER); - break; - case DEVICE: - tgt.setValue(org.hl7.fhir.dstu3.model.Group.GroupType.DEVICE); - break; - case MEDICATION: - tgt.setValue(org.hl7.fhir.dstu3.model.Group.GroupType.MEDICATION); - break; - case SUBSTANCE: - tgt.setValue(org.hl7.fhir.dstu3.model.Group.GroupType.SUBSTANCE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Group.GroupType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Group.GroupTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PERSON: + tgt.setValue(Group.GroupType.PERSON); + break; + case ANIMAL: + tgt.setValue(Group.GroupType.ANIMAL); + break; + case PRACTITIONER: + tgt.setValue(Group.GroupType.PRACTITIONER); + break; + case DEVICE: + tgt.setValue(Group.GroupType.DEVICE); + break; + case MEDICATION: + tgt.setValue(Group.GroupType.MEDICATION); + break; + case SUBSTANCE: + tgt.setValue(Group.GroupType.SUBSTANCE); + break; + default: + tgt.setValue(Group.GroupType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertGroupType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Group.GroupTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PERSON: - tgt.setValue(org.hl7.fhir.r4.model.Group.GroupType.PERSON); - break; - case ANIMAL: - tgt.setValue(org.hl7.fhir.r4.model.Group.GroupType.ANIMAL); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.r4.model.Group.GroupType.PRACTITIONER); - break; - case DEVICE: - tgt.setValue(org.hl7.fhir.r4.model.Group.GroupType.DEVICE); - break; - case MEDICATION: - tgt.setValue(org.hl7.fhir.r4.model.Group.GroupType.MEDICATION); - break; - case SUBSTANCE: - tgt.setValue(org.hl7.fhir.r4.model.Group.GroupType.SUBSTANCE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Group.GroupType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Group.GroupTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PERSON: + tgt.setValue(org.hl7.fhir.r4.model.Group.GroupType.PERSON); + break; + case ANIMAL: + tgt.setValue(org.hl7.fhir.r4.model.Group.GroupType.ANIMAL); + break; + case PRACTITIONER: + tgt.setValue(org.hl7.fhir.r4.model.Group.GroupType.PRACTITIONER); + break; + case DEVICE: + tgt.setValue(org.hl7.fhir.r4.model.Group.GroupType.DEVICE); + break; + case MEDICATION: + tgt.setValue(org.hl7.fhir.r4.model.Group.GroupType.MEDICATION); + break; + case SUBSTANCE: + tgt.setValue(org.hl7.fhir.r4.model.Group.GroupType.SUBSTANCE); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Group.GroupType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/HealthcareService30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/HealthcareService30_40.java index d7e46c88c8..860c9eb468 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/HealthcareService30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/HealthcareService30_40.java @@ -14,6 +14,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Time30_40; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4.model.CodeableConcept; +import org.hl7.fhir.r4.model.Enumeration; +import org.hl7.fhir.r4.model.HealthcareService; import org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceEligibilityComponent; public class HealthcareService30_40 { @@ -187,70 +189,78 @@ public static org.hl7.fhir.dstu3.model.HealthcareService.HealthcareServiceNotAva static public org.hl7.fhir.r4.model.Enumeration convertDaysOfWeek(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.HealthcareService.DaysOfWeekEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case MON: - tgt.setValue(org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.MON); - break; - case TUE: - tgt.setValue(org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.TUE); - break; - case WED: - tgt.setValue(org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.WED); - break; - case THU: - tgt.setValue(org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.THU); - break; - case FRI: - tgt.setValue(org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.FRI); - break; - case SAT: - tgt.setValue(org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.SAT); - break; - case SUN: - tgt.setValue(org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.SUN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new HealthcareService.DaysOfWeekEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MON: + tgt.setValue(HealthcareService.DaysOfWeek.MON); + break; + case TUE: + tgt.setValue(HealthcareService.DaysOfWeek.TUE); + break; + case WED: + tgt.setValue(HealthcareService.DaysOfWeek.WED); + break; + case THU: + tgt.setValue(HealthcareService.DaysOfWeek.THU); + break; + case FRI: + tgt.setValue(HealthcareService.DaysOfWeek.FRI); + break; + case SAT: + tgt.setValue(HealthcareService.DaysOfWeek.SAT); + break; + case SUN: + tgt.setValue(HealthcareService.DaysOfWeek.SUN); + break; + default: + tgt.setValue(HealthcareService.DaysOfWeek.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertDaysOfWeek(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeekEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case MON: - tgt.setValue(org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeek.MON); - break; - case TUE: - tgt.setValue(org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeek.TUE); - break; - case WED: - tgt.setValue(org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeek.WED); - break; - case THU: - tgt.setValue(org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeek.THU); - break; - case FRI: - tgt.setValue(org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeek.FRI); - break; - case SAT: - tgt.setValue(org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeek.SAT); - break; - case SUN: - tgt.setValue(org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeek.SUN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeek.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeekEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MON: + tgt.setValue(org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeek.MON); + break; + case TUE: + tgt.setValue(org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeek.TUE); + break; + case WED: + tgt.setValue(org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeek.WED); + break; + case THU: + tgt.setValue(org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeek.THU); + break; + case FRI: + tgt.setValue(org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeek.FRI); + break; + case SAT: + tgt.setValue(org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeek.SAT); + break; + case SUN: + tgt.setValue(org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeek.SUN); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeek.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Immunization30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Immunization30_40.java index fa82874aa5..5e2ea3b018 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Immunization30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Immunization30_40.java @@ -10,6 +10,7 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Date30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.DateTime30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4.model.Extension; import org.hl7.fhir.r4.model.Immunization; @@ -163,41 +164,49 @@ public static org.hl7.fhir.r4.model.Immunization.ImmunizationPerformerComponent } static public org.hl7.fhir.dstu3.model.Enumeration convertImmunizationStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Immunization.ImmunizationStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case COMPLETED: - case NOTDONE: - tgt.setValue(org.hl7.fhir.dstu3.model.Immunization.ImmunizationStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Immunization.ImmunizationStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Immunization.ImmunizationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new org.hl7.fhir.dstu3.model.Immunization.ImmunizationStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case COMPLETED: + case NOTDONE: + tgt.setValue(org.hl7.fhir.dstu3.model.Immunization.ImmunizationStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu3.model.Immunization.ImmunizationStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Immunization.ImmunizationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertImmunizationStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Immunization.ImmunizationStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.Immunization.ImmunizationStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Immunization.ImmunizationStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Immunization.ImmunizationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new Immunization.ImmunizationStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case COMPLETED: + tgt.setValue(Immunization.ImmunizationStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(Immunization.ImmunizationStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Immunization.ImmunizationStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Linkage30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Linkage30_40.java index 5b13682369..2eb1af509b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Linkage30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Linkage30_40.java @@ -4,6 +4,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.Reference30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Boolean30_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Enumeration; +import org.hl7.fhir.r4.model.Linkage; public class Linkage30_40 { @@ -60,46 +62,54 @@ public static org.hl7.fhir.r4.model.Linkage.LinkageItemComponent convertLinkageI } static public org.hl7.fhir.r4.model.Enumeration convertLinkageType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Linkage.LinkageTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case SOURCE: - tgt.setValue(org.hl7.fhir.r4.model.Linkage.LinkageType.SOURCE); - break; - case ALTERNATE: - tgt.setValue(org.hl7.fhir.r4.model.Linkage.LinkageType.ALTERNATE); - break; - case HISTORICAL: - tgt.setValue(org.hl7.fhir.r4.model.Linkage.LinkageType.HISTORICAL); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Linkage.LinkageType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Linkage.LinkageTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SOURCE: + tgt.setValue(Linkage.LinkageType.SOURCE); + break; + case ALTERNATE: + tgt.setValue(Linkage.LinkageType.ALTERNATE); + break; + case HISTORICAL: + tgt.setValue(Linkage.LinkageType.HISTORICAL); + break; + default: + tgt.setValue(Linkage.LinkageType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertLinkageType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Linkage.LinkageTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case SOURCE: - tgt.setValue(org.hl7.fhir.dstu3.model.Linkage.LinkageType.SOURCE); - break; - case ALTERNATE: - tgt.setValue(org.hl7.fhir.dstu3.model.Linkage.LinkageType.ALTERNATE); - break; - case HISTORICAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Linkage.LinkageType.HISTORICAL); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Linkage.LinkageType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Linkage.LinkageTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SOURCE: + tgt.setValue(org.hl7.fhir.dstu3.model.Linkage.LinkageType.SOURCE); + break; + case ALTERNATE: + tgt.setValue(org.hl7.fhir.dstu3.model.Linkage.LinkageType.ALTERNATE); + break; + case HISTORICAL: + tgt.setValue(org.hl7.fhir.dstu3.model.Linkage.LinkageType.HISTORICAL); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Linkage.LinkageType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/List30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/List30_40.java index 773d072b76..be24e2b27b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/List30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/List30_40.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.DateTime30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Enumeration; +import org.hl7.fhir.r4.model.ListResource; public class List30_40 { @@ -111,90 +113,106 @@ public static org.hl7.fhir.r4.model.ListResource.ListEntryComponent convertListE } static public org.hl7.fhir.r4.model.Enumeration convertListMode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ListResource.ListModeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case WORKING: - tgt.setValue(org.hl7.fhir.r4.model.ListResource.ListMode.WORKING); - break; - case SNAPSHOT: - tgt.setValue(org.hl7.fhir.r4.model.ListResource.ListMode.SNAPSHOT); - break; - case CHANGES: - tgt.setValue(org.hl7.fhir.r4.model.ListResource.ListMode.CHANGES); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ListResource.ListMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ListResource.ListModeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case WORKING: + tgt.setValue(ListResource.ListMode.WORKING); + break; + case SNAPSHOT: + tgt.setValue(ListResource.ListMode.SNAPSHOT); + break; + case CHANGES: + tgt.setValue(ListResource.ListMode.CHANGES); + break; + default: + tgt.setValue(ListResource.ListMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertListMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ListResource.ListModeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case WORKING: - tgt.setValue(org.hl7.fhir.dstu3.model.ListResource.ListMode.WORKING); - break; - case SNAPSHOT: - tgt.setValue(org.hl7.fhir.dstu3.model.ListResource.ListMode.SNAPSHOT); - break; - case CHANGES: - tgt.setValue(org.hl7.fhir.dstu3.model.ListResource.ListMode.CHANGES); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ListResource.ListMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ListResource.ListModeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case WORKING: + tgt.setValue(org.hl7.fhir.dstu3.model.ListResource.ListMode.WORKING); + break; + case SNAPSHOT: + tgt.setValue(org.hl7.fhir.dstu3.model.ListResource.ListMode.SNAPSHOT); + break; + case CHANGES: + tgt.setValue(org.hl7.fhir.dstu3.model.ListResource.ListMode.CHANGES); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.ListResource.ListMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertListStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ListResource.ListStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case CURRENT: - tgt.setValue(org.hl7.fhir.dstu3.model.ListResource.ListStatus.CURRENT); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.dstu3.model.ListResource.ListStatus.RETIRED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.ListResource.ListStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ListResource.ListStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ListResource.ListStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CURRENT: + tgt.setValue(org.hl7.fhir.dstu3.model.ListResource.ListStatus.CURRENT); + break; + case RETIRED: + tgt.setValue(org.hl7.fhir.dstu3.model.ListResource.ListStatus.RETIRED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu3.model.ListResource.ListStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.ListResource.ListStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertListStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ListResource.ListStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case CURRENT: - tgt.setValue(org.hl7.fhir.r4.model.ListResource.ListStatus.CURRENT); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.r4.model.ListResource.ListStatus.RETIRED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.ListResource.ListStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ListResource.ListStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ListResource.ListStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CURRENT: + tgt.setValue(ListResource.ListStatus.CURRENT); + break; + case RETIRED: + tgt.setValue(ListResource.ListStatus.RETIRED); + break; + case ENTEREDINERROR: + tgt.setValue(ListResource.ListStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(ListResource.ListStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Location30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Location30_40.java index ae413fc393..39f172fa1c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Location30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Location30_40.java @@ -10,6 +10,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Decimal30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Enumeration; +import org.hl7.fhir.r4.model.Location; public class Location30_40 { @@ -86,41 +88,49 @@ public static org.hl7.fhir.dstu3.model.Location convertLocation(org.hl7.fhir.r4. } static public org.hl7.fhir.r4.model.Enumeration convertLocationMode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Location.LocationModeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.r4.model.Location.LocationMode.INSTANCE); - break; - case KIND: - tgt.setValue(org.hl7.fhir.r4.model.Location.LocationMode.KIND); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Location.LocationMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Location.LocationModeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(Location.LocationMode.INSTANCE); + break; + case KIND: + tgt.setValue(Location.LocationMode.KIND); + break; + default: + tgt.setValue(Location.LocationMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertLocationMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Location.LocationModeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.dstu3.model.Location.LocationMode.INSTANCE); - break; - case KIND: - tgt.setValue(org.hl7.fhir.dstu3.model.Location.LocationMode.KIND); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Location.LocationMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Location.LocationModeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(org.hl7.fhir.dstu3.model.Location.LocationMode.INSTANCE); + break; + case KIND: + tgt.setValue(org.hl7.fhir.dstu3.model.Location.LocationMode.KIND); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Location.LocationMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r4.model.Location.LocationPositionComponent convertLocationPositionComponent(org.hl7.fhir.dstu3.model.Location.LocationPositionComponent src) throws FHIRException { @@ -152,46 +162,54 @@ public static org.hl7.fhir.dstu3.model.Location.LocationPositionComponent conver } static public org.hl7.fhir.r4.model.Enumeration convertLocationStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Location.LocationStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Location.LocationStatus.ACTIVE); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.r4.model.Location.LocationStatus.SUSPENDED); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Location.LocationStatus.INACTIVE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Location.LocationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Location.LocationStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Location.LocationStatus.ACTIVE); + break; + case SUSPENDED: + tgt.setValue(Location.LocationStatus.SUSPENDED); + break; + case INACTIVE: + tgt.setValue(Location.LocationStatus.INACTIVE); + break; + default: + tgt.setValue(Location.LocationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertLocationStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Location.LocationStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Location.LocationStatus.ACTIVE); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.dstu3.model.Location.LocationStatus.SUSPENDED); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Location.LocationStatus.INACTIVE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Location.LocationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Location.LocationStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu3.model.Location.LocationStatus.ACTIVE); + break; + case SUSPENDED: + tgt.setValue(org.hl7.fhir.dstu3.model.Location.LocationStatus.SUSPENDED); + break; + case INACTIVE: + tgt.setValue(org.hl7.fhir.dstu3.model.Location.LocationStatus.INACTIVE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Location.LocationStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Medication30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Medication30_40.java index 89db770105..6e944e1e96 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Medication30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Medication30_40.java @@ -7,6 +7,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Boolean30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.DateTime30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.Medication; import org.hl7.fhir.exceptions.FHIRException; public class Medication30_40 { @@ -104,46 +106,54 @@ public static org.hl7.fhir.r4.model.Medication.MedicationBatchComponent convertM } static public org.hl7.fhir.dstu3.model.Enumeration convertMedicationStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Medication.MedicationStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Medication.MedicationStatus.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Medication.MedicationStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Medication.MedicationStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Medication.MedicationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Medication.MedicationStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Medication.MedicationStatus.ACTIVE); + break; + case INACTIVE: + tgt.setValue(Medication.MedicationStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(Medication.MedicationStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Medication.MedicationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertMedicationStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Medication.MedicationStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Medication.MedicationStatus.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Medication.MedicationStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Medication.MedicationStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Medication.MedicationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Medication.MedicationStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4.model.Medication.MedicationStatus.ACTIVE); + break; + case INACTIVE: + tgt.setValue(org.hl7.fhir.r4.model.Medication.MedicationStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.Medication.MedicationStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Medication.MedicationStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/MedicationAdministration30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/MedicationAdministration30_40.java index 14b085f99f..58eb3532ef 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/MedicationAdministration30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/MedicationAdministration30_40.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.Quantity30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.SimpleQuantity30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.MedicationAdministration; import org.hl7.fhir.dstu3.model.SimpleQuantity; import org.hl7.fhir.exceptions.FHIRException; @@ -160,69 +162,77 @@ public static org.hl7.fhir.dstu3.model.MedicationAdministration.MedicationAdmini } private static org.hl7.fhir.dstu3.model.Enumeration convertMedicationAdministrationStatus(org.hl7.fhir.r4.model.Enumeration src) { - if (src == null) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.MedicationAdministration.MedicationAdministrationStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - // - switch (src.getValue()) { - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationAdministration.MedicationAdministrationStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationAdministration.MedicationAdministrationStatus.ENTEREDINERROR); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationAdministration.MedicationAdministrationStatus.INPROGRESS); - break; - case NOTDONE: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationAdministration.MedicationAdministrationStatus.STOPPED); - break; - case NULL: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationAdministration.MedicationAdministrationStatus.NULL); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationAdministration.MedicationAdministrationStatus.ONHOLD); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationAdministration.MedicationAdministrationStatus.STOPPED); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationAdministration.MedicationAdministrationStatus.UNKNOWN); - break; - } - return tgt; + if (src == null) + return null; + Enumeration tgt = new Enumeration<>(new MedicationAdministration.MedicationAdministrationStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + // + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case COMPLETED: + tgt.setValue(MedicationAdministration.MedicationAdministrationStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(MedicationAdministration.MedicationAdministrationStatus.ENTEREDINERROR); + break; + case INPROGRESS: + tgt.setValue(MedicationAdministration.MedicationAdministrationStatus.INPROGRESS); + break; + case NOTDONE: + tgt.setValue(MedicationAdministration.MedicationAdministrationStatus.STOPPED); + break; + case NULL: + tgt.setValue(MedicationAdministration.MedicationAdministrationStatus.NULL); + break; + case ONHOLD: + tgt.setValue(MedicationAdministration.MedicationAdministrationStatus.ONHOLD); + break; + case STOPPED: + tgt.setValue(MedicationAdministration.MedicationAdministrationStatus.STOPPED); + break; + case UNKNOWN: + tgt.setValue(MedicationAdministration.MedicationAdministrationStatus.UNKNOWN); + break; + } + } + return tgt; } private static org.hl7.fhir.r4.model.Enumeration convertMedicationAdministrationStatus(org.hl7.fhir.dstu3.model.Enumeration src) { - if (src == null) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - // - switch (src.getValue()) { - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationStatus.ENTEREDINERROR); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationStatus.INPROGRESS); - break; - case NULL: - tgt.setValue(org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationStatus.NULL); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationStatus.ONHOLD); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationStatus.STOPPED); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationStatus.UNKNOWN); - break; - } - return tgt; + if (src == null) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + // + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationStatus.ENTEREDINERROR); + break; + case INPROGRESS: + tgt.setValue(org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationStatus.INPROGRESS); + break; + case NULL: + tgt.setValue(org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationStatus.NULL); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationStatus.ONHOLD); + break; + case STOPPED: + tgt.setValue(org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationStatus.STOPPED); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationStatus.UNKNOWN); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/MedicationDispense30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/MedicationDispense30_40.java index 563dbbf015..cffd4fa5bd 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/MedicationDispense30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/MedicationDispense30_40.java @@ -10,6 +10,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Boolean30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.DateTime30_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Enumeration; +import org.hl7.fhir.r4.model.MedicationDispense; public class MedicationDispense30_40 { @@ -132,74 +134,82 @@ public static org.hl7.fhir.r4.model.MedicationDispense.MedicationDispensePerform } private static org.hl7.fhir.r4.model.Enumeration convertMedicationDispenseStatus(org.hl7.fhir.dstu3.model.Enumeration src) { - if (src == null) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseStatus.ENTEREDINERROR); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseStatus.INPROGRESS); - break; - case NULL: - tgt.setValue(org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseStatus.NULL); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseStatus.ONHOLD); - break; - case PREPARATION: - tgt.setValue(org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseStatus.PREPARATION); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseStatus.STOPPED); - break; - } - return tgt; + if (src == null) + return null; + Enumeration tgt = new Enumeration<>(new MedicationDispense.MedicationDispenseStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case COMPLETED: + tgt.setValue(MedicationDispense.MedicationDispenseStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(MedicationDispense.MedicationDispenseStatus.ENTEREDINERROR); + break; + case INPROGRESS: + tgt.setValue(MedicationDispense.MedicationDispenseStatus.INPROGRESS); + break; + case NULL: + tgt.setValue(MedicationDispense.MedicationDispenseStatus.NULL); + break; + case ONHOLD: + tgt.setValue(MedicationDispense.MedicationDispenseStatus.ONHOLD); + break; + case PREPARATION: + tgt.setValue(MedicationDispense.MedicationDispenseStatus.PREPARATION); + break; + case STOPPED: + tgt.setValue(MedicationDispense.MedicationDispenseStatus.STOPPED); + break; + } + } + return tgt; } private static org.hl7.fhir.dstu3.model.Enumeration convertMedicationDispenseStatus(org.hl7.fhir.r4.model.Enumeration src) { - if (src == null) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatus.STOPPED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatus.COMPLETED); - break; - case DECLINED: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatus.STOPPED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatus.ENTEREDINERROR); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatus.INPROGRESS); - break; - case NULL: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatus.NULL); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatus.ONHOLD); - break; - case PREPARATION: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatus.PREPARATION); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatus.STOPPED); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatus.NULL); - break; - } - return tgt; + if (src == null) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CANCELLED: + tgt.setValue(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatus.STOPPED); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatus.COMPLETED); + break; + case DECLINED: + tgt.setValue(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatus.STOPPED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatus.ENTEREDINERROR); + break; + case INPROGRESS: + tgt.setValue(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatus.INPROGRESS); + break; + case NULL: + tgt.setValue(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatus.NULL); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatus.ONHOLD); + break; + case PREPARATION: + tgt.setValue(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatus.PREPARATION); + break; + case STOPPED: + tgt.setValue(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatus.STOPPED); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseSubstitutionComponent convertMedicationDispenseSubstitutionComponent(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseSubstitutionComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/MedicationRequest30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/MedicationRequest30_40.java index 45e562c294..5f457c2143 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/MedicationRequest30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/MedicationRequest30_40.java @@ -11,6 +11,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.SimpleQuantity30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Boolean30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.DateTime30_40; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.MedicationRequest; import org.hl7.fhir.exceptions.FHIRException; public class MedicationRequest30_40 { @@ -160,177 +162,201 @@ public static org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestDispen } static public org.hl7.fhir.dstu3.model.Enumeration convertMedicationRequestIntent(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestIntentEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSAL: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestIntent.PROPOSAL); - break; - case PLAN: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestIntent.PLAN); - break; - case ORDER: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestIntent.ORDER); - break; - case INSTANCEORDER: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestIntent.INSTANCEORDER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestIntent.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new MedicationRequest.MedicationRequestIntentEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSAL: + tgt.setValue(MedicationRequest.MedicationRequestIntent.PROPOSAL); + break; + case PLAN: + tgt.setValue(MedicationRequest.MedicationRequestIntent.PLAN); + break; + case ORDER: + tgt.setValue(MedicationRequest.MedicationRequestIntent.ORDER); + break; + case INSTANCEORDER: + tgt.setValue(MedicationRequest.MedicationRequestIntent.INSTANCEORDER); + break; + default: + tgt.setValue(MedicationRequest.MedicationRequestIntent.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertMedicationRequestIntent(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntentEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSAL: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.PROPOSAL); - break; - case PLAN: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.PLAN); - break; - case ORDER: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.ORDER); - break; - case INSTANCEORDER: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.INSTANCEORDER); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntentEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSAL: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.PROPOSAL); + break; + case PLAN: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.PLAN); + break; + case ORDER: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.ORDER); + break; + case INSTANCEORDER: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.INSTANCEORDER); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertMedicationRequestPriority(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriorityEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority.URGENT); - break; - case STAT: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority.STAT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority.ASAP); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriorityEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority.URGENT); + break; + case STAT: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority.STAT); + break; + case ASAP: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority.ASAP); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertMedicationRequestPriority(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestPriorityEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestPriority.URGENT); - break; - case STAT: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestPriority.STAT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestPriority.ASAP); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new MedicationRequest.MedicationRequestPriorityEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(MedicationRequest.MedicationRequestPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(MedicationRequest.MedicationRequestPriority.URGENT); + break; + case STAT: + tgt.setValue(MedicationRequest.MedicationRequestPriority.STAT); + break; + case ASAP: + tgt.setValue(MedicationRequest.MedicationRequestPriority.ASAP); + break; + default: + tgt.setValue(MedicationRequest.MedicationRequestPriority.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertMedicationRequestStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.ONHOLD); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.CANCELLED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.ENTEREDINERROR); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.STOPPED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.DRAFT); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.ONHOLD); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.CANCELLED); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.ENTEREDINERROR); + break; + case STOPPED: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.STOPPED); + break; + case DRAFT: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.DRAFT); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertMedicationRequestStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestStatus.ONHOLD); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestStatus.CANCELLED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestStatus.ENTEREDINERROR); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestStatus.STOPPED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestStatus.DRAFT); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new MedicationRequest.MedicationRequestStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(MedicationRequest.MedicationRequestStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(MedicationRequest.MedicationRequestStatus.ONHOLD); + break; + case CANCELLED: + tgt.setValue(MedicationRequest.MedicationRequestStatus.CANCELLED); + break; + case COMPLETED: + tgt.setValue(MedicationRequest.MedicationRequestStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(MedicationRequest.MedicationRequestStatus.ENTEREDINERROR); + break; + case STOPPED: + tgt.setValue(MedicationRequest.MedicationRequestStatus.STOPPED); + break; + case DRAFT: + tgt.setValue(MedicationRequest.MedicationRequestStatus.DRAFT); + break; + case UNKNOWN: + tgt.setValue(MedicationRequest.MedicationRequestStatus.UNKNOWN); + break; + default: + tgt.setValue(MedicationRequest.MedicationRequestStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestSubstitutionComponent convertMedicationRequestSubstitutionComponent(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestSubstitutionComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/MedicationStatement30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/MedicationStatement30_40.java index 7563553625..7e15f1e81b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/MedicationStatement30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/MedicationStatement30_40.java @@ -7,6 +7,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.CodeableConcept30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.Identifier30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.DateTime30_40; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.MedicationStatement; import org.hl7.fhir.exceptions.FHIRException; public class MedicationStatement30_40 { @@ -84,64 +86,72 @@ public static org.hl7.fhir.r4.model.MedicationStatement convertMedicationStateme } static public org.hl7.fhir.dstu3.model.Enumeration convertMedicationStatementStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.MedicationStatement.MedicationStatementStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationStatement.MedicationStatementStatus.ACTIVE); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationStatement.MedicationStatementStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationStatement.MedicationStatementStatus.ENTEREDINERROR); - break; - case INTENDED: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationStatement.MedicationStatementStatus.INTENDED); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationStatement.MedicationStatementStatus.STOPPED); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationStatement.MedicationStatementStatus.ONHOLD); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationStatement.MedicationStatementStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new MedicationStatement.MedicationStatementStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(MedicationStatement.MedicationStatementStatus.ACTIVE); + break; + case COMPLETED: + tgt.setValue(MedicationStatement.MedicationStatementStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(MedicationStatement.MedicationStatementStatus.ENTEREDINERROR); + break; + case INTENDED: + tgt.setValue(MedicationStatement.MedicationStatementStatus.INTENDED); + break; + case STOPPED: + tgt.setValue(MedicationStatement.MedicationStatementStatus.STOPPED); + break; + case ONHOLD: + tgt.setValue(MedicationStatement.MedicationStatementStatus.ONHOLD); + break; + default: + tgt.setValue(MedicationStatement.MedicationStatementStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertMedicationStatementStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.ACTIVE); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.ENTEREDINERROR); - break; - case INTENDED: - tgt.setValue(org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.INTENDED); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.STOPPED); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.ONHOLD); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.ACTIVE); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.ENTEREDINERROR); + break; + case INTENDED: + tgt.setValue(org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.INTENDED); + break; + case STOPPED: + tgt.setValue(org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.STOPPED); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.ONHOLD); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/MessageDefinition30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/MessageDefinition30_40.java index c8fe851ef3..2aa2441802 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/MessageDefinition30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/MessageDefinition30_40.java @@ -14,6 +14,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.UnsignedInt30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Uri30_40; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.MessageDefinition; import org.hl7.fhir.exceptions.FHIRException; public class MessageDefinition30_40 { @@ -183,46 +185,54 @@ public static org.hl7.fhir.dstu3.model.MessageDefinition.MessageDefinitionFocusC } static public org.hl7.fhir.dstu3.model.Enumeration convertMessageSignificanceCategory(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.MessageDefinition.MessageSignificanceCategoryEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case CONSEQUENCE: - tgt.setValue(org.hl7.fhir.dstu3.model.MessageDefinition.MessageSignificanceCategory.CONSEQUENCE); - break; - case CURRENCY: - tgt.setValue(org.hl7.fhir.dstu3.model.MessageDefinition.MessageSignificanceCategory.CURRENCY); - break; - case NOTIFICATION: - tgt.setValue(org.hl7.fhir.dstu3.model.MessageDefinition.MessageSignificanceCategory.NOTIFICATION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.MessageDefinition.MessageSignificanceCategory.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new MessageDefinition.MessageSignificanceCategoryEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CONSEQUENCE: + tgt.setValue(MessageDefinition.MessageSignificanceCategory.CONSEQUENCE); + break; + case CURRENCY: + tgt.setValue(MessageDefinition.MessageSignificanceCategory.CURRENCY); + break; + case NOTIFICATION: + tgt.setValue(MessageDefinition.MessageSignificanceCategory.NOTIFICATION); + break; + default: + tgt.setValue(MessageDefinition.MessageSignificanceCategory.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertMessageSignificanceCategory(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MessageDefinition.MessageSignificanceCategoryEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case CONSEQUENCE: - tgt.setValue(org.hl7.fhir.r4.model.MessageDefinition.MessageSignificanceCategory.CONSEQUENCE); - break; - case CURRENCY: - tgt.setValue(org.hl7.fhir.r4.model.MessageDefinition.MessageSignificanceCategory.CURRENCY); - break; - case NOTIFICATION: - tgt.setValue(org.hl7.fhir.r4.model.MessageDefinition.MessageSignificanceCategory.NOTIFICATION); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.MessageDefinition.MessageSignificanceCategory.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MessageDefinition.MessageSignificanceCategoryEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CONSEQUENCE: + tgt.setValue(org.hl7.fhir.r4.model.MessageDefinition.MessageSignificanceCategory.CONSEQUENCE); + break; + case CURRENCY: + tgt.setValue(org.hl7.fhir.r4.model.MessageDefinition.MessageSignificanceCategory.CURRENCY); + break; + case NOTIFICATION: + tgt.setValue(org.hl7.fhir.r4.model.MessageDefinition.MessageSignificanceCategory.NOTIFICATION); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.MessageDefinition.MessageSignificanceCategory.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/MessageHeader30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/MessageHeader30_40.java index 15c0f20ae2..8061a7876f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/MessageHeader30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/MessageHeader30_40.java @@ -7,6 +7,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.ContactPoint30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Id30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.MessageHeader; import org.hl7.fhir.exceptions.FHIRException; public class MessageHeader30_40 { @@ -158,46 +160,54 @@ public static org.hl7.fhir.dstu3.model.MessageHeader.MessageSourceComponent conv } static public org.hl7.fhir.dstu3.model.Enumeration convertResponseType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.MessageHeader.ResponseTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case OK: - tgt.setValue(org.hl7.fhir.dstu3.model.MessageHeader.ResponseType.OK); - break; - case TRANSIENTERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.MessageHeader.ResponseType.TRANSIENTERROR); - break; - case FATALERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.MessageHeader.ResponseType.FATALERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.MessageHeader.ResponseType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new MessageHeader.ResponseTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OK: + tgt.setValue(MessageHeader.ResponseType.OK); + break; + case TRANSIENTERROR: + tgt.setValue(MessageHeader.ResponseType.TRANSIENTERROR); + break; + case FATALERROR: + tgt.setValue(MessageHeader.ResponseType.FATALERROR); + break; + default: + tgt.setValue(MessageHeader.ResponseType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertResponseType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MessageHeader.ResponseTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case OK: - tgt.setValue(org.hl7.fhir.r4.model.MessageHeader.ResponseType.OK); - break; - case TRANSIENTERROR: - tgt.setValue(org.hl7.fhir.r4.model.MessageHeader.ResponseType.TRANSIENTERROR); - break; - case FATALERROR: - tgt.setValue(org.hl7.fhir.r4.model.MessageHeader.ResponseType.FATALERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.MessageHeader.ResponseType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MessageHeader.ResponseTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OK: + tgt.setValue(org.hl7.fhir.r4.model.MessageHeader.ResponseType.OK); + break; + case TRANSIENTERROR: + tgt.setValue(org.hl7.fhir.r4.model.MessageHeader.ResponseType.TRANSIENTERROR); + break; + case FATALERROR: + tgt.setValue(org.hl7.fhir.r4.model.MessageHeader.ResponseType.FATALERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.MessageHeader.ResponseType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/NamingSystem30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/NamingSystem30_40.java index 3840557650..ace5422423 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/NamingSystem30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/NamingSystem30_40.java @@ -10,6 +10,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.MarkDown30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Enumeration; +import org.hl7.fhir.r4.model.NamingSystem; public class NamingSystem30_40 { @@ -82,97 +84,113 @@ public static org.hl7.fhir.r4.model.NamingSystem convertNamingSystem(org.hl7.fhi } static public org.hl7.fhir.r4.model.Enumeration convertNamingSystemIdentifierType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case OID: - tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.OID); - break; - case UUID: - tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.UUID); - break; - case URI: - tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.URI); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new NamingSystem.NamingSystemIdentifierTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OID: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.OID); + break; + case UUID: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.UUID); + break; + case URI: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.URI); + break; + case OTHER: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.OTHER); + break; + default: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertNamingSystemIdentifierType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case OID: - tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierType.OID); - break; - case UUID: - tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierType.UUID); - break; - case URI: - tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierType.URI); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierType.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OID: + tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierType.OID); + break; + case UUID: + tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierType.UUID); + break; + case URI: + tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierType.URI); + break; + case OTHER: + tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierType.OTHER); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertNamingSystemType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case CODESYSTEM: - tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemType.CODESYSTEM); - break; - case IDENTIFIER: - tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemType.IDENTIFIER); - break; - case ROOT: - tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemType.ROOT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CODESYSTEM: + tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemType.CODESYSTEM); + break; + case IDENTIFIER: + tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemType.IDENTIFIER); + break; + case ROOT: + tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemType.ROOT); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertNamingSystemType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.NamingSystem.NamingSystemTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case CODESYSTEM: - tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemType.CODESYSTEM); - break; - case IDENTIFIER: - tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemType.IDENTIFIER); - break; - case ROOT: - tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemType.ROOT); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new NamingSystem.NamingSystemTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CODESYSTEM: + tgt.setValue(NamingSystem.NamingSystemType.CODESYSTEM); + break; + case IDENTIFIER: + tgt.setValue(NamingSystem.NamingSystemType.IDENTIFIER); + break; + case ROOT: + tgt.setValue(NamingSystem.NamingSystemType.ROOT); + break; + default: + tgt.setValue(NamingSystem.NamingSystemType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemUniqueIdComponent convertNamingSystemUniqueIdComponent(org.hl7.fhir.r4.model.NamingSystem.NamingSystemUniqueIdComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Observation30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Observation30_40.java index 9dbee3ced7..33584adf63 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Observation30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Observation30_40.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.SimpleQuantity30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Instant30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.Observation; import org.hl7.fhir.exceptions.FHIRException; public class Observation30_40 { @@ -201,76 +203,84 @@ public static org.hl7.fhir.dstu3.model.Observation.ObservationRelatedComponent c } static public org.hl7.fhir.dstu3.model.Enumeration convertObservationStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Observation.ObservationStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.dstu3.model.Observation.ObservationStatus.REGISTERED); - break; - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.dstu3.model.Observation.ObservationStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Observation.ObservationStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.dstu3.model.Observation.ObservationStatus.AMENDED); - break; - case CORRECTED: - tgt.setValue(org.hl7.fhir.dstu3.model.Observation.ObservationStatus.CORRECTED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu3.model.Observation.ObservationStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Observation.ObservationStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu3.model.Observation.ObservationStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Observation.ObservationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Observation.ObservationStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(Observation.ObservationStatus.REGISTERED); + break; + case PRELIMINARY: + tgt.setValue(Observation.ObservationStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(Observation.ObservationStatus.FINAL); + break; + case AMENDED: + tgt.setValue(Observation.ObservationStatus.AMENDED); + break; + case CORRECTED: + tgt.setValue(Observation.ObservationStatus.CORRECTED); + break; + case CANCELLED: + tgt.setValue(Observation.ObservationStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(Observation.ObservationStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Observation.ObservationStatus.UNKNOWN); + break; + default: + tgt.setValue(Observation.ObservationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertObservationStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Observation.ObservationStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.REGISTERED); - break; - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.AMENDED); - break; - case CORRECTED: - tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.CORRECTED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Observation.ObservationStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.REGISTERED); + break; + case PRELIMINARY: + tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.FINAL); + break; + case AMENDED: + tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.AMENDED); + break; + case CORRECTED: + tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.CORRECTED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/OperationDefinition30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/OperationDefinition30_40.java index 8fb8cf8047..908812dc5c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/OperationDefinition30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/OperationDefinition30_40.java @@ -13,6 +13,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.MarkDown30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Uri30_40; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.OperationDefinition; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4.model.Type; @@ -238,78 +240,94 @@ public static org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParam } static public org.hl7.fhir.dstu3.model.Enumeration convertOperationKind(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.OperationDefinition.OperationKindEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case OPERATION: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationDefinition.OperationKind.OPERATION); - break; - case QUERY: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationDefinition.OperationKind.QUERY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationDefinition.OperationKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new OperationDefinition.OperationKindEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OPERATION: + tgt.setValue(OperationDefinition.OperationKind.OPERATION); + break; + case QUERY: + tgt.setValue(OperationDefinition.OperationKind.QUERY); + break; + default: + tgt.setValue(OperationDefinition.OperationKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertOperationKind(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.OperationDefinition.OperationKindEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case OPERATION: - tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationKind.OPERATION); - break; - case QUERY: - tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationKind.QUERY); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.OperationDefinition.OperationKindEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OPERATION: + tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationKind.OPERATION); + break; + case QUERY: + tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationKind.QUERY); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertOperationParameterUse(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUseEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case IN: - tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUse.IN); - break; - case OUT: - tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUse.OUT); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUse.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUseEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case IN: + tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUse.IN); + break; + case OUT: + tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUse.OUT); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUse.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertOperationParameterUse(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.OperationDefinition.OperationParameterUseEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case IN: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationDefinition.OperationParameterUse.IN); - break; - case OUT: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationDefinition.OperationParameterUse.OUT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationDefinition.OperationParameterUse.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new OperationDefinition.OperationParameterUseEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case IN: + tgt.setValue(OperationDefinition.OperationParameterUse.IN); + break; + case OUT: + tgt.setValue(OperationDefinition.OperationParameterUse.OUT); + break; + default: + tgt.setValue(OperationDefinition.OperationParameterUse.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/OperationOutcome30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/OperationOutcome30_40.java index 525437aa1c..25b58d8aa4 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/OperationOutcome30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/OperationOutcome30_40.java @@ -3,258 +3,276 @@ import org.hl7.fhir.convertors.context.ConversionContext30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.CodeableConcept30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.OperationOutcome; import org.hl7.fhir.exceptions.FHIRException; public class OperationOutcome30_40 { static public org.hl7.fhir.dstu3.model.Enumeration convertIssueSeverity(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverityEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case FATAL: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverity.FATAL); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverity.ERROR); - break; - case WARNING: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverity.WARNING); - break; - case INFORMATION: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverity.INFORMATION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverity.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new OperationOutcome.IssueSeverityEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FATAL: + tgt.setValue(OperationOutcome.IssueSeverity.FATAL); + break; + case ERROR: + tgt.setValue(OperationOutcome.IssueSeverity.ERROR); + break; + case WARNING: + tgt.setValue(OperationOutcome.IssueSeverity.WARNING); + break; + case INFORMATION: + tgt.setValue(OperationOutcome.IssueSeverity.INFORMATION); + break; + default: + tgt.setValue(OperationOutcome.IssueSeverity.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertIssueSeverity(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.OperationOutcome.IssueSeverityEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case FATAL: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.FATAL); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.ERROR); - break; - case WARNING: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.WARNING); - break; - case INFORMATION: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.INFORMATION); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.OperationOutcome.IssueSeverityEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FATAL: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.FATAL); + break; + case ERROR: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.ERROR); + break; + case WARNING: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.WARNING); + break; + case INFORMATION: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.INFORMATION); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertIssueType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.OperationOutcome.IssueTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case INVALID: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.INVALID); - break; - case STRUCTURE: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.STRUCTURE); - break; - case REQUIRED: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.REQUIRED); - break; - case VALUE: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.VALUE); - break; - case INVARIANT: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.INVARIANT); - break; - case SECURITY: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.SECURITY); - break; - case LOGIN: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.LOGIN); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.UNKNOWN); - break; - case EXPIRED: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.EXPIRED); - break; - case FORBIDDEN: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.FORBIDDEN); - break; - case SUPPRESSED: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.SUPPRESSED); - break; - case PROCESSING: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.PROCESSING); - break; - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.NOTSUPPORTED); - break; - case DUPLICATE: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.DUPLICATE); - break; - case NOTFOUND: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.NOTFOUND); - break; - case TOOLONG: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.TOOLONG); - break; - case CODEINVALID: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.CODEINVALID); - break; - case EXTENSION: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.EXTENSION); - break; - case TOOCOSTLY: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.TOOCOSTLY); - break; - case BUSINESSRULE: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.BUSINESSRULE); - break; - case CONFLICT: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.CONFLICT); - break; - case INCOMPLETE: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.INCOMPLETE); - break; - case TRANSIENT: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.TRANSIENT); - break; - case LOCKERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.LOCKERROR); - break; - case NOSTORE: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.NOSTORE); - break; - case EXCEPTION: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.EXCEPTION); - break; - case TIMEOUT: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.TIMEOUT); - break; - case THROTTLED: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.THROTTLED); - break; - case INFORMATIONAL: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.INFORMATIONAL); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new OperationOutcome.IssueTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INVALID: + tgt.setValue(OperationOutcome.IssueType.INVALID); + break; + case STRUCTURE: + tgt.setValue(OperationOutcome.IssueType.STRUCTURE); + break; + case REQUIRED: + tgt.setValue(OperationOutcome.IssueType.REQUIRED); + break; + case VALUE: + tgt.setValue(OperationOutcome.IssueType.VALUE); + break; + case INVARIANT: + tgt.setValue(OperationOutcome.IssueType.INVARIANT); + break; + case SECURITY: + tgt.setValue(OperationOutcome.IssueType.SECURITY); + break; + case LOGIN: + tgt.setValue(OperationOutcome.IssueType.LOGIN); + break; + case UNKNOWN: + tgt.setValue(OperationOutcome.IssueType.UNKNOWN); + break; + case EXPIRED: + tgt.setValue(OperationOutcome.IssueType.EXPIRED); + break; + case FORBIDDEN: + tgt.setValue(OperationOutcome.IssueType.FORBIDDEN); + break; + case SUPPRESSED: + tgt.setValue(OperationOutcome.IssueType.SUPPRESSED); + break; + case PROCESSING: + tgt.setValue(OperationOutcome.IssueType.PROCESSING); + break; + case NOTSUPPORTED: + tgt.setValue(OperationOutcome.IssueType.NOTSUPPORTED); + break; + case DUPLICATE: + tgt.setValue(OperationOutcome.IssueType.DUPLICATE); + break; + case NOTFOUND: + tgt.setValue(OperationOutcome.IssueType.NOTFOUND); + break; + case TOOLONG: + tgt.setValue(OperationOutcome.IssueType.TOOLONG); + break; + case CODEINVALID: + tgt.setValue(OperationOutcome.IssueType.CODEINVALID); + break; + case EXTENSION: + tgt.setValue(OperationOutcome.IssueType.EXTENSION); + break; + case TOOCOSTLY: + tgt.setValue(OperationOutcome.IssueType.TOOCOSTLY); + break; + case BUSINESSRULE: + tgt.setValue(OperationOutcome.IssueType.BUSINESSRULE); + break; + case CONFLICT: + tgt.setValue(OperationOutcome.IssueType.CONFLICT); + break; + case INCOMPLETE: + tgt.setValue(OperationOutcome.IssueType.INCOMPLETE); + break; + case TRANSIENT: + tgt.setValue(OperationOutcome.IssueType.TRANSIENT); + break; + case LOCKERROR: + tgt.setValue(OperationOutcome.IssueType.LOCKERROR); + break; + case NOSTORE: + tgt.setValue(OperationOutcome.IssueType.NOSTORE); + break; + case EXCEPTION: + tgt.setValue(OperationOutcome.IssueType.EXCEPTION); + break; + case TIMEOUT: + tgt.setValue(OperationOutcome.IssueType.TIMEOUT); + break; + case THROTTLED: + tgt.setValue(OperationOutcome.IssueType.THROTTLED); + break; + case INFORMATIONAL: + tgt.setValue(OperationOutcome.IssueType.INFORMATIONAL); + break; + default: + tgt.setValue(OperationOutcome.IssueType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertIssueType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.OperationOutcome.IssueTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case INVALID: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.INVALID); - break; - case STRUCTURE: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.STRUCTURE); - break; - case REQUIRED: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.REQUIRED); - break; - case VALUE: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.VALUE); - break; - case INVARIANT: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.INVARIANT); - break; - case SECURITY: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.SECURITY); - break; - case LOGIN: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.LOGIN); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.UNKNOWN); - break; - case EXPIRED: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.EXPIRED); - break; - case FORBIDDEN: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.FORBIDDEN); - break; - case SUPPRESSED: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.SUPPRESSED); - break; - case PROCESSING: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.PROCESSING); - break; - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.NOTSUPPORTED); - break; - case DUPLICATE: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.DUPLICATE); - break; - case NOTFOUND: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.NOTFOUND); - break; - case TOOLONG: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.TOOLONG); - break; - case CODEINVALID: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.CODEINVALID); - break; - case EXTENSION: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.EXTENSION); - break; - case TOOCOSTLY: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.TOOCOSTLY); - break; - case BUSINESSRULE: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.BUSINESSRULE); - break; - case CONFLICT: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.CONFLICT); - break; - case INCOMPLETE: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.INCOMPLETE); - break; - case TRANSIENT: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.TRANSIENT); - break; - case LOCKERROR: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.LOCKERROR); - break; - case NOSTORE: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.NOSTORE); - break; - case EXCEPTION: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.EXCEPTION); - break; - case TIMEOUT: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.TIMEOUT); - break; - case THROTTLED: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.THROTTLED); - break; - case INFORMATIONAL: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.INFORMATIONAL); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.OperationOutcome.IssueTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INVALID: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.INVALID); + break; + case STRUCTURE: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.STRUCTURE); + break; + case REQUIRED: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.REQUIRED); + break; + case VALUE: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.VALUE); + break; + case INVARIANT: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.INVARIANT); + break; + case SECURITY: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.SECURITY); + break; + case LOGIN: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.LOGIN); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.UNKNOWN); + break; + case EXPIRED: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.EXPIRED); + break; + case FORBIDDEN: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.FORBIDDEN); + break; + case SUPPRESSED: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.SUPPRESSED); + break; + case PROCESSING: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.PROCESSING); + break; + case NOTSUPPORTED: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.NOTSUPPORTED); + break; + case DUPLICATE: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.DUPLICATE); + break; + case NOTFOUND: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.NOTFOUND); + break; + case TOOLONG: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.TOOLONG); + break; + case CODEINVALID: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.CODEINVALID); + break; + case EXTENSION: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.EXTENSION); + break; + case TOOCOSTLY: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.TOOCOSTLY); + break; + case BUSINESSRULE: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.BUSINESSRULE); + break; + case CONFLICT: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.CONFLICT); + break; + case INCOMPLETE: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.INCOMPLETE); + break; + case TRANSIENT: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.TRANSIENT); + break; + case LOCKERROR: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.LOCKERROR); + break; + case NOSTORE: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.NOSTORE); + break; + case EXCEPTION: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.EXCEPTION); + break; + case TIMEOUT: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.TIMEOUT); + break; + case THROTTLED: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.THROTTLED); + break; + case INFORMATIONAL: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.INFORMATIONAL); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.OperationOutcome convertOperationOutcome(org.hl7.fhir.r4.model.OperationOutcome src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Patient30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Patient30_40.java index 43d54d2401..05faf86d47 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Patient30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Patient30_40.java @@ -11,6 +11,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.Period30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Boolean30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Date30_40; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.Patient; import org.hl7.fhir.exceptions.FHIRException; public class Patient30_40 { @@ -89,53 +91,61 @@ public static org.hl7.fhir.dstu3.model.Patient.ContactComponent convertContactCo } static public org.hl7.fhir.dstu3.model.Enumeration convertLinkType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Patient.LinkTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case REPLACEDBY: - tgt.setValue(org.hl7.fhir.dstu3.model.Patient.LinkType.REPLACEDBY); - break; - case REPLACES: - tgt.setValue(org.hl7.fhir.dstu3.model.Patient.LinkType.REPLACES); - break; - case REFER: - tgt.setValue(org.hl7.fhir.dstu3.model.Patient.LinkType.REFER); - break; - case SEEALSO: - tgt.setValue(org.hl7.fhir.dstu3.model.Patient.LinkType.SEEALSO); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Patient.LinkType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Patient.LinkTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REPLACEDBY: + tgt.setValue(Patient.LinkType.REPLACEDBY); + break; + case REPLACES: + tgt.setValue(Patient.LinkType.REPLACES); + break; + case REFER: + tgt.setValue(Patient.LinkType.REFER); + break; + case SEEALSO: + tgt.setValue(Patient.LinkType.SEEALSO); + break; + default: + tgt.setValue(Patient.LinkType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertLinkType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Patient.LinkTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case REPLACEDBY: - tgt.setValue(org.hl7.fhir.r4.model.Patient.LinkType.REPLACEDBY); - break; - case REPLACES: - tgt.setValue(org.hl7.fhir.r4.model.Patient.LinkType.REPLACES); - break; - case REFER: - tgt.setValue(org.hl7.fhir.r4.model.Patient.LinkType.REFER); - break; - case SEEALSO: - tgt.setValue(org.hl7.fhir.r4.model.Patient.LinkType.SEEALSO); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Patient.LinkType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Patient.LinkTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REPLACEDBY: + tgt.setValue(org.hl7.fhir.r4.model.Patient.LinkType.REPLACEDBY); + break; + case REPLACES: + tgt.setValue(org.hl7.fhir.r4.model.Patient.LinkType.REPLACES); + break; + case REFER: + tgt.setValue(org.hl7.fhir.r4.model.Patient.LinkType.REFER); + break; + case SEEALSO: + tgt.setValue(org.hl7.fhir.r4.model.Patient.LinkType.SEEALSO); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Patient.LinkType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.Patient convertPatient(org.hl7.fhir.r4.model.Patient src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/PaymentNotice30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/PaymentNotice30_40.java index 8f4eefd986..9b1d55db26 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/PaymentNotice30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/PaymentNotice30_40.java @@ -7,6 +7,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Date30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.DateTime30_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Enumeration; +import org.hl7.fhir.r4.model.PaymentNotice; public class PaymentNotice30_40 { @@ -63,52 +65,60 @@ public static org.hl7.fhir.dstu3.model.PaymentNotice convertPaymentNotice(org.hl } static public org.hl7.fhir.r4.model.Enumeration convertPaymentNoticeStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.PaymentNotice.PaymentNoticeStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.PaymentNotice.PaymentNoticeStatus.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.PaymentNotice.PaymentNoticeStatus.CANCELLED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r4.model.PaymentNotice.PaymentNoticeStatus.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.PaymentNotice.PaymentNoticeStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.PaymentNotice.PaymentNoticeStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new PaymentNotice.PaymentNoticeStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(PaymentNotice.PaymentNoticeStatus.ACTIVE); + break; + case CANCELLED: + tgt.setValue(PaymentNotice.PaymentNoticeStatus.CANCELLED); + break; + case DRAFT: + tgt.setValue(PaymentNotice.PaymentNoticeStatus.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(PaymentNotice.PaymentNoticeStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(PaymentNotice.PaymentNoticeStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertPaymentNoticeStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.PaymentNotice.PaymentNoticeStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.PaymentNotice.PaymentNoticeStatus.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu3.model.PaymentNotice.PaymentNoticeStatus.CANCELLED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.dstu3.model.PaymentNotice.PaymentNoticeStatus.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.PaymentNotice.PaymentNoticeStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.PaymentNotice.PaymentNoticeStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.PaymentNotice.PaymentNoticeStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu3.model.PaymentNotice.PaymentNoticeStatus.ACTIVE); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.dstu3.model.PaymentNotice.PaymentNoticeStatus.CANCELLED); + break; + case DRAFT: + tgt.setValue(org.hl7.fhir.dstu3.model.PaymentNotice.PaymentNoticeStatus.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu3.model.PaymentNotice.PaymentNoticeStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.PaymentNotice.PaymentNoticeStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Person30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Person30_40.java index a24d494785..503844e95c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Person30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Person30_40.java @@ -10,57 +10,67 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Boolean30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Date30_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Enumeration; +import org.hl7.fhir.r4.model.Person; public class Person30_40 { static public org.hl7.fhir.r4.model.Enumeration convertIdentityAssuranceLevel(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Person.IdentityAssuranceLevelEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case LEVEL1: - tgt.setValue(org.hl7.fhir.r4.model.Person.IdentityAssuranceLevel.LEVEL1); - break; - case LEVEL2: - tgt.setValue(org.hl7.fhir.r4.model.Person.IdentityAssuranceLevel.LEVEL2); - break; - case LEVEL3: - tgt.setValue(org.hl7.fhir.r4.model.Person.IdentityAssuranceLevel.LEVEL3); - break; - case LEVEL4: - tgt.setValue(org.hl7.fhir.r4.model.Person.IdentityAssuranceLevel.LEVEL4); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Person.IdentityAssuranceLevel.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Person.IdentityAssuranceLevelEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case LEVEL1: + tgt.setValue(Person.IdentityAssuranceLevel.LEVEL1); + break; + case LEVEL2: + tgt.setValue(Person.IdentityAssuranceLevel.LEVEL2); + break; + case LEVEL3: + tgt.setValue(Person.IdentityAssuranceLevel.LEVEL3); + break; + case LEVEL4: + tgt.setValue(Person.IdentityAssuranceLevel.LEVEL4); + break; + default: + tgt.setValue(Person.IdentityAssuranceLevel.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertIdentityAssuranceLevel(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Person.IdentityAssuranceLevelEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case LEVEL1: - tgt.setValue(org.hl7.fhir.dstu3.model.Person.IdentityAssuranceLevel.LEVEL1); - break; - case LEVEL2: - tgt.setValue(org.hl7.fhir.dstu3.model.Person.IdentityAssuranceLevel.LEVEL2); - break; - case LEVEL3: - tgt.setValue(org.hl7.fhir.dstu3.model.Person.IdentityAssuranceLevel.LEVEL3); - break; - case LEVEL4: - tgt.setValue(org.hl7.fhir.dstu3.model.Person.IdentityAssuranceLevel.LEVEL4); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Person.IdentityAssuranceLevel.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Person.IdentityAssuranceLevelEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case LEVEL1: + tgt.setValue(org.hl7.fhir.dstu3.model.Person.IdentityAssuranceLevel.LEVEL1); + break; + case LEVEL2: + tgt.setValue(org.hl7.fhir.dstu3.model.Person.IdentityAssuranceLevel.LEVEL2); + break; + case LEVEL3: + tgt.setValue(org.hl7.fhir.dstu3.model.Person.IdentityAssuranceLevel.LEVEL3); + break; + case LEVEL4: + tgt.setValue(org.hl7.fhir.dstu3.model.Person.IdentityAssuranceLevel.LEVEL4); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Person.IdentityAssuranceLevel.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r4.model.Person convertPerson(org.hl7.fhir.dstu3.model.Person src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/PlanDefinition30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/PlanDefinition30_40.java index 597d236a0c..e2b6993480 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/PlanDefinition30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/PlanDefinition30_40.java @@ -21,401 +21,467 @@ import org.hl7.fhir.dstu3.model.ContactDetail; import org.hl7.fhir.dstu3.model.Contributor.ContributorType; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Enumeration; +import org.hl7.fhir.r4.model.PlanDefinition; public class PlanDefinition30_40 { static public org.hl7.fhir.r4.model.Enumeration convertActionCardinalityBehavior(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.PlanDefinition.ActionCardinalityBehaviorEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case SINGLE: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionCardinalityBehavior.SINGLE); - break; - case MULTIPLE: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionCardinalityBehavior.MULTIPLE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionCardinalityBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new PlanDefinition.ActionCardinalityBehaviorEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SINGLE: + tgt.setValue(PlanDefinition.ActionCardinalityBehavior.SINGLE); + break; + case MULTIPLE: + tgt.setValue(PlanDefinition.ActionCardinalityBehavior.MULTIPLE); + break; + default: + tgt.setValue(PlanDefinition.ActionCardinalityBehavior.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertActionCardinalityBehavior(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.PlanDefinition.ActionCardinalityBehaviorEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case SINGLE: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionCardinalityBehavior.SINGLE); - break; - case MULTIPLE: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionCardinalityBehavior.MULTIPLE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionCardinalityBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.PlanDefinition.ActionCardinalityBehaviorEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SINGLE: + tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionCardinalityBehavior.SINGLE); + break; + case MULTIPLE: + tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionCardinalityBehavior.MULTIPLE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionCardinalityBehavior.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertActionConditionKind(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.PlanDefinition.ActionConditionKindEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case APPLICABILITY: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionConditionKind.APPLICABILITY); - break; - case START: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionConditionKind.START); - break; - case STOP: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionConditionKind.STOP); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionConditionKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.PlanDefinition.ActionConditionKindEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case APPLICABILITY: + tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionConditionKind.APPLICABILITY); + break; + case START: + tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionConditionKind.START); + break; + case STOP: + tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionConditionKind.STOP); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionConditionKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertActionConditionKind(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.PlanDefinition.ActionConditionKindEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case APPLICABILITY: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionConditionKind.APPLICABILITY); - break; - case START: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionConditionKind.START); - break; - case STOP: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionConditionKind.STOP); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionConditionKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new PlanDefinition.ActionConditionKindEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case APPLICABILITY: + tgt.setValue(PlanDefinition.ActionConditionKind.APPLICABILITY); + break; + case START: + tgt.setValue(PlanDefinition.ActionConditionKind.START); + break; + case STOP: + tgt.setValue(PlanDefinition.ActionConditionKind.STOP); + break; + default: + tgt.setValue(PlanDefinition.ActionConditionKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertActionGroupingBehavior(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.PlanDefinition.ActionGroupingBehaviorEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case VISUALGROUP: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionGroupingBehavior.VISUALGROUP); - break; - case LOGICALGROUP: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionGroupingBehavior.LOGICALGROUP); - break; - case SENTENCEGROUP: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionGroupingBehavior.SENTENCEGROUP); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionGroupingBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.PlanDefinition.ActionGroupingBehaviorEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case VISUALGROUP: + tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionGroupingBehavior.VISUALGROUP); + break; + case LOGICALGROUP: + tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionGroupingBehavior.LOGICALGROUP); + break; + case SENTENCEGROUP: + tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionGroupingBehavior.SENTENCEGROUP); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionGroupingBehavior.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertActionGroupingBehavior(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.PlanDefinition.ActionGroupingBehaviorEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case VISUALGROUP: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionGroupingBehavior.VISUALGROUP); - break; - case LOGICALGROUP: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionGroupingBehavior.LOGICALGROUP); - break; - case SENTENCEGROUP: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionGroupingBehavior.SENTENCEGROUP); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionGroupingBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new PlanDefinition.ActionGroupingBehaviorEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case VISUALGROUP: + tgt.setValue(PlanDefinition.ActionGroupingBehavior.VISUALGROUP); + break; + case LOGICALGROUP: + tgt.setValue(PlanDefinition.ActionGroupingBehavior.LOGICALGROUP); + break; + case SENTENCEGROUP: + tgt.setValue(PlanDefinition.ActionGroupingBehavior.SENTENCEGROUP); + break; + default: + tgt.setValue(PlanDefinition.ActionGroupingBehavior.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertActionParticipantType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.PlanDefinition.ActionParticipantTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PATIENT: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionParticipantType.PATIENT); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionParticipantType.PRACTITIONER); - break; - case RELATEDPERSON: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionParticipantType.RELATEDPERSON); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionParticipantType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.PlanDefinition.ActionParticipantTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PATIENT: + tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionParticipantType.PATIENT); + break; + case PRACTITIONER: + tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionParticipantType.PRACTITIONER); + break; + case RELATEDPERSON: + tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionParticipantType.RELATEDPERSON); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionParticipantType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertActionParticipantType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.PlanDefinition.ActionParticipantTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PATIENT: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionParticipantType.PATIENT); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionParticipantType.PRACTITIONER); - break; - case RELATEDPERSON: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionParticipantType.RELATEDPERSON); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionParticipantType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new PlanDefinition.ActionParticipantTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PATIENT: + tgt.setValue(PlanDefinition.ActionParticipantType.PATIENT); + break; + case PRACTITIONER: + tgt.setValue(PlanDefinition.ActionParticipantType.PRACTITIONER); + break; + case RELATEDPERSON: + tgt.setValue(PlanDefinition.ActionParticipantType.RELATEDPERSON); + break; + default: + tgt.setValue(PlanDefinition.ActionParticipantType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertActionPrecheckBehavior(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.PlanDefinition.ActionPrecheckBehaviorEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case YES: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionPrecheckBehavior.YES); - break; - case NO: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionPrecheckBehavior.NO); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionPrecheckBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.PlanDefinition.ActionPrecheckBehaviorEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case YES: + tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionPrecheckBehavior.YES); + break; + case NO: + tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionPrecheckBehavior.NO); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionPrecheckBehavior.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertActionPrecheckBehavior(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.PlanDefinition.ActionPrecheckBehaviorEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case YES: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionPrecheckBehavior.YES); - break; - case NO: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionPrecheckBehavior.NO); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionPrecheckBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new PlanDefinition.ActionPrecheckBehaviorEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case YES: + tgt.setValue(PlanDefinition.ActionPrecheckBehavior.YES); + break; + case NO: + tgt.setValue(PlanDefinition.ActionPrecheckBehavior.NO); + break; + default: + tgt.setValue(PlanDefinition.ActionPrecheckBehavior.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertActionRelationshipType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case BEFORESTART: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.BEFORESTART); - break; - case BEFORE: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.BEFORE); - break; - case BEFOREEND: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.BEFOREEND); - break; - case CONCURRENTWITHSTART: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.CONCURRENTWITHSTART); - break; - case CONCURRENT: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.CONCURRENT); - break; - case CONCURRENTWITHEND: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.CONCURRENTWITHEND); - break; - case AFTERSTART: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.AFTERSTART); - break; - case AFTER: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.AFTER); - break; - case AFTEREND: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.AFTEREND); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new PlanDefinition.ActionRelationshipTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case BEFORESTART: + tgt.setValue(PlanDefinition.ActionRelationshipType.BEFORESTART); + break; + case BEFORE: + tgt.setValue(PlanDefinition.ActionRelationshipType.BEFORE); + break; + case BEFOREEND: + tgt.setValue(PlanDefinition.ActionRelationshipType.BEFOREEND); + break; + case CONCURRENTWITHSTART: + tgt.setValue(PlanDefinition.ActionRelationshipType.CONCURRENTWITHSTART); + break; + case CONCURRENT: + tgt.setValue(PlanDefinition.ActionRelationshipType.CONCURRENT); + break; + case CONCURRENTWITHEND: + tgt.setValue(PlanDefinition.ActionRelationshipType.CONCURRENTWITHEND); + break; + case AFTERSTART: + tgt.setValue(PlanDefinition.ActionRelationshipType.AFTERSTART); + break; + case AFTER: + tgt.setValue(PlanDefinition.ActionRelationshipType.AFTER); + break; + case AFTEREND: + tgt.setValue(PlanDefinition.ActionRelationshipType.AFTEREND); + break; + default: + tgt.setValue(PlanDefinition.ActionRelationshipType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertActionRelationshipType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.PlanDefinition.ActionRelationshipTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case BEFORESTART: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRelationshipType.BEFORESTART); - break; - case BEFORE: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRelationshipType.BEFORE); - break; - case BEFOREEND: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRelationshipType.BEFOREEND); - break; - case CONCURRENTWITHSTART: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRelationshipType.CONCURRENTWITHSTART); - break; - case CONCURRENT: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRelationshipType.CONCURRENT); - break; - case CONCURRENTWITHEND: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRelationshipType.CONCURRENTWITHEND); - break; - case AFTERSTART: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRelationshipType.AFTERSTART); - break; - case AFTER: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRelationshipType.AFTER); - break; - case AFTEREND: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRelationshipType.AFTEREND); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRelationshipType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.PlanDefinition.ActionRelationshipTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case BEFORESTART: + tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRelationshipType.BEFORESTART); + break; + case BEFORE: + tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRelationshipType.BEFORE); + break; + case BEFOREEND: + tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRelationshipType.BEFOREEND); + break; + case CONCURRENTWITHSTART: + tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRelationshipType.CONCURRENTWITHSTART); + break; + case CONCURRENT: + tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRelationshipType.CONCURRENT); + break; + case CONCURRENTWITHEND: + tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRelationshipType.CONCURRENTWITHEND); + break; + case AFTERSTART: + tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRelationshipType.AFTERSTART); + break; + case AFTER: + tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRelationshipType.AFTER); + break; + case AFTEREND: + tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRelationshipType.AFTEREND); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRelationshipType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertActionRequiredBehavior(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.PlanDefinition.ActionRequiredBehaviorEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case MUST: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRequiredBehavior.MUST); - break; - case COULD: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRequiredBehavior.COULD); - break; - case MUSTUNLESSDOCUMENTED: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRequiredBehavior.MUSTUNLESSDOCUMENTED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRequiredBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.PlanDefinition.ActionRequiredBehaviorEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MUST: + tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRequiredBehavior.MUST); + break; + case COULD: + tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRequiredBehavior.COULD); + break; + case MUSTUNLESSDOCUMENTED: + tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRequiredBehavior.MUSTUNLESSDOCUMENTED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRequiredBehavior.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertActionRequiredBehavior(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.PlanDefinition.ActionRequiredBehaviorEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case MUST: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRequiredBehavior.MUST); - break; - case COULD: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRequiredBehavior.COULD); - break; - case MUSTUNLESSDOCUMENTED: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRequiredBehavior.MUSTUNLESSDOCUMENTED); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRequiredBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new PlanDefinition.ActionRequiredBehaviorEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MUST: + tgt.setValue(PlanDefinition.ActionRequiredBehavior.MUST); + break; + case COULD: + tgt.setValue(PlanDefinition.ActionRequiredBehavior.COULD); + break; + case MUSTUNLESSDOCUMENTED: + tgt.setValue(PlanDefinition.ActionRequiredBehavior.MUSTUNLESSDOCUMENTED); + break; + default: + tgt.setValue(PlanDefinition.ActionRequiredBehavior.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertActionSelectionBehavior(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehaviorEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case ANY: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior.ANY); - break; - case ALL: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior.ALL); - break; - case ALLORNONE: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior.ALLORNONE); - break; - case EXACTLYONE: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior.EXACTLYONE); - break; - case ATMOSTONE: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior.ATMOSTONE); - break; - case ONEORMORE: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior.ONEORMORE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new PlanDefinition.ActionSelectionBehaviorEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ANY: + tgt.setValue(PlanDefinition.ActionSelectionBehavior.ANY); + break; + case ALL: + tgt.setValue(PlanDefinition.ActionSelectionBehavior.ALL); + break; + case ALLORNONE: + tgt.setValue(PlanDefinition.ActionSelectionBehavior.ALLORNONE); + break; + case EXACTLYONE: + tgt.setValue(PlanDefinition.ActionSelectionBehavior.EXACTLYONE); + break; + case ATMOSTONE: + tgt.setValue(PlanDefinition.ActionSelectionBehavior.ATMOSTONE); + break; + case ONEORMORE: + tgt.setValue(PlanDefinition.ActionSelectionBehavior.ONEORMORE); + break; + default: + tgt.setValue(PlanDefinition.ActionSelectionBehavior.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertActionSelectionBehavior(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.PlanDefinition.ActionSelectionBehaviorEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case ANY: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionSelectionBehavior.ANY); - break; - case ALL: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionSelectionBehavior.ALL); - break; - case ALLORNONE: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionSelectionBehavior.ALLORNONE); - break; - case EXACTLYONE: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionSelectionBehavior.EXACTLYONE); - break; - case ATMOSTONE: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionSelectionBehavior.ATMOSTONE); - break; - case ONEORMORE: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionSelectionBehavior.ONEORMORE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionSelectionBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.PlanDefinition.ActionSelectionBehaviorEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ANY: + tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionSelectionBehavior.ANY); + break; + case ALL: + tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionSelectionBehavior.ALL); + break; + case ALLORNONE: + tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionSelectionBehavior.ALLORNONE); + break; + case EXACTLYONE: + tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionSelectionBehavior.EXACTLYONE); + break; + case ATMOSTONE: + tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionSelectionBehavior.ATMOSTONE); + break; + case ONEORMORE: + tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionSelectionBehavior.ONEORMORE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionSelectionBehavior.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r4.model.PlanDefinition convertPlanDefinition(org.hl7.fhir.dstu3.model.PlanDefinition src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/PractitionerRole30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/PractitionerRole30_40.java index 8a29b696cc..937d02ff30 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/PractitionerRole30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/PractitionerRole30_40.java @@ -12,6 +12,7 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Time30_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.PractitionerRole; public class PractitionerRole30_40 { @@ -146,35 +147,35 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.PractitionerRole.DaysOfWeekEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.PractitionerRole.DaysOfWeek.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case MON: - tgt.setValue(org.hl7.fhir.r4.model.PractitionerRole.DaysOfWeek.MON); - break; - case TUE: - tgt.setValue(org.hl7.fhir.r4.model.PractitionerRole.DaysOfWeek.TUE); - break; - case WED: - tgt.setValue(org.hl7.fhir.r4.model.PractitionerRole.DaysOfWeek.WED); - break; - case THU: - tgt.setValue(org.hl7.fhir.r4.model.PractitionerRole.DaysOfWeek.THU); - break; - case FRI: - tgt.setValue(org.hl7.fhir.r4.model.PractitionerRole.DaysOfWeek.FRI); - break; - case SAT: - tgt.setValue(org.hl7.fhir.r4.model.PractitionerRole.DaysOfWeek.SAT); - break; - case SUN: - tgt.setValue(org.hl7.fhir.r4.model.PractitionerRole.DaysOfWeek.SUN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.PractitionerRole.DaysOfWeek.NULL); - break; - } - } + tgt.setValue(PractitionerRole.DaysOfWeek.MON); + break; + case TUE: + tgt.setValue(PractitionerRole.DaysOfWeek.TUE); + break; + case WED: + tgt.setValue(PractitionerRole.DaysOfWeek.WED); + break; + case THU: + tgt.setValue(PractitionerRole.DaysOfWeek.THU); + break; + case FRI: + tgt.setValue(PractitionerRole.DaysOfWeek.FRI); + break; + case SAT: + tgt.setValue(PractitionerRole.DaysOfWeek.SAT); + break; + case SUN: + tgt.setValue(PractitionerRole.DaysOfWeek.SUN); + break; + default: + tgt.setValue(PractitionerRole.DaysOfWeek.NULL); + break; + } +} return tgt; } @@ -183,35 +184,35 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.PractitionerRole.DaysOfWeekEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.PractitionerRole.DaysOfWeek.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case MON: - tgt.setValue(org.hl7.fhir.dstu3.model.PractitionerRole.DaysOfWeek.MON); - break; - case TUE: - tgt.setValue(org.hl7.fhir.dstu3.model.PractitionerRole.DaysOfWeek.TUE); - break; - case WED: - tgt.setValue(org.hl7.fhir.dstu3.model.PractitionerRole.DaysOfWeek.WED); - break; - case THU: - tgt.setValue(org.hl7.fhir.dstu3.model.PractitionerRole.DaysOfWeek.THU); - break; - case FRI: - tgt.setValue(org.hl7.fhir.dstu3.model.PractitionerRole.DaysOfWeek.FRI); - break; - case SAT: - tgt.setValue(org.hl7.fhir.dstu3.model.PractitionerRole.DaysOfWeek.SAT); - break; - case SUN: - tgt.setValue(org.hl7.fhir.dstu3.model.PractitionerRole.DaysOfWeek.SUN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.PractitionerRole.DaysOfWeek.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.PractitionerRole.DaysOfWeek.MON); + break; + case TUE: + tgt.setValue(org.hl7.fhir.dstu3.model.PractitionerRole.DaysOfWeek.TUE); + break; + case WED: + tgt.setValue(org.hl7.fhir.dstu3.model.PractitionerRole.DaysOfWeek.WED); + break; + case THU: + tgt.setValue(org.hl7.fhir.dstu3.model.PractitionerRole.DaysOfWeek.THU); + break; + case FRI: + tgt.setValue(org.hl7.fhir.dstu3.model.PractitionerRole.DaysOfWeek.FRI); + break; + case SAT: + tgt.setValue(org.hl7.fhir.dstu3.model.PractitionerRole.DaysOfWeek.SAT); + break; + case SUN: + tgt.setValue(org.hl7.fhir.dstu3.model.PractitionerRole.DaysOfWeek.SUN); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.PractitionerRole.DaysOfWeek.NULL); + break; + } +} return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Procedure30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Procedure30_40.java index 1d402524ed..fd1ef085dc 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Procedure30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Procedure30_40.java @@ -6,6 +6,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.CodeableConcept30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.Identifier30_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Enumeration; +import org.hl7.fhir.r4.model.Procedure; public class Procedure30_40 { @@ -267,70 +269,78 @@ static public org.hl7.fhir.dstu3.model.Procedure.ProcedurePerformerComponent con } static public org.hl7.fhir.r4.model.Enumeration convertProcedureStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Procedure.ProcedureStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PREPARATION: - tgt.setValue(org.hl7.fhir.r4.model.Procedure.ProcedureStatus.PREPARATION); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r4.model.Procedure.ProcedureStatus.INPROGRESS); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.r4.model.Procedure.ProcedureStatus.ONHOLD); - break; - case ABORTED: - tgt.setValue(org.hl7.fhir.r4.model.Procedure.ProcedureStatus.STOPPED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.Procedure.ProcedureStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Procedure.ProcedureStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.Procedure.ProcedureStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Procedure.ProcedureStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Procedure.ProcedureStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PREPARATION: + tgt.setValue(Procedure.ProcedureStatus.PREPARATION); + break; + case INPROGRESS: + tgt.setValue(Procedure.ProcedureStatus.INPROGRESS); + break; + case SUSPENDED: + tgt.setValue(Procedure.ProcedureStatus.ONHOLD); + break; + case ABORTED: + tgt.setValue(Procedure.ProcedureStatus.STOPPED); + break; + case COMPLETED: + tgt.setValue(Procedure.ProcedureStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(Procedure.ProcedureStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Procedure.ProcedureStatus.UNKNOWN); + break; + default: + tgt.setValue(Procedure.ProcedureStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertProcedureStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Procedure.ProcedureStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PREPARATION: - tgt.setValue(org.hl7.fhir.dstu3.model.Procedure.ProcedureStatus.PREPARATION); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu3.model.Procedure.ProcedureStatus.INPROGRESS); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.dstu3.model.Procedure.ProcedureStatus.SUSPENDED); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.dstu3.model.Procedure.ProcedureStatus.ABORTED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.Procedure.ProcedureStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Procedure.ProcedureStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu3.model.Procedure.ProcedureStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Procedure.ProcedureStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Procedure.ProcedureStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PREPARATION: + tgt.setValue(org.hl7.fhir.dstu3.model.Procedure.ProcedureStatus.PREPARATION); + break; + case INPROGRESS: + tgt.setValue(org.hl7.fhir.dstu3.model.Procedure.ProcedureStatus.INPROGRESS); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.dstu3.model.Procedure.ProcedureStatus.SUSPENDED); + break; + case STOPPED: + tgt.setValue(org.hl7.fhir.dstu3.model.Procedure.ProcedureStatus.ABORTED); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.dstu3.model.Procedure.ProcedureStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu3.model.Procedure.ProcedureStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.dstu3.model.Procedure.ProcedureStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Procedure.ProcedureStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/ProcedureRequest30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/ProcedureRequest30_40.java index bd96968cc4..ad15e65766 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/ProcedureRequest30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/ProcedureRequest30_40.java @@ -9,8 +9,11 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.Identifier30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Boolean30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.DateTime30_40; +import org.hl7.fhir.dstu3.model.ProcedureRequest; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Enumeration; import org.hl7.fhir.r4.model.Reference; +import org.hl7.fhir.r4.model.ServiceRequest; public class ProcedureRequest30_40 { @@ -212,197 +215,221 @@ static public org.hl7.fhir.dstu3.model.ProcedureRequest convertProcedureRequest( } static public org.hl7.fhir.r4.model.Enumeration convertProcedureRequestIntent(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntentEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case FILLERORDER: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.FILLERORDER); - break; - case INSTANCEORDER: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.INSTANCEORDER); - break; - case OPTION: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.OPTION); - break; - case ORDER: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.ORDER); - break; - case ORIGINALORDER: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.ORIGINALORDER); - break; - case PLAN: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.PLAN); - break; - case PROPOSAL: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.PROPOSAL); - break; - case REFLEXORDER: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.REFLEXORDER); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ServiceRequest.ServiceRequestIntentEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FILLERORDER: + tgt.setValue(ServiceRequest.ServiceRequestIntent.FILLERORDER); + break; + case INSTANCEORDER: + tgt.setValue(ServiceRequest.ServiceRequestIntent.INSTANCEORDER); + break; + case OPTION: + tgt.setValue(ServiceRequest.ServiceRequestIntent.OPTION); + break; + case ORDER: + tgt.setValue(ServiceRequest.ServiceRequestIntent.ORDER); + break; + case ORIGINALORDER: + tgt.setValue(ServiceRequest.ServiceRequestIntent.ORIGINALORDER); + break; + case PLAN: + tgt.setValue(ServiceRequest.ServiceRequestIntent.PLAN); + break; + case PROPOSAL: + tgt.setValue(ServiceRequest.ServiceRequestIntent.PROPOSAL); + break; + case REFLEXORDER: + tgt.setValue(ServiceRequest.ServiceRequestIntent.REFLEXORDER); + break; + default: + tgt.setValue(ServiceRequest.ServiceRequestIntent.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertProcedureRequestIntent(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestIntentEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case DIRECTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestIntent.NULL); - break; - case FILLERORDER: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestIntent.FILLERORDER); - break; - case INSTANCEORDER: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestIntent.INSTANCEORDER); - break; - case OPTION: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestIntent.OPTION); - break; - case ORDER: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestIntent.ORDER); - break; - case ORIGINALORDER: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestIntent.ORIGINALORDER); - break; - case PLAN: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestIntent.PLAN); - break; - case PROPOSAL: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestIntent.PROPOSAL); - break; - case REFLEXORDER: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestIntent.REFLEXORDER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestIntent.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new ProcedureRequest.ProcedureRequestIntentEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DIRECTIVE: + tgt.setValue(ProcedureRequest.ProcedureRequestIntent.NULL); + break; + case FILLERORDER: + tgt.setValue(ProcedureRequest.ProcedureRequestIntent.FILLERORDER); + break; + case INSTANCEORDER: + tgt.setValue(ProcedureRequest.ProcedureRequestIntent.INSTANCEORDER); + break; + case OPTION: + tgt.setValue(ProcedureRequest.ProcedureRequestIntent.OPTION); + break; + case ORDER: + tgt.setValue(ProcedureRequest.ProcedureRequestIntent.ORDER); + break; + case ORIGINALORDER: + tgt.setValue(ProcedureRequest.ProcedureRequestIntent.ORIGINALORDER); + break; + case PLAN: + tgt.setValue(ProcedureRequest.ProcedureRequestIntent.PLAN); + break; + case PROPOSAL: + tgt.setValue(ProcedureRequest.ProcedureRequestIntent.PROPOSAL); + break; + case REFLEXORDER: + tgt.setValue(ProcedureRequest.ProcedureRequestIntent.REFLEXORDER); + break; + default: + tgt.setValue(ProcedureRequest.ProcedureRequestIntent.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertProcedureRequestPriority(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestPriorityEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case ASAP: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestPriority.ASAP); - break; - case ROUTINE: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestPriority.ROUTINE); - break; - case STAT: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestPriority.STAT); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestPriority.URGENT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new ProcedureRequest.ProcedureRequestPriorityEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ASAP: + tgt.setValue(ProcedureRequest.ProcedureRequestPriority.ASAP); + break; + case ROUTINE: + tgt.setValue(ProcedureRequest.ProcedureRequestPriority.ROUTINE); + break; + case STAT: + tgt.setValue(ProcedureRequest.ProcedureRequestPriority.STAT); + break; + case URGENT: + tgt.setValue(ProcedureRequest.ProcedureRequestPriority.URGENT); + break; + default: + tgt.setValue(ProcedureRequest.ProcedureRequestPriority.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertProcedureRequestPriority(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestPriorityEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case ASAP: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestPriority.ASAP); - break; - case ROUTINE: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestPriority.ROUTINE); - break; - case STAT: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestPriority.STAT); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestPriority.URGENT); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ServiceRequest.ServiceRequestPriorityEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ASAP: + tgt.setValue(ServiceRequest.ServiceRequestPriority.ASAP); + break; + case ROUTINE: + tgt.setValue(ServiceRequest.ServiceRequestPriority.ROUTINE); + break; + case STAT: + tgt.setValue(ServiceRequest.ServiceRequestPriority.STAT); + break; + case URGENT: + tgt.setValue(ServiceRequest.ServiceRequestPriority.URGENT); + break; + default: + tgt.setValue(ServiceRequest.ServiceRequestPriority.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertProcedureRequestStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestStatus.ACTIVE); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestStatus.COMPLETED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestStatus.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestStatus.ENTEREDINERROR); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestStatus.SUSPENDED); - break; - case REVOKED: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestStatus.CANCELLED); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ProcedureRequest.ProcedureRequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new ProcedureRequest.ProcedureRequestStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(ProcedureRequest.ProcedureRequestStatus.ACTIVE); + break; + case COMPLETED: + tgt.setValue(ProcedureRequest.ProcedureRequestStatus.COMPLETED); + break; + case DRAFT: + tgt.setValue(ProcedureRequest.ProcedureRequestStatus.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(ProcedureRequest.ProcedureRequestStatus.ENTEREDINERROR); + break; + case ONHOLD: + tgt.setValue(ProcedureRequest.ProcedureRequestStatus.SUSPENDED); + break; + case REVOKED: + tgt.setValue(ProcedureRequest.ProcedureRequestStatus.CANCELLED); + break; + case UNKNOWN: + tgt.setValue(ProcedureRequest.ProcedureRequestStatus.UNKNOWN); + break; + default: + tgt.setValue(ProcedureRequest.ProcedureRequestStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertProcedureRequestStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus.REVOKED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus.COMPLETED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus.ENTEREDINERROR); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus.ONHOLD); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ServiceRequest.ServiceRequestStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(ServiceRequest.ServiceRequestStatus.ACTIVE); + break; + case CANCELLED: + tgt.setValue(ServiceRequest.ServiceRequestStatus.REVOKED); + break; + case COMPLETED: + tgt.setValue(ServiceRequest.ServiceRequestStatus.COMPLETED); + break; + case DRAFT: + tgt.setValue(ServiceRequest.ServiceRequestStatus.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(ServiceRequest.ServiceRequestStatus.ENTEREDINERROR); + break; + case SUSPENDED: + tgt.setValue(ServiceRequest.ServiceRequestStatus.ONHOLD); + break; + case UNKNOWN: + tgt.setValue(ServiceRequest.ServiceRequestStatus.UNKNOWN); + break; + default: + tgt.setValue(ServiceRequest.ServiceRequestStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Provenance30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Provenance30_40.java index 9908e0460f..95f96e402f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Provenance30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Provenance30_40.java @@ -8,10 +8,7 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.Signature30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Instant30_40; import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.r4.model.Identifier; -import org.hl7.fhir.r4.model.Reference; -import org.hl7.fhir.r4.model.Type; -import org.hl7.fhir.r4.model.UriType; +import org.hl7.fhir.r4.model.*; public class Provenance30_40 { @@ -157,58 +154,66 @@ else if (t instanceof UriType) } static public org.hl7.fhir.r4.model.Enumeration convertProvenanceEntityRole(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Provenance.ProvenanceEntityRoleEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case DERIVATION: - tgt.setValue(org.hl7.fhir.r4.model.Provenance.ProvenanceEntityRole.DERIVATION); - break; - case REVISION: - tgt.setValue(org.hl7.fhir.r4.model.Provenance.ProvenanceEntityRole.REVISION); - break; - case QUOTATION: - tgt.setValue(org.hl7.fhir.r4.model.Provenance.ProvenanceEntityRole.QUOTATION); - break; - case SOURCE: - tgt.setValue(org.hl7.fhir.r4.model.Provenance.ProvenanceEntityRole.SOURCE); - break; - case REMOVAL: - tgt.setValue(org.hl7.fhir.r4.model.Provenance.ProvenanceEntityRole.REMOVAL); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Provenance.ProvenanceEntityRole.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Provenance.ProvenanceEntityRoleEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DERIVATION: + tgt.setValue(Provenance.ProvenanceEntityRole.DERIVATION); + break; + case REVISION: + tgt.setValue(Provenance.ProvenanceEntityRole.REVISION); + break; + case QUOTATION: + tgt.setValue(Provenance.ProvenanceEntityRole.QUOTATION); + break; + case SOURCE: + tgt.setValue(Provenance.ProvenanceEntityRole.SOURCE); + break; + case REMOVAL: + tgt.setValue(Provenance.ProvenanceEntityRole.REMOVAL); + break; + default: + tgt.setValue(Provenance.ProvenanceEntityRole.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertProvenanceEntityRole(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityRoleEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case DERIVATION: - tgt.setValue(org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityRole.DERIVATION); - break; - case REVISION: - tgt.setValue(org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityRole.REVISION); - break; - case QUOTATION: - tgt.setValue(org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityRole.QUOTATION); - break; - case SOURCE: - tgt.setValue(org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityRole.SOURCE); - break; - case REMOVAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityRole.REMOVAL); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityRole.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityRoleEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DERIVATION: + tgt.setValue(org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityRole.DERIVATION); + break; + case REVISION: + tgt.setValue(org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityRole.REVISION); + break; + case QUOTATION: + tgt.setValue(org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityRole.QUOTATION); + break; + case SOURCE: + tgt.setValue(org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityRole.SOURCE); + break; + case REMOVAL: + tgt.setValue(org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityRole.REMOVAL); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityRole.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Questionnaire30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Questionnaire30_40.java index 7f941b333e..39e0cad879 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Questionnaire30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Questionnaire30_40.java @@ -17,6 +17,7 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Uri30_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Enumeration; import org.hl7.fhir.r4.model.Questionnaire; public class Questionnaire30_40 { @@ -249,130 +250,138 @@ public static org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemOptionComp } static public org.hl7.fhir.r4.model.Enumeration convertQuestionnaireItemType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case GROUP: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.GROUP); - break; - case DISPLAY: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.DISPLAY); - break; - case QUESTION: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.QUESTION); - break; - case BOOLEAN: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.BOOLEAN); - break; - case DECIMAL: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.DECIMAL); - break; - case INTEGER: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.INTEGER); - break; - case DATE: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.DATE); - break; - case DATETIME: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.DATETIME); - break; - case TIME: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.TIME); - break; - case STRING: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.STRING); - break; - case TEXT: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.TEXT); - break; - case URL: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.URL); - break; - case CHOICE: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.CHOICE); - break; - case OPENCHOICE: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.OPENCHOICE); - break; - case ATTACHMENT: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.ATTACHMENT); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.REFERENCE); - break; - case QUANTITY: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.QUANTITY); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Questionnaire.QuestionnaireItemTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case GROUP: + tgt.setValue(Questionnaire.QuestionnaireItemType.GROUP); + break; + case DISPLAY: + tgt.setValue(Questionnaire.QuestionnaireItemType.DISPLAY); + break; + case QUESTION: + tgt.setValue(Questionnaire.QuestionnaireItemType.QUESTION); + break; + case BOOLEAN: + tgt.setValue(Questionnaire.QuestionnaireItemType.BOOLEAN); + break; + case DECIMAL: + tgt.setValue(Questionnaire.QuestionnaireItemType.DECIMAL); + break; + case INTEGER: + tgt.setValue(Questionnaire.QuestionnaireItemType.INTEGER); + break; + case DATE: + tgt.setValue(Questionnaire.QuestionnaireItemType.DATE); + break; + case DATETIME: + tgt.setValue(Questionnaire.QuestionnaireItemType.DATETIME); + break; + case TIME: + tgt.setValue(Questionnaire.QuestionnaireItemType.TIME); + break; + case STRING: + tgt.setValue(Questionnaire.QuestionnaireItemType.STRING); + break; + case TEXT: + tgt.setValue(Questionnaire.QuestionnaireItemType.TEXT); + break; + case URL: + tgt.setValue(Questionnaire.QuestionnaireItemType.URL); + break; + case CHOICE: + tgt.setValue(Questionnaire.QuestionnaireItemType.CHOICE); + break; + case OPENCHOICE: + tgt.setValue(Questionnaire.QuestionnaireItemType.OPENCHOICE); + break; + case ATTACHMENT: + tgt.setValue(Questionnaire.QuestionnaireItemType.ATTACHMENT); + break; + case REFERENCE: + tgt.setValue(Questionnaire.QuestionnaireItemType.REFERENCE); + break; + case QUANTITY: + tgt.setValue(Questionnaire.QuestionnaireItemType.QUANTITY); + break; + default: + tgt.setValue(Questionnaire.QuestionnaireItemType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertQuestionnaireItemType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case GROUP: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.GROUP); - break; - case DISPLAY: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.DISPLAY); - break; - case QUESTION: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.QUESTION); - break; - case BOOLEAN: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.BOOLEAN); - break; - case DECIMAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.DECIMAL); - break; - case INTEGER: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.INTEGER); - break; - case DATE: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.DATE); - break; - case DATETIME: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.DATETIME); - break; - case TIME: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.TIME); - break; - case STRING: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.STRING); - break; - case TEXT: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.TEXT); - break; - case URL: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.URL); - break; - case CHOICE: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.CHOICE); - break; - case OPENCHOICE: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.OPENCHOICE); - break; - case ATTACHMENT: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.ATTACHMENT); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.REFERENCE); - break; - case QUANTITY: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.QUANTITY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case GROUP: + tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.GROUP); + break; + case DISPLAY: + tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.DISPLAY); + break; + case QUESTION: + tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.QUESTION); + break; + case BOOLEAN: + tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.BOOLEAN); + break; + case DECIMAL: + tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.DECIMAL); + break; + case INTEGER: + tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.INTEGER); + break; + case DATE: + tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.DATE); + break; + case DATETIME: + tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.DATETIME); + break; + case TIME: + tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.TIME); + break; + case STRING: + tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.STRING); + break; + case TEXT: + tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.TEXT); + break; + case URL: + tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.URL); + break; + case CHOICE: + tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.CHOICE); + break; + case OPENCHOICE: + tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.OPENCHOICE); + break; + case ATTACHMENT: + tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.ATTACHMENT); + break; + case REFERENCE: + tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.REFERENCE); + break; + case QUANTITY: + tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.QUANTITY); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/QuestionnaireResponse30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/QuestionnaireResponse30_40.java index f34940eb48..66433309d8 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/QuestionnaireResponse30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/QuestionnaireResponse30_40.java @@ -6,6 +6,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.DateTime30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Uri30_40; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.QuestionnaireResponse; import org.hl7.fhir.exceptions.FHIRException; public class QuestionnaireResponse30_40 { @@ -127,58 +129,66 @@ public static org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseI } static public org.hl7.fhir.dstu3.model.Enumeration convertQuestionnaireResponseStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseStatus.ENTEREDINERROR); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseStatus.STOPPED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED); + break; + case AMENDED: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED); + break; + case ENTEREDINERROR: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.ENTEREDINERROR); + break; + case STOPPED: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.STOPPED); + break; + default: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertQuestionnaireResponseStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.ENTEREDINERROR); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.STOPPED); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED); + break; + case AMENDED: + tgt.setValue(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.ENTEREDINERROR); + break; + case STOPPED: + tgt.setValue(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.STOPPED); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/RiskAssessment30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/RiskAssessment30_40.java index 85a8516d89..91c61128ef 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/RiskAssessment30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/RiskAssessment30_40.java @@ -6,6 +6,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.Identifier30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Decimal30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.RiskAssessment; import org.hl7.fhir.exceptions.FHIRException; public class RiskAssessment30_40 { @@ -136,76 +138,84 @@ public static org.hl7.fhir.dstu3.model.RiskAssessment.RiskAssessmentPredictionCo } static public org.hl7.fhir.dstu3.model.Enumeration convertRiskAssessmentStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.RiskAssessment.RiskAssessmentStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.dstu3.model.RiskAssessment.RiskAssessmentStatus.REGISTERED); - break; - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.dstu3.model.RiskAssessment.RiskAssessmentStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.dstu3.model.RiskAssessment.RiskAssessmentStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.dstu3.model.RiskAssessment.RiskAssessmentStatus.AMENDED); - break; - case CORRECTED: - tgt.setValue(org.hl7.fhir.dstu3.model.RiskAssessment.RiskAssessmentStatus.CORRECTED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu3.model.RiskAssessment.RiskAssessmentStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.RiskAssessment.RiskAssessmentStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu3.model.RiskAssessment.RiskAssessmentStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.RiskAssessment.RiskAssessmentStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new RiskAssessment.RiskAssessmentStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(RiskAssessment.RiskAssessmentStatus.REGISTERED); + break; + case PRELIMINARY: + tgt.setValue(RiskAssessment.RiskAssessmentStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(RiskAssessment.RiskAssessmentStatus.FINAL); + break; + case AMENDED: + tgt.setValue(RiskAssessment.RiskAssessmentStatus.AMENDED); + break; + case CORRECTED: + tgt.setValue(RiskAssessment.RiskAssessmentStatus.CORRECTED); + break; + case CANCELLED: + tgt.setValue(RiskAssessment.RiskAssessmentStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(RiskAssessment.RiskAssessmentStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(RiskAssessment.RiskAssessmentStatus.UNKNOWN); + break; + default: + tgt.setValue(RiskAssessment.RiskAssessmentStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertRiskAssessmentStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.REGISTERED); - break; - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.AMENDED); - break; - case CORRECTED: - tgt.setValue(org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.CORRECTED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.REGISTERED); + break; + case PRELIMINARY: + tgt.setValue(org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.FINAL); + break; + case AMENDED: + tgt.setValue(org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.AMENDED); + break; + case CORRECTED: + tgt.setValue(org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.CORRECTED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/SearchParameter30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/SearchParameter30_40.java index 619315bfa2..d2acab13f0 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/SearchParameter30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/SearchParameter30_40.java @@ -14,173 +14,191 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Uri30_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Enumeration; +import org.hl7.fhir.r4.model.SearchParameter; public class SearchParameter30_40 { static public org.hl7.fhir.r4.model.Enumeration convertSearchComparator(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.SearchParameter.SearchComparatorEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case EQ: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.EQ); - break; - case NE: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.NE); - break; - case GT: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.GT); - break; - case LT: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.LT); - break; - case GE: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.GE); - break; - case LE: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.LE); - break; - case SA: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.SA); - break; - case EB: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.EB); - break; - case AP: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.AP); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new SearchParameter.SearchComparatorEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQ: + tgt.setValue(SearchParameter.SearchComparator.EQ); + break; + case NE: + tgt.setValue(SearchParameter.SearchComparator.NE); + break; + case GT: + tgt.setValue(SearchParameter.SearchComparator.GT); + break; + case LT: + tgt.setValue(SearchParameter.SearchComparator.LT); + break; + case GE: + tgt.setValue(SearchParameter.SearchComparator.GE); + break; + case LE: + tgt.setValue(SearchParameter.SearchComparator.LE); + break; + case SA: + tgt.setValue(SearchParameter.SearchComparator.SA); + break; + case EB: + tgt.setValue(SearchParameter.SearchComparator.EB); + break; + case AP: + tgt.setValue(SearchParameter.SearchComparator.AP); + break; + default: + tgt.setValue(SearchParameter.SearchComparator.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertSearchComparator(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.SearchParameter.SearchComparatorEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case EQ: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchComparator.EQ); - break; - case NE: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchComparator.NE); - break; - case GT: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchComparator.GT); - break; - case LT: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchComparator.LT); - break; - case GE: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchComparator.GE); - break; - case LE: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchComparator.LE); - break; - case SA: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchComparator.SA); - break; - case EB: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchComparator.EB); - break; - case AP: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchComparator.AP); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchComparator.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.SearchParameter.SearchComparatorEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQ: + tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchComparator.EQ); + break; + case NE: + tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchComparator.NE); + break; + case GT: + tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchComparator.GT); + break; + case LT: + tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchComparator.LT); + break; + case GE: + tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchComparator.GE); + break; + case LE: + tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchComparator.LE); + break; + case SA: + tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchComparator.SA); + break; + case EB: + tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchComparator.EB); + break; + case AP: + tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchComparator.AP); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchComparator.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertSearchModifierCode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.SearchParameter.SearchModifierCodeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case MISSING: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchModifierCode.MISSING); - break; - case EXACT: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchModifierCode.EXACT); - break; - case CONTAINS: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchModifierCode.CONTAINS); - break; - case NOT: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchModifierCode.NOT); - break; - case TEXT: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchModifierCode.TEXT); - break; - case IN: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchModifierCode.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchModifierCode.NOTIN); - break; - case BELOW: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchModifierCode.BELOW); - break; - case ABOVE: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchModifierCode.ABOVE); - break; - case TYPE: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchModifierCode.TYPE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchModifierCode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.SearchParameter.SearchModifierCodeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MISSING: + tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchModifierCode.MISSING); + break; + case EXACT: + tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchModifierCode.EXACT); + break; + case CONTAINS: + tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchModifierCode.CONTAINS); + break; + case NOT: + tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchModifierCode.NOT); + break; + case TEXT: + tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchModifierCode.TEXT); + break; + case IN: + tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchModifierCode.IN); + break; + case NOTIN: + tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchModifierCode.NOTIN); + break; + case BELOW: + tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchModifierCode.BELOW); + break; + case ABOVE: + tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchModifierCode.ABOVE); + break; + case TYPE: + tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchModifierCode.TYPE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchModifierCode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertSearchModifierCode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.SearchParameter.SearchModifierCodeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case MISSING: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.MISSING); - break; - case EXACT: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.EXACT); - break; - case CONTAINS: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.CONTAINS); - break; - case NOT: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.NOT); - break; - case TEXT: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.TEXT); - break; - case IN: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.NOTIN); - break; - case BELOW: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.BELOW); - break; - case ABOVE: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.ABOVE); - break; - case TYPE: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.TYPE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new SearchParameter.SearchModifierCodeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MISSING: + tgt.setValue(SearchParameter.SearchModifierCode.MISSING); + break; + case EXACT: + tgt.setValue(SearchParameter.SearchModifierCode.EXACT); + break; + case CONTAINS: + tgt.setValue(SearchParameter.SearchModifierCode.CONTAINS); + break; + case NOT: + tgt.setValue(SearchParameter.SearchModifierCode.NOT); + break; + case TEXT: + tgt.setValue(SearchParameter.SearchModifierCode.TEXT); + break; + case IN: + tgt.setValue(SearchParameter.SearchModifierCode.IN); + break; + case NOTIN: + tgt.setValue(SearchParameter.SearchModifierCode.NOTIN); + break; + case BELOW: + tgt.setValue(SearchParameter.SearchModifierCode.BELOW); + break; + case ABOVE: + tgt.setValue(SearchParameter.SearchModifierCode.ABOVE); + break; + case TYPE: + tgt.setValue(SearchParameter.SearchModifierCode.TYPE); + break; + default: + tgt.setValue(SearchParameter.SearchModifierCode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.SearchParameter convertSearchParameter(org.hl7.fhir.r4.model.SearchParameter src) throws FHIRException { @@ -318,58 +336,66 @@ public static org.hl7.fhir.r4.model.SearchParameter.SearchParameterComponentComp } static public org.hl7.fhir.r4.model.Enumeration convertXPathUsageType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.SearchParameter.XPathUsageTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case NORMAL: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.NORMAL); - break; - case PHONETIC: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.PHONETIC); - break; - case NEARBY: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.NEARBY); - break; - case DISTANCE: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.DISTANCE); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new SearchParameter.XPathUsageTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NORMAL: + tgt.setValue(SearchParameter.XPathUsageType.NORMAL); + break; + case PHONETIC: + tgt.setValue(SearchParameter.XPathUsageType.PHONETIC); + break; + case NEARBY: + tgt.setValue(SearchParameter.XPathUsageType.NEARBY); + break; + case DISTANCE: + tgt.setValue(SearchParameter.XPathUsageType.DISTANCE); + break; + case OTHER: + tgt.setValue(SearchParameter.XPathUsageType.OTHER); + break; + default: + tgt.setValue(SearchParameter.XPathUsageType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertXPathUsageType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case NORMAL: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageType.NORMAL); - break; - case PHONETIC: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageType.PHONETIC); - break; - case NEARBY: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageType.NEARBY); - break; - case DISTANCE: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageType.DISTANCE); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageType.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NORMAL: + tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageType.NORMAL); + break; + case PHONETIC: + tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageType.PHONETIC); + break; + case NEARBY: + tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageType.NEARBY); + break; + case DISTANCE: + tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageType.DISTANCE); + break; + case OTHER: + tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageType.OTHER); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Sequence30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Sequence30_40.java index f5df5b91b8..36562ca2bd 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Sequence30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Sequence30_40.java @@ -9,108 +9,127 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Integer30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Uri30_40; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.Sequence; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.MolecularSequence; public class Sequence30_40 { static public org.hl7.fhir.dstu3.model.Enumeration convertQualityType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Sequence.QualityTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case INDEL: - tgt.setValue(org.hl7.fhir.dstu3.model.Sequence.QualityType.INDEL); - break; - case SNP: - tgt.setValue(org.hl7.fhir.dstu3.model.Sequence.QualityType.SNP); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu3.model.Sequence.QualityType.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Sequence.QualityType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Sequence.QualityTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INDEL: + tgt.setValue(Sequence.QualityType.INDEL); + break; + case SNP: + tgt.setValue(Sequence.QualityType.SNP); + break; + case UNKNOWN: + tgt.setValue(Sequence.QualityType.UNKNOWN); + break; + default: + tgt.setValue(Sequence.QualityType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertQualityType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MolecularSequence.QualityTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case INDEL: - tgt.setValue(org.hl7.fhir.r4.model.MolecularSequence.QualityType.INDEL); - break; - case SNP: - tgt.setValue(org.hl7.fhir.r4.model.MolecularSequence.QualityType.SNP); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.MolecularSequence.QualityType.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.MolecularSequence.QualityType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new MolecularSequence.QualityTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INDEL: + tgt.setValue(MolecularSequence.QualityType.INDEL); + break; + case SNP: + tgt.setValue(MolecularSequence.QualityType.SNP); + break; + case UNKNOWN: + tgt.setValue(MolecularSequence.QualityType.UNKNOWN); + break; + default: + tgt.setValue(MolecularSequence.QualityType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertRepositoryType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Sequence.RepositoryTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case DIRECTLINK: - tgt.setValue(org.hl7.fhir.dstu3.model.Sequence.RepositoryType.DIRECTLINK); - break; - case OPENAPI: - tgt.setValue(org.hl7.fhir.dstu3.model.Sequence.RepositoryType.OPENAPI); - break; - case LOGIN: - tgt.setValue(org.hl7.fhir.dstu3.model.Sequence.RepositoryType.LOGIN); - break; - case OAUTH: - tgt.setValue(org.hl7.fhir.dstu3.model.Sequence.RepositoryType.OAUTH); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.dstu3.model.Sequence.RepositoryType.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Sequence.RepositoryType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Sequence.RepositoryTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DIRECTLINK: + tgt.setValue(Sequence.RepositoryType.DIRECTLINK); + break; + case OPENAPI: + tgt.setValue(Sequence.RepositoryType.OPENAPI); + break; + case LOGIN: + tgt.setValue(Sequence.RepositoryType.LOGIN); + break; + case OAUTH: + tgt.setValue(Sequence.RepositoryType.OAUTH); + break; + case OTHER: + tgt.setValue(Sequence.RepositoryType.OTHER); + break; + default: + tgt.setValue(Sequence.RepositoryType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertRepositoryType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MolecularSequence.RepositoryTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case DIRECTLINK: - tgt.setValue(org.hl7.fhir.r4.model.MolecularSequence.RepositoryType.DIRECTLINK); - break; - case OPENAPI: - tgt.setValue(org.hl7.fhir.r4.model.MolecularSequence.RepositoryType.OPENAPI); - break; - case LOGIN: - tgt.setValue(org.hl7.fhir.r4.model.MolecularSequence.RepositoryType.LOGIN); - break; - case OAUTH: - tgt.setValue(org.hl7.fhir.r4.model.MolecularSequence.RepositoryType.OAUTH); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.r4.model.MolecularSequence.RepositoryType.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.MolecularSequence.RepositoryType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new MolecularSequence.RepositoryTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DIRECTLINK: + tgt.setValue(MolecularSequence.RepositoryType.DIRECTLINK); + break; + case OPENAPI: + tgt.setValue(MolecularSequence.RepositoryType.OPENAPI); + break; + case LOGIN: + tgt.setValue(MolecularSequence.RepositoryType.LOGIN); + break; + case OAUTH: + tgt.setValue(MolecularSequence.RepositoryType.OAUTH); + break; + case OTHER: + tgt.setValue(MolecularSequence.RepositoryType.OTHER); + break; + default: + tgt.setValue(MolecularSequence.RepositoryType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.Sequence convertSequence(org.hl7.fhir.r4.model.MolecularSequence src) throws FHIRException { @@ -344,47 +363,55 @@ public static org.hl7.fhir.dstu3.model.Sequence.SequenceRepositoryComponent conv } static public org.hl7.fhir.dstu3.model.Enumeration convertSequenceType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Sequence.SequenceTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case AA: - tgt.setValue(org.hl7.fhir.dstu3.model.Sequence.SequenceType.AA); - break; - case DNA: - tgt.setValue(org.hl7.fhir.dstu3.model.Sequence.SequenceType.DNA); - break; - case RNA: - tgt.setValue(org.hl7.fhir.dstu3.model.Sequence.SequenceType.RNA); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Sequence.SequenceType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Sequence.SequenceTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case AA: + tgt.setValue(Sequence.SequenceType.AA); + break; + case DNA: + tgt.setValue(Sequence.SequenceType.DNA); + break; + case RNA: + tgt.setValue(Sequence.SequenceType.RNA); + break; + default: + tgt.setValue(Sequence.SequenceType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertSequenceType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MolecularSequence.SequenceTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case AA: - tgt.setValue(org.hl7.fhir.r4.model.MolecularSequence.SequenceType.AA); - break; - case DNA: - tgt.setValue(org.hl7.fhir.r4.model.MolecularSequence.SequenceType.DNA); - break; - case RNA: - tgt.setValue(org.hl7.fhir.r4.model.MolecularSequence.SequenceType.RNA); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.MolecularSequence.SequenceType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new MolecularSequence.SequenceTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case AA: + tgt.setValue(MolecularSequence.SequenceType.AA); + break; + case DNA: + tgt.setValue(MolecularSequence.SequenceType.DNA); + break; + case RNA: + tgt.setValue(MolecularSequence.SequenceType.RNA); + break; + default: + tgt.setValue(MolecularSequence.SequenceType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r4.model.MolecularSequence.MolecularSequenceVariantComponent convertSequenceVariantComponent(org.hl7.fhir.dstu3.model.Sequence.SequenceVariantComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Slot30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Slot30_40.java index 1cf70270d1..33ca3e3e77 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Slot30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Slot30_40.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Instant30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Enumeration; +import org.hl7.fhir.r4.model.Slot; public class Slot30_40 { @@ -72,58 +74,66 @@ public static org.hl7.fhir.dstu3.model.Slot convertSlot(org.hl7.fhir.r4.model.Sl } static public org.hl7.fhir.r4.model.Enumeration convertSlotStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Slot.SlotStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case BUSY: - tgt.setValue(org.hl7.fhir.r4.model.Slot.SlotStatus.BUSY); - break; - case FREE: - tgt.setValue(org.hl7.fhir.r4.model.Slot.SlotStatus.FREE); - break; - case BUSYUNAVAILABLE: - tgt.setValue(org.hl7.fhir.r4.model.Slot.SlotStatus.BUSYUNAVAILABLE); - break; - case BUSYTENTATIVE: - tgt.setValue(org.hl7.fhir.r4.model.Slot.SlotStatus.BUSYTENTATIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Slot.SlotStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Slot.SlotStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Slot.SlotStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case BUSY: + tgt.setValue(Slot.SlotStatus.BUSY); + break; + case FREE: + tgt.setValue(Slot.SlotStatus.FREE); + break; + case BUSYUNAVAILABLE: + tgt.setValue(Slot.SlotStatus.BUSYUNAVAILABLE); + break; + case BUSYTENTATIVE: + tgt.setValue(Slot.SlotStatus.BUSYTENTATIVE); + break; + case ENTEREDINERROR: + tgt.setValue(Slot.SlotStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Slot.SlotStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertSlotStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Slot.SlotStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case BUSY: - tgt.setValue(org.hl7.fhir.dstu3.model.Slot.SlotStatus.BUSY); - break; - case FREE: - tgt.setValue(org.hl7.fhir.dstu3.model.Slot.SlotStatus.FREE); - break; - case BUSYUNAVAILABLE: - tgt.setValue(org.hl7.fhir.dstu3.model.Slot.SlotStatus.BUSYUNAVAILABLE); - break; - case BUSYTENTATIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Slot.SlotStatus.BUSYTENTATIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Slot.SlotStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Slot.SlotStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Slot.SlotStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case BUSY: + tgt.setValue(org.hl7.fhir.dstu3.model.Slot.SlotStatus.BUSY); + break; + case FREE: + tgt.setValue(org.hl7.fhir.dstu3.model.Slot.SlotStatus.FREE); + break; + case BUSYUNAVAILABLE: + tgt.setValue(org.hl7.fhir.dstu3.model.Slot.SlotStatus.BUSYUNAVAILABLE); + break; + case BUSYTENTATIVE: + tgt.setValue(org.hl7.fhir.dstu3.model.Slot.SlotStatus.BUSYTENTATIVE); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu3.model.Slot.SlotStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Slot.SlotStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Specimen30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Specimen30_40.java index bd99fe4e28..714d8e0551 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Specimen30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Specimen30_40.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.SimpleQuantity30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.DateTime30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.Specimen; import org.hl7.fhir.exceptions.FHIRException; public class Specimen30_40 { @@ -177,52 +179,60 @@ public static org.hl7.fhir.dstu3.model.Specimen.SpecimenProcessingComponent conv } static public org.hl7.fhir.dstu3.model.Enumeration convertSpecimenStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Specimen.SpecimenStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case AVAILABLE: - tgt.setValue(org.hl7.fhir.dstu3.model.Specimen.SpecimenStatus.AVAILABLE); - break; - case UNAVAILABLE: - tgt.setValue(org.hl7.fhir.dstu3.model.Specimen.SpecimenStatus.UNAVAILABLE); - break; - case UNSATISFACTORY: - tgt.setValue(org.hl7.fhir.dstu3.model.Specimen.SpecimenStatus.UNSATISFACTORY); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Specimen.SpecimenStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Specimen.SpecimenStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Specimen.SpecimenStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case AVAILABLE: + tgt.setValue(Specimen.SpecimenStatus.AVAILABLE); + break; + case UNAVAILABLE: + tgt.setValue(Specimen.SpecimenStatus.UNAVAILABLE); + break; + case UNSATISFACTORY: + tgt.setValue(Specimen.SpecimenStatus.UNSATISFACTORY); + break; + case ENTEREDINERROR: + tgt.setValue(Specimen.SpecimenStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Specimen.SpecimenStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertSpecimenStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Specimen.SpecimenStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case AVAILABLE: - tgt.setValue(org.hl7.fhir.r4.model.Specimen.SpecimenStatus.AVAILABLE); - break; - case UNAVAILABLE: - tgt.setValue(org.hl7.fhir.r4.model.Specimen.SpecimenStatus.UNAVAILABLE); - break; - case UNSATISFACTORY: - tgt.setValue(org.hl7.fhir.r4.model.Specimen.SpecimenStatus.UNSATISFACTORY); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Specimen.SpecimenStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Specimen.SpecimenStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Specimen.SpecimenStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case AVAILABLE: + tgt.setValue(org.hl7.fhir.r4.model.Specimen.SpecimenStatus.AVAILABLE); + break; + case UNAVAILABLE: + tgt.setValue(org.hl7.fhir.r4.model.Specimen.SpecimenStatus.UNAVAILABLE); + break; + case UNSATISFACTORY: + tgt.setValue(org.hl7.fhir.r4.model.Specimen.SpecimenStatus.UNSATISFACTORY); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.Specimen.SpecimenStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Specimen.SpecimenStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/StructureDefinition30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/StructureDefinition30_40.java index 7112fb48e7..b768befc88 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/StructureDefinition30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/StructureDefinition30_40.java @@ -14,57 +14,67 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Uri30_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Enumeration; +import org.hl7.fhir.r4.model.StructureDefinition; import org.hl7.fhir.utilities.Utilities; public class StructureDefinition30_40 { static public org.hl7.fhir.r4.model.Enumeration convertExtensionContext(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case RESOURCE: - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextType.ELEMENT); - break; - case DATATYPE: - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextType.ELEMENT); - break; - case EXTENSION: - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextType.EXTENSION); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureDefinition.ExtensionContextTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case RESOURCE: + tgt.setValue(StructureDefinition.ExtensionContextType.ELEMENT); + break; + case DATATYPE: + tgt.setValue(StructureDefinition.ExtensionContextType.ELEMENT); + break; + case EXTENSION: + tgt.setValue(StructureDefinition.ExtensionContextType.EXTENSION); + break; + default: + tgt.setValue(StructureDefinition.ExtensionContextType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertExtensionContext(org.hl7.fhir.r4.model.Enumeration src, String expression) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContextEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case FHIRPATH: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContext.RESOURCE); - break; - case ELEMENT: - String tn = expression.contains(".") ? expression.substring(0, expression.indexOf(".")) : expression; - if (isResource300(tn)) { - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContext.RESOURCE); - } else { - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContext.DATATYPE); - } - break; - case EXTENSION: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContext.EXTENSION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContext.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContextEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FHIRPATH: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContext.RESOURCE); + break; + case ELEMENT: + String tn = expression.contains(".") ? expression.substring(0, expression.indexOf(".")) : expression; + if (isResource300(tn)) { + tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContext.RESOURCE); + } else { + tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContext.DATATYPE); + } + break; + case EXTENSION: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContext.EXTENSION); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContext.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.StructureDefinition convertStructureDefinition(org.hl7.fhir.r4.model.StructureDefinition src) throws FHIRException { @@ -221,53 +231,61 @@ public static org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionDi } static public org.hl7.fhir.dstu3.model.Enumeration convertStructureDefinitionKind(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKindEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PRIMITIVETYPE: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKind.PRIMITIVETYPE); - break; - case COMPLEXTYPE: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKind.COMPLEXTYPE); - break; - case RESOURCE: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKind.RESOURCE); - break; - case LOGICAL: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKind.LOGICAL); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKindEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRIMITIVETYPE: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKind.PRIMITIVETYPE); + break; + case COMPLEXTYPE: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKind.COMPLEXTYPE); + break; + case RESOURCE: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKind.RESOURCE); + break; + case LOGICAL: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKind.LOGICAL); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertStructureDefinitionKind(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKindEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PRIMITIVETYPE: - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind.PRIMITIVETYPE); - break; - case COMPLEXTYPE: - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind.COMPLEXTYPE); - break; - case RESOURCE: - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind.RESOURCE); - break; - case LOGICAL: - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind.LOGICAL); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureDefinition.StructureDefinitionKindEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRIMITIVETYPE: + tgt.setValue(StructureDefinition.StructureDefinitionKind.PRIMITIVETYPE); + break; + case COMPLEXTYPE: + tgt.setValue(StructureDefinition.StructureDefinitionKind.COMPLEXTYPE); + break; + case RESOURCE: + tgt.setValue(StructureDefinition.StructureDefinitionKind.RESOURCE); + break; + case LOGICAL: + tgt.setValue(StructureDefinition.StructureDefinitionKind.LOGICAL); + break; + default: + tgt.setValue(StructureDefinition.StructureDefinitionKind.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionMappingComponent convertStructureDefinitionMappingComponent(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionMappingComponent src) throws FHIRException { @@ -323,41 +341,49 @@ public static org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionSnaps } static public org.hl7.fhir.r4.model.Enumeration convertTypeDerivationRule(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureDefinition.TypeDerivationRuleEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case SPECIALIZATION: - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.TypeDerivationRule.SPECIALIZATION); - break; - case CONSTRAINT: - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.TypeDerivationRule.CONSTRAINT); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.TypeDerivationRule.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureDefinition.TypeDerivationRuleEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SPECIALIZATION: + tgt.setValue(StructureDefinition.TypeDerivationRule.SPECIALIZATION); + break; + case CONSTRAINT: + tgt.setValue(StructureDefinition.TypeDerivationRule.CONSTRAINT); + break; + default: + tgt.setValue(StructureDefinition.TypeDerivationRule.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertTypeDerivationRule(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureDefinition.TypeDerivationRuleEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case SPECIALIZATION: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.TypeDerivationRule.SPECIALIZATION); - break; - case CONSTRAINT: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.TypeDerivationRule.CONSTRAINT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.TypeDerivationRule.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureDefinition.TypeDerivationRuleEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SPECIALIZATION: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.TypeDerivationRule.SPECIALIZATION); + break; + case CONSTRAINT: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.TypeDerivationRule.CONSTRAINT); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.TypeDerivationRule.NULL); + break; + } + } + return tgt; } static public boolean isResource300(String tn) { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/StructureMap30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/StructureMap30_40.java index cfa89c8426..51722a19d0 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/StructureMap30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/StructureMap30_40.java @@ -15,6 +15,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Uri30_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Enumeration; +import org.hl7.fhir.r4.model.StructureMap; public class StructureMap30_40 { @@ -105,41 +107,49 @@ public static org.hl7.fhir.r4.model.StructureMap convertStructureMap(org.hl7.fhi } static public org.hl7.fhir.r4.model.Enumeration convertStructureMapContextType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureMap.StructureMapContextTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case TYPE: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapContextType.TYPE); - break; - case VARIABLE: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapContextType.VARIABLE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapContextType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureMap.StructureMapContextTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case TYPE: + tgt.setValue(StructureMap.StructureMapContextType.TYPE); + break; + case VARIABLE: + tgt.setValue(StructureMap.StructureMapContextType.VARIABLE); + break; + default: + tgt.setValue(StructureMap.StructureMapContextType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertStructureMapContextType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureMap.StructureMapContextTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case TYPE: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapContextType.TYPE); - break; - case VARIABLE: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapContextType.VARIABLE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapContextType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureMap.StructureMapContextTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case TYPE: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapContextType.TYPE); + break; + case VARIABLE: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapContextType.VARIABLE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapContextType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupComponent convertStructureMapGroupComponent(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupComponent src) throws FHIRException { @@ -403,191 +413,223 @@ public static org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleTargetP } static public org.hl7.fhir.r4.model.Enumeration convertStructureMapGroupTypeMode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureMap.StructureMapGroupTypeModeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case NONE: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupTypeMode.NONE); - break; - case TYPES: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupTypeMode.TYPES); - break; - case TYPEANDTYPES: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupTypeMode.TYPEANDTYPES); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupTypeMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureMap.StructureMapGroupTypeModeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NONE: + tgt.setValue(StructureMap.StructureMapGroupTypeMode.NONE); + break; + case TYPES: + tgt.setValue(StructureMap.StructureMapGroupTypeMode.TYPES); + break; + case TYPEANDTYPES: + tgt.setValue(StructureMap.StructureMapGroupTypeMode.TYPEANDTYPES); + break; + default: + tgt.setValue(StructureMap.StructureMapGroupTypeMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertStructureMapGroupTypeMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupTypeModeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case NONE: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupTypeMode.NONE); - break; - case TYPES: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupTypeMode.TYPES); - break; - case TYPEANDTYPES: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupTypeMode.TYPEANDTYPES); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupTypeMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupTypeModeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NONE: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupTypeMode.NONE); + break; + case TYPES: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupTypeMode.TYPES); + break; + case TYPEANDTYPES: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupTypeMode.TYPEANDTYPES); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupTypeMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertStructureMapInputMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureMap.StructureMapInputModeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case SOURCE: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapInputMode.SOURCE); - break; - case TARGET: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapInputMode.TARGET); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapInputMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureMap.StructureMapInputModeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SOURCE: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapInputMode.SOURCE); + break; + case TARGET: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapInputMode.TARGET); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapInputMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertStructureMapInputMode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureMap.StructureMapInputModeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case SOURCE: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapInputMode.SOURCE); - break; - case TARGET: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapInputMode.TARGET); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapInputMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureMap.StructureMapInputModeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SOURCE: + tgt.setValue(StructureMap.StructureMapInputMode.SOURCE); + break; + case TARGET: + tgt.setValue(StructureMap.StructureMapInputMode.TARGET); + break; + default: + tgt.setValue(StructureMap.StructureMapInputMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertStructureMapModelMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureMap.StructureMapModelModeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case SOURCE: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapModelMode.SOURCE); - break; - case QUERIED: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapModelMode.QUERIED); - break; - case TARGET: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapModelMode.TARGET); - break; - case PRODUCED: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapModelMode.PRODUCED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapModelMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureMap.StructureMapModelModeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SOURCE: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapModelMode.SOURCE); + break; + case QUERIED: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapModelMode.QUERIED); + break; + case TARGET: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapModelMode.TARGET); + break; + case PRODUCED: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapModelMode.PRODUCED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapModelMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertStructureMapModelMode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureMap.StructureMapModelModeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case SOURCE: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode.SOURCE); - break; - case QUERIED: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode.QUERIED); - break; - case TARGET: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode.TARGET); - break; - case PRODUCED: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode.PRODUCED); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureMap.StructureMapModelModeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SOURCE: + tgt.setValue(StructureMap.StructureMapModelMode.SOURCE); + break; + case QUERIED: + tgt.setValue(StructureMap.StructureMapModelMode.QUERIED); + break; + case TARGET: + tgt.setValue(StructureMap.StructureMapModelMode.TARGET); + break; + case PRODUCED: + tgt.setValue(StructureMap.StructureMapModelMode.PRODUCED); + break; + default: + tgt.setValue(StructureMap.StructureMapModelMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertStructureMapSourceListMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureMap.StructureMapSourceListModeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case FIRST: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapSourceListMode.FIRST); - break; - case NOTFIRST: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapSourceListMode.NOTFIRST); - break; - case LAST: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapSourceListMode.LAST); - break; - case NOTLAST: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapSourceListMode.NOTLAST); - break; - case ONLYONE: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapSourceListMode.ONLYONE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapSourceListMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureMap.StructureMapSourceListModeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FIRST: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapSourceListMode.FIRST); + break; + case NOTFIRST: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapSourceListMode.NOTFIRST); + break; + case LAST: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapSourceListMode.LAST); + break; + case NOTLAST: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapSourceListMode.NOTLAST); + break; + case ONLYONE: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapSourceListMode.ONLYONE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapSourceListMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertStructureMapSourceListMode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListModeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case FIRST: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.FIRST); - break; - case NOTFIRST: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.NOTFIRST); - break; - case LAST: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.LAST); - break; - case NOTLAST: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.NOTLAST); - break; - case ONLYONE: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.ONLYONE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureMap.StructureMapSourceListModeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FIRST: + tgt.setValue(StructureMap.StructureMapSourceListMode.FIRST); + break; + case NOTFIRST: + tgt.setValue(StructureMap.StructureMapSourceListMode.NOTFIRST); + break; + case LAST: + tgt.setValue(StructureMap.StructureMapSourceListMode.LAST); + break; + case NOTLAST: + tgt.setValue(StructureMap.StructureMapSourceListMode.NOTLAST); + break; + case ONLYONE: + tgt.setValue(StructureMap.StructureMapSourceListMode.ONLYONE); + break; + default: + tgt.setValue(StructureMap.StructureMapSourceListMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.StructureMap.StructureMapStructureComponent convertStructureMapStructureComponent(org.hl7.fhir.r4.model.StructureMap.StructureMapStructureComponent src) throws FHIRException { @@ -623,180 +665,196 @@ public static org.hl7.fhir.r4.model.StructureMap.StructureMapStructureComponent } static public org.hl7.fhir.r4.model.Enumeration convertStructureMapTargetListMode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListModeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case FIRST: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListMode.FIRST); - break; - case SHARE: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListMode.SHARE); - break; - case LAST: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListMode.LAST); - break; - case COLLATE: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListMode.COLLATE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureMap.StructureMapTargetListModeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FIRST: + tgt.setValue(StructureMap.StructureMapTargetListMode.FIRST); + break; + case SHARE: + tgt.setValue(StructureMap.StructureMapTargetListMode.SHARE); + break; + case LAST: + tgt.setValue(StructureMap.StructureMapTargetListMode.LAST); + break; + case COLLATE: + tgt.setValue(StructureMap.StructureMapTargetListMode.COLLATE); + break; + default: + tgt.setValue(StructureMap.StructureMapTargetListMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertStructureMapTargetListMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureMap.StructureMapTargetListModeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case FIRST: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTargetListMode.FIRST); - break; - case SHARE: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTargetListMode.SHARE); - break; - case LAST: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTargetListMode.LAST); - break; - case COLLATE: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTargetListMode.COLLATE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTargetListMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureMap.StructureMapTargetListModeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FIRST: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTargetListMode.FIRST); + break; + case SHARE: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTargetListMode.SHARE); + break; + case LAST: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTargetListMode.LAST); + break; + case COLLATE: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTargetListMode.COLLATE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTargetListMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertStructureMapTransform(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureMap.StructureMapTransformEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case CREATE: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.CREATE); - break; - case COPY: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.COPY); - break; - case TRUNCATE: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.TRUNCATE); - break; - case ESCAPE: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.ESCAPE); - break; - case CAST: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.CAST); - break; - case APPEND: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.APPEND); - break; - case TRANSLATE: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.TRANSLATE); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.REFERENCE); - break; - case DATEOP: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.DATEOP); - break; - case UUID: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.UUID); - break; - case POINTER: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.POINTER); - break; - case EVALUATE: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.EVALUATE); - break; - case CC: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.CC); - break; - case C: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.C); - break; - case QTY: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.QTY); - break; - case ID: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.ID); - break; - case CP: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.CP); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureMap.StructureMapTransformEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CREATE: + tgt.setValue(StructureMap.StructureMapTransform.CREATE); + break; + case COPY: + tgt.setValue(StructureMap.StructureMapTransform.COPY); + break; + case TRUNCATE: + tgt.setValue(StructureMap.StructureMapTransform.TRUNCATE); + break; + case ESCAPE: + tgt.setValue(StructureMap.StructureMapTransform.ESCAPE); + break; + case CAST: + tgt.setValue(StructureMap.StructureMapTransform.CAST); + break; + case APPEND: + tgt.setValue(StructureMap.StructureMapTransform.APPEND); + break; + case TRANSLATE: + tgt.setValue(StructureMap.StructureMapTransform.TRANSLATE); + break; + case REFERENCE: + tgt.setValue(StructureMap.StructureMapTransform.REFERENCE); + break; + case DATEOP: + tgt.setValue(StructureMap.StructureMapTransform.DATEOP); + break; + case UUID: + tgt.setValue(StructureMap.StructureMapTransform.UUID); + break; + case POINTER: + tgt.setValue(StructureMap.StructureMapTransform.POINTER); + break; + case EVALUATE: + tgt.setValue(StructureMap.StructureMapTransform.EVALUATE); + break; + case CC: + tgt.setValue(StructureMap.StructureMapTransform.CC); + break; + case C: + tgt.setValue(StructureMap.StructureMapTransform.C); + break; + case QTY: + tgt.setValue(StructureMap.StructureMapTransform.QTY); + break; + case ID: + tgt.setValue(StructureMap.StructureMapTransform.ID); + break; + case CP: + tgt.setValue(StructureMap.StructureMapTransform.CP); + break; + default: + tgt.setValue(StructureMap.StructureMapTransform.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertStructureMapTransform(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransformEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case CREATE: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.CREATE); - break; - case COPY: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.COPY); - break; - case TRUNCATE: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.TRUNCATE); - break; - case ESCAPE: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.ESCAPE); - break; - case CAST: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.CAST); - break; - case APPEND: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.APPEND); - break; - case TRANSLATE: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.TRANSLATE); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.REFERENCE); - break; - case DATEOP: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.DATEOP); - break; - case UUID: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.UUID); - break; - case POINTER: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.POINTER); - break; - case EVALUATE: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.EVALUATE); - break; - case CC: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.CC); - break; - case C: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.C); - break; - case QTY: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.QTY); - break; - case ID: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.ID); - break; - case CP: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.CP); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransformEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CREATE: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.CREATE); + break; + case COPY: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.COPY); + break; + case TRUNCATE: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.TRUNCATE); + break; + case ESCAPE: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.ESCAPE); + break; + case CAST: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.CAST); + break; + case APPEND: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.APPEND); + break; + case TRANSLATE: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.TRANSLATE); + break; + case REFERENCE: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.REFERENCE); + break; + case DATEOP: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.DATEOP); + break; + case UUID: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.UUID); + break; + case POINTER: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.POINTER); + break; + case EVALUATE: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.EVALUATE); + break; + case CC: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.CC); + break; + case C: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.C); + break; + case QTY: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.QTY); + break; + case ID: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.ID); + break; + case CP: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.CP); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Subscription30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Subscription30_40.java index c3d6148633..f705ecf100 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Subscription30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Subscription30_40.java @@ -4,6 +4,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.ContactPoint30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Instant30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.Subscription; import org.hl7.fhir.exceptions.FHIRException; public class Subscription30_40 { @@ -83,108 +85,124 @@ public static org.hl7.fhir.r4.model.Subscription.SubscriptionChannelComponent co } static public org.hl7.fhir.dstu3.model.Enumeration convertSubscriptionChannelType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Subscription.SubscriptionChannelTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case RESTHOOK: - tgt.setValue(org.hl7.fhir.dstu3.model.Subscription.SubscriptionChannelType.RESTHOOK); - break; - case WEBSOCKET: - tgt.setValue(org.hl7.fhir.dstu3.model.Subscription.SubscriptionChannelType.WEBSOCKET); - break; - case EMAIL: - tgt.setValue(org.hl7.fhir.dstu3.model.Subscription.SubscriptionChannelType.EMAIL); - break; - case SMS: - tgt.setValue(org.hl7.fhir.dstu3.model.Subscription.SubscriptionChannelType.SMS); - break; - case MESSAGE: - tgt.setValue(org.hl7.fhir.dstu3.model.Subscription.SubscriptionChannelType.MESSAGE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Subscription.SubscriptionChannelType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Subscription.SubscriptionChannelTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case RESTHOOK: + tgt.setValue(Subscription.SubscriptionChannelType.RESTHOOK); + break; + case WEBSOCKET: + tgt.setValue(Subscription.SubscriptionChannelType.WEBSOCKET); + break; + case EMAIL: + tgt.setValue(Subscription.SubscriptionChannelType.EMAIL); + break; + case SMS: + tgt.setValue(Subscription.SubscriptionChannelType.SMS); + break; + case MESSAGE: + tgt.setValue(Subscription.SubscriptionChannelType.MESSAGE); + break; + default: + tgt.setValue(Subscription.SubscriptionChannelType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertSubscriptionChannelType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Subscription.SubscriptionChannelTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case RESTHOOK: - tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionChannelType.RESTHOOK); - break; - case WEBSOCKET: - tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionChannelType.WEBSOCKET); - break; - case EMAIL: - tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionChannelType.EMAIL); - break; - case SMS: - tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionChannelType.SMS); - break; - case MESSAGE: - tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionChannelType.MESSAGE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionChannelType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Subscription.SubscriptionChannelTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case RESTHOOK: + tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionChannelType.RESTHOOK); + break; + case WEBSOCKET: + tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionChannelType.WEBSOCKET); + break; + case EMAIL: + tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionChannelType.EMAIL); + break; + case SMS: + tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionChannelType.SMS); + break; + case MESSAGE: + tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionChannelType.MESSAGE); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionChannelType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertSubscriptionStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Subscription.SubscriptionStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case REQUESTED: - tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionStatus.REQUESTED); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionStatus.ACTIVE); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionStatus.ERROR); - break; - case OFF: - tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionStatus.OFF); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Subscription.SubscriptionStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REQUESTED: + tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionStatus.REQUESTED); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionStatus.ACTIVE); + break; + case ERROR: + tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionStatus.ERROR); + break; + case OFF: + tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionStatus.OFF); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Subscription.SubscriptionStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertSubscriptionStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Subscription.SubscriptionStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case REQUESTED: - tgt.setValue(org.hl7.fhir.dstu3.model.Subscription.SubscriptionStatus.REQUESTED); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Subscription.SubscriptionStatus.ACTIVE); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Subscription.SubscriptionStatus.ERROR); - break; - case OFF: - tgt.setValue(org.hl7.fhir.dstu3.model.Subscription.SubscriptionStatus.OFF); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Subscription.SubscriptionStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Subscription.SubscriptionStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REQUESTED: + tgt.setValue(Subscription.SubscriptionStatus.REQUESTED); + break; + case ACTIVE: + tgt.setValue(Subscription.SubscriptionStatus.ACTIVE); + break; + case ERROR: + tgt.setValue(Subscription.SubscriptionStatus.ERROR); + break; + case OFF: + tgt.setValue(Subscription.SubscriptionStatus.OFF); + break; + default: + tgt.setValue(Subscription.SubscriptionStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Substance30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Substance30_40.java index 144c77f402..9c7e1dd3f1 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Substance30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Substance30_40.java @@ -8,51 +8,61 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.DateTime30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Enumeration; +import org.hl7.fhir.r4.model.Substance; public class Substance30_40 { static public org.hl7.fhir.r4.model.Enumeration convertFHIRSubstanceStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Substance.FHIRSubstanceStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Substance.FHIRSubstanceStatus.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Substance.FHIRSubstanceStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Substance.FHIRSubstanceStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Substance.FHIRSubstanceStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Substance.FHIRSubstanceStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Substance.FHIRSubstanceStatus.ACTIVE); + break; + case INACTIVE: + tgt.setValue(Substance.FHIRSubstanceStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(Substance.FHIRSubstanceStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Substance.FHIRSubstanceStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertFHIRSubstanceStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Substance.FHIRSubstanceStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Substance.FHIRSubstanceStatus.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Substance.FHIRSubstanceStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Substance.FHIRSubstanceStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Substance.FHIRSubstanceStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Substance.FHIRSubstanceStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu3.model.Substance.FHIRSubstanceStatus.ACTIVE); + break; + case INACTIVE: + tgt.setValue(org.hl7.fhir.dstu3.model.Substance.FHIRSubstanceStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu3.model.Substance.FHIRSubstanceStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Substance.FHIRSubstanceStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r4.model.Substance convertSubstance(org.hl7.fhir.dstu3.model.Substance src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/SupplyDelivery30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/SupplyDelivery30_40.java index 88a02df08b..f25ed94412 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/SupplyDelivery30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/SupplyDelivery30_40.java @@ -6,6 +6,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.Identifier30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.SimpleQuantity30_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Enumeration; +import org.hl7.fhir.r4.model.SupplyDelivery; public class SupplyDelivery30_40 { @@ -64,53 +66,61 @@ public static org.hl7.fhir.dstu3.model.SupplyDelivery convertSupplyDelivery(org. } static public org.hl7.fhir.r4.model.Enumeration convertSupplyDeliveryStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatus.COMPLETED); - break; - case ABANDONED: - tgt.setValue(org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatus.ABANDONED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new SupplyDelivery.SupplyDeliveryStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(SupplyDelivery.SupplyDeliveryStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(SupplyDelivery.SupplyDeliveryStatus.COMPLETED); + break; + case ABANDONED: + tgt.setValue(SupplyDelivery.SupplyDeliveryStatus.ABANDONED); + break; + case ENTEREDINERROR: + tgt.setValue(SupplyDelivery.SupplyDeliveryStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(SupplyDelivery.SupplyDeliveryStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertSupplyDeliveryStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.SupplyDelivery.SupplyDeliveryStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu3.model.SupplyDelivery.SupplyDeliveryStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.SupplyDelivery.SupplyDeliveryStatus.COMPLETED); - break; - case ABANDONED: - tgt.setValue(org.hl7.fhir.dstu3.model.SupplyDelivery.SupplyDeliveryStatus.ABANDONED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.SupplyDelivery.SupplyDeliveryStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.SupplyDelivery.SupplyDeliveryStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.SupplyDelivery.SupplyDeliveryStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(org.hl7.fhir.dstu3.model.SupplyDelivery.SupplyDeliveryStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.dstu3.model.SupplyDelivery.SupplyDeliveryStatus.COMPLETED); + break; + case ABANDONED: + tgt.setValue(org.hl7.fhir.dstu3.model.SupplyDelivery.SupplyDeliveryStatus.ABANDONED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu3.model.SupplyDelivery.SupplyDeliveryStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.SupplyDelivery.SupplyDeliveryStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliverySuppliedItemComponent convertSupplyDeliverySuppliedItemComponent(org.hl7.fhir.dstu3.model.SupplyDelivery.SupplyDeliverySuppliedItemComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/TestReport30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/TestReport30_40.java index 81184f17eb..8399dd06f9 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/TestReport30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/TestReport30_40.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.MarkDown30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Uri30_40; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.TestReport; import org.hl7.fhir.exceptions.FHIRException; public class TestReport30_40 { @@ -105,91 +107,107 @@ public static org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantComponent } static public org.hl7.fhir.dstu3.model.Enumeration convertTestReportParticipantType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case TESTENGINE: - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantType.TESTENGINE); - break; - case CLIENT: - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantType.CLIENT); - break; - case SERVER: - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantType.SERVER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new TestReport.TestReportParticipantTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case TESTENGINE: + tgt.setValue(TestReport.TestReportParticipantType.TESTENGINE); + break; + case CLIENT: + tgt.setValue(TestReport.TestReportParticipantType.CLIENT); + break; + case SERVER: + tgt.setValue(TestReport.TestReportParticipantType.SERVER); + break; + default: + tgt.setValue(TestReport.TestReportParticipantType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertTestReportParticipantType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TestReport.TestReportParticipantTypeEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case TESTENGINE: - tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportParticipantType.TESTENGINE); - break; - case CLIENT: - tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportParticipantType.CLIENT); - break; - case SERVER: - tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportParticipantType.SERVER); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportParticipantType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TestReport.TestReportParticipantTypeEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case TESTENGINE: + tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportParticipantType.TESTENGINE); + break; + case CLIENT: + tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportParticipantType.CLIENT); + break; + case SERVER: + tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportParticipantType.SERVER); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportParticipantType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertTestReportResult(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TestReport.TestReportResultEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PASS: - tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportResult.PASS); - break; - case FAIL: - tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportResult.FAIL); - break; - case PENDING: - tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportResult.PENDING); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportResult.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TestReport.TestReportResultEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PASS: + tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportResult.PASS); + break; + case FAIL: + tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportResult.FAIL); + break; + case PENDING: + tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportResult.PENDING); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportResult.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertTestReportResult(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestReport.TestReportResultEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case PASS: - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportResult.PASS); - break; - case FAIL: - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportResult.FAIL); - break; - case PENDING: - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportResult.PENDING); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportResult.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new TestReport.TestReportResultEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PASS: + tgt.setValue(TestReport.TestReportResult.PASS); + break; + case FAIL: + tgt.setValue(TestReport.TestReportResult.FAIL); + break; + case PENDING: + tgt.setValue(TestReport.TestReportResult.PENDING); + break; + default: + tgt.setValue(TestReport.TestReportResult.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r4.model.TestReport.TestReportSetupComponent convertTestReportSetupComponent(org.hl7.fhir.dstu3.model.TestReport.TestReportSetupComponent src) throws FHIRException { @@ -213,59 +231,67 @@ public static org.hl7.fhir.dstu3.model.TestReport.TestReportSetupComponent conve } static public org.hl7.fhir.r4.model.Enumeration convertTestReportStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TestReport.TestReportStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportStatus.COMPLETED); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportStatus.INPROGRESS); - break; - case WAITING: - tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportStatus.WAITING); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportStatus.STOPPED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TestReport.TestReportStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportStatus.COMPLETED); + break; + case INPROGRESS: + tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportStatus.INPROGRESS); + break; + case WAITING: + tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportStatus.WAITING); + break; + case STOPPED: + tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportStatus.STOPPED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertTestReportStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestReport.TestReportStatusEnumFactory()); - ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); - switch (src.getValue()) { - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportStatus.COMPLETED); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportStatus.INPROGRESS); - break; - case WAITING: - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportStatus.WAITING); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportStatus.STOPPED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new TestReport.TestReportStatusEnumFactory()); + ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case COMPLETED: + tgt.setValue(TestReport.TestReportStatus.COMPLETED); + break; + case INPROGRESS: + tgt.setValue(TestReport.TestReportStatus.INPROGRESS); + break; + case WAITING: + tgt.setValue(TestReport.TestReportStatus.WAITING); + break; + case STOPPED: + tgt.setValue(TestReport.TestReportStatus.STOPPED); + break; + case ENTEREDINERROR: + tgt.setValue(TestReport.TestReportStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(TestReport.TestReportStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r4.model.TestReport.TestReportTeardownComponent convertTestReportTeardownComponent(org.hl7.fhir.dstu3.model.TestReport.TestReportTeardownComponent src) throws FHIRException { @@ -359,29 +385,29 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TestReport.TestReportActionResultEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportActionResult.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case PASS: - tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportActionResult.PASS); - break; - case SKIP: - tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportActionResult.SKIP); - break; - case FAIL: - tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportActionResult.FAIL); - break; - case WARNING: - tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportActionResult.WARNING); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportActionResult.ERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportActionResult.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportActionResult.PASS); + break; + case SKIP: + tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportActionResult.SKIP); + break; + case FAIL: + tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportActionResult.FAIL); + break; + case WARNING: + tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportActionResult.WARNING); + break; + case ERROR: + tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportActionResult.ERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportActionResult.NULL); + break; + } +} return tgt; } @@ -390,29 +416,29 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestReport.TestReportActionResultEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportActionResult.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case PASS: - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportActionResult.PASS); - break; - case SKIP: - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportActionResult.SKIP); - break; - case FAIL: - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportActionResult.FAIL); - break; - case WARNING: - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportActionResult.WARNING); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportActionResult.ERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportActionResult.NULL); - break; - } - } + tgt.setValue(TestReport.TestReportActionResult.PASS); + break; + case SKIP: + tgt.setValue(TestReport.TestReportActionResult.SKIP); + break; + case FAIL: + tgt.setValue(TestReport.TestReportActionResult.FAIL); + break; + case WARNING: + tgt.setValue(TestReport.TestReportActionResult.WARNING); + break; + case ERROR: + tgt.setValue(TestReport.TestReportActionResult.ERROR); + break; + default: + tgt.setValue(TestReport.TestReportActionResult.NULL); + break; + } +} return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/TestScript30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/TestScript30_40.java index a80e630f90..d338cfef91 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/TestScript30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/TestScript30_40.java @@ -16,6 +16,7 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Uri30_40; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.TestScript; public class TestScript30_40 { @@ -594,20 +595,20 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TestScript.AssertionDirectionTypeEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionDirectionType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case RESPONSE: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionDirectionType.RESPONSE); - break; - case REQUEST: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionDirectionType.REQUEST); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionDirectionType.NULL); - break; - } - } + tgt.setValue(TestScript.AssertionDirectionType.RESPONSE); + break; + case REQUEST: + tgt.setValue(TestScript.AssertionDirectionType.REQUEST); + break; + default: + tgt.setValue(TestScript.AssertionDirectionType.NULL); + break; + } +} return tgt; } @@ -616,20 +617,20 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionTypeEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case RESPONSE: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType.RESPONSE); - break; - case REQUEST: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType.REQUEST); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType.RESPONSE); + break; + case REQUEST: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType.REQUEST); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType.NULL); + break; + } +} return tgt; } @@ -638,47 +639,47 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TestScript.AssertionOperatorTypeEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case EQUALS: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.EQUALS); - break; - case NOTEQUALS: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.NOTEQUALS); - break; - case IN: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.NOTIN); - break; - case GREATERTHAN: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.GREATERTHAN); - break; - case LESSTHAN: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.LESSTHAN); - break; - case EMPTY: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.EMPTY); - break; - case NOTEMPTY: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.NOTEMPTY); - break; - case CONTAINS: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.CONTAINS); - break; - case NOTCONTAINS: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.NOTCONTAINS); - break; - case EVAL: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.EVAL); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.NULL); - break; - } - } + tgt.setValue(TestScript.AssertionOperatorType.EQUALS); + break; + case NOTEQUALS: + tgt.setValue(TestScript.AssertionOperatorType.NOTEQUALS); + break; + case IN: + tgt.setValue(TestScript.AssertionOperatorType.IN); + break; + case NOTIN: + tgt.setValue(TestScript.AssertionOperatorType.NOTIN); + break; + case GREATERTHAN: + tgt.setValue(TestScript.AssertionOperatorType.GREATERTHAN); + break; + case LESSTHAN: + tgt.setValue(TestScript.AssertionOperatorType.LESSTHAN); + break; + case EMPTY: + tgt.setValue(TestScript.AssertionOperatorType.EMPTY); + break; + case NOTEMPTY: + tgt.setValue(TestScript.AssertionOperatorType.NOTEMPTY); + break; + case CONTAINS: + tgt.setValue(TestScript.AssertionOperatorType.CONTAINS); + break; + case NOTCONTAINS: + tgt.setValue(TestScript.AssertionOperatorType.NOTCONTAINS); + break; + case EVAL: + tgt.setValue(TestScript.AssertionOperatorType.EVAL); + break; + default: + tgt.setValue(TestScript.AssertionOperatorType.NULL); + break; + } +} return tgt; } @@ -687,47 +688,47 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorTypeEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case EQUALS: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.EQUALS); - break; - case NOTEQUALS: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTEQUALS); - break; - case IN: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTIN); - break; - case GREATERTHAN: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.GREATERTHAN); - break; - case LESSTHAN: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.LESSTHAN); - break; - case EMPTY: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.EMPTY); - break; - case NOTEMPTY: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTEMPTY); - break; - case CONTAINS: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.CONTAINS); - break; - case NOTCONTAINS: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTCONTAINS); - break; - case EVAL: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.EVAL); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.EQUALS); + break; + case NOTEQUALS: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTEQUALS); + break; + case IN: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.IN); + break; + case NOTIN: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTIN); + break; + case GREATERTHAN: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.GREATERTHAN); + break; + case LESSTHAN: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.LESSTHAN); + break; + case EMPTY: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.EMPTY); + break; + case NOTEMPTY: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTEMPTY); + break; + case CONTAINS: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.CONTAINS); + break; + case NOTCONTAINS: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTCONTAINS); + break; + case EVAL: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.EVAL); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NULL); + break; + } +} return tgt; } @@ -736,32 +737,32 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCodeEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case DELETE: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode.DELETE); - break; - case GET: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode.GET); - break; - case OPTIONS: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode.OPTIONS); - break; - case PATCH: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode.PATCH); - break; - case POST: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode.POST); - break; - case PUT: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode.PUT); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode.NULL); - break; - } - } + tgt.setValue(TestScript.TestScriptRequestMethodCode.DELETE); + break; + case GET: + tgt.setValue(TestScript.TestScriptRequestMethodCode.GET); + break; + case OPTIONS: + tgt.setValue(TestScript.TestScriptRequestMethodCode.OPTIONS); + break; + case PATCH: + tgt.setValue(TestScript.TestScriptRequestMethodCode.PATCH); + break; + case POST: + tgt.setValue(TestScript.TestScriptRequestMethodCode.POST); + break; + case PUT: + tgt.setValue(TestScript.TestScriptRequestMethodCode.PUT); + break; + default: + tgt.setValue(TestScript.TestScriptRequestMethodCode.NULL); + break; + } +} return tgt; } @@ -770,32 +771,32 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCodeEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case DELETE: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.DELETE); - break; - case GET: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.GET); - break; - case OPTIONS: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.OPTIONS); - break; - case PATCH: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.PATCH); - break; - case POST: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.POST); - break; - case PUT: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.PUT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.DELETE); + break; + case GET: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.GET); + break; + case OPTIONS: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.OPTIONS); + break; + case PATCH: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.PATCH); + break; + case POST: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.POST); + break; + case PUT: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.PUT); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.NULL); + break; + } +} return tgt; } @@ -804,50 +805,50 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TestScript.AssertionResponseTypesEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case OKAY: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.OKAY); - break; - case CREATED: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.CREATED); - break; - case NOCONTENT: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.NOCONTENT); - break; - case NOTMODIFIED: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.NOTMODIFIED); - break; - case BAD: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.BAD); - break; - case FORBIDDEN: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.FORBIDDEN); - break; - case NOTFOUND: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.NOTFOUND); - break; - case METHODNOTALLOWED: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.METHODNOTALLOWED); - break; - case CONFLICT: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.CONFLICT); - break; - case GONE: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.GONE); - break; - case PRECONDITIONFAILED: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.PRECONDITIONFAILED); - break; - case UNPROCESSABLE: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.UNPROCESSABLE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.NULL); - break; - } - } + tgt.setValue(TestScript.AssertionResponseTypes.OKAY); + break; + case CREATED: + tgt.setValue(TestScript.AssertionResponseTypes.CREATED); + break; + case NOCONTENT: + tgt.setValue(TestScript.AssertionResponseTypes.NOCONTENT); + break; + case NOTMODIFIED: + tgt.setValue(TestScript.AssertionResponseTypes.NOTMODIFIED); + break; + case BAD: + tgt.setValue(TestScript.AssertionResponseTypes.BAD); + break; + case FORBIDDEN: + tgt.setValue(TestScript.AssertionResponseTypes.FORBIDDEN); + break; + case NOTFOUND: + tgt.setValue(TestScript.AssertionResponseTypes.NOTFOUND); + break; + case METHODNOTALLOWED: + tgt.setValue(TestScript.AssertionResponseTypes.METHODNOTALLOWED); + break; + case CONFLICT: + tgt.setValue(TestScript.AssertionResponseTypes.CONFLICT); + break; + case GONE: + tgt.setValue(TestScript.AssertionResponseTypes.GONE); + break; + case PRECONDITIONFAILED: + tgt.setValue(TestScript.AssertionResponseTypes.PRECONDITIONFAILED); + break; + case UNPROCESSABLE: + tgt.setValue(TestScript.AssertionResponseTypes.UNPROCESSABLE); + break; + default: + tgt.setValue(TestScript.AssertionResponseTypes.NULL); + break; + } +} return tgt; } @@ -856,50 +857,50 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypesEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case OKAY: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.OKAY); - break; - case CREATED: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.CREATED); - break; - case NOCONTENT: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NOCONTENT); - break; - case NOTMODIFIED: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NOTMODIFIED); - break; - case BAD: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.BAD); - break; - case FORBIDDEN: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.FORBIDDEN); - break; - case NOTFOUND: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NOTFOUND); - break; - case METHODNOTALLOWED: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.METHODNOTALLOWED); - break; - case CONFLICT: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.CONFLICT); - break; - case GONE: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.GONE); - break; - case PRECONDITIONFAILED: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.PRECONDITIONFAILED); - break; - case UNPROCESSABLE: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.UNPROCESSABLE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.OKAY); + break; + case CREATED: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.CREATED); + break; + case NOCONTENT: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NOCONTENT); + break; + case NOTMODIFIED: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NOTMODIFIED); + break; + case BAD: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.BAD); + break; + case FORBIDDEN: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.FORBIDDEN); + break; + case NOTFOUND: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NOTFOUND); + break; + case METHODNOTALLOWED: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.METHODNOTALLOWED); + break; + case CONFLICT: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.CONFLICT); + break; + case GONE: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.GONE); + break; + case PRECONDITIONFAILED: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.PRECONDITIONFAILED); + break; + case UNPROCESSABLE: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.UNPROCESSABLE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NULL); + break; + } +} return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/ValueSet30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/ValueSet30_40.java index 71d6b49be7..d098daaff8 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/ValueSet30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/ValueSet30_40.java @@ -16,6 +16,7 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Uri30_40; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4.model.BooleanType; +import org.hl7.fhir.r4.model.ValueSet; public class ValueSet30_40 { @@ -378,41 +379,41 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ValueSet.FilterOperatorEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case EQUAL: - tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.EQUAL); - break; - case ISA: - tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.ISA); - break; - case DESCENDENTOF: - tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.DESCENDENTOF); - break; - case ISNOTA: - tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.ISNOTA); - break; - case REGEX: - tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.REGEX); - break; - case IN: - tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.NOTIN); - break; - case GENERALIZES: - tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.GENERALIZES); - break; - case EXISTS: - tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.EXISTS); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.NULL); - break; - } - } + tgt.setValue(ValueSet.FilterOperator.EQUAL); + break; + case ISA: + tgt.setValue(ValueSet.FilterOperator.ISA); + break; + case DESCENDENTOF: + tgt.setValue(ValueSet.FilterOperator.DESCENDENTOF); + break; + case ISNOTA: + tgt.setValue(ValueSet.FilterOperator.ISNOTA); + break; + case REGEX: + tgt.setValue(ValueSet.FilterOperator.REGEX); + break; + case IN: + tgt.setValue(ValueSet.FilterOperator.IN); + break; + case NOTIN: + tgt.setValue(ValueSet.FilterOperator.NOTIN); + break; + case GENERALIZES: + tgt.setValue(ValueSet.FilterOperator.GENERALIZES); + break; + case EXISTS: + tgt.setValue(ValueSet.FilterOperator.EXISTS); + break; + default: + tgt.setValue(ValueSet.FilterOperator.NULL); + break; + } +} return tgt; } @@ -421,41 +422,41 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ValueSet.FilterOperatorEnumFactory()); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case EQUAL: - tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.EQUAL); - break; - case ISA: - tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.ISA); - break; - case DESCENDENTOF: - tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.DESCENDENTOF); - break; - case ISNOTA: - tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.ISNOTA); - break; - case REGEX: - tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.REGEX); - break; - case IN: - tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.NOTIN); - break; - case GENERALIZES: - tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.GENERALIZES); - break; - case EXISTS: - tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.EXISTS); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.EQUAL); + break; + case ISA: + tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.ISA); + break; + case DESCENDENTOF: + tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.DESCENDENTOF); + break; + case ISNOTA: + tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.ISNOTA); + break; + case REGEX: + tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.REGEX); + break; + case IN: + tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.IN); + break; + case NOTIN: + tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.NOTIN); + break; + case GENERALIZES: + tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.GENERALIZES); + break; + case EXISTS: + tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.EXISTS); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.NULL); + break; + } +} return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/Contributor30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/Contributor30_50.java index 2d1094262d..c3fefff634 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/Contributor30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/Contributor30_50.java @@ -3,6 +3,7 @@ import org.hl7.fhir.convertors.context.ConversionContext30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Contributor; public class Contributor30_50 { public static org.hl7.fhir.r5.model.Contributor convertContributor(org.hl7.fhir.dstu3.model.Contributor src) throws FHIRException { @@ -32,26 +33,26 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Contributor.ContributorTypeEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Contributor.ContributorType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case AUTHOR: - tgt.setValue(org.hl7.fhir.r5.model.Contributor.ContributorType.AUTHOR); - break; - case EDITOR: - tgt.setValue(org.hl7.fhir.r5.model.Contributor.ContributorType.EDITOR); - break; - case REVIEWER: - tgt.setValue(org.hl7.fhir.r5.model.Contributor.ContributorType.REVIEWER); - break; - case ENDORSER: - tgt.setValue(org.hl7.fhir.r5.model.Contributor.ContributorType.ENDORSER); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Contributor.ContributorType.NULL); - break; - } - } + tgt.setValue(Contributor.ContributorType.AUTHOR); + break; + case EDITOR: + tgt.setValue(Contributor.ContributorType.EDITOR); + break; + case REVIEWER: + tgt.setValue(Contributor.ContributorType.REVIEWER); + break; + case ENDORSER: + tgt.setValue(Contributor.ContributorType.ENDORSER); + break; + default: + tgt.setValue(Contributor.ContributorType.NULL); + break; + } +} return tgt; } @@ -60,26 +61,26 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Contributor.ContributorTypeEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Contributor.ContributorType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case AUTHOR: - tgt.setValue(org.hl7.fhir.dstu3.model.Contributor.ContributorType.AUTHOR); - break; - case EDITOR: - tgt.setValue(org.hl7.fhir.dstu3.model.Contributor.ContributorType.EDITOR); - break; - case REVIEWER: - tgt.setValue(org.hl7.fhir.dstu3.model.Contributor.ContributorType.REVIEWER); - break; - case ENDORSER: - tgt.setValue(org.hl7.fhir.dstu3.model.Contributor.ContributorType.ENDORSER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Contributor.ContributorType.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.Contributor.ContributorType.AUTHOR); + break; + case EDITOR: + tgt.setValue(org.hl7.fhir.dstu3.model.Contributor.ContributorType.EDITOR); + break; + case REVIEWER: + tgt.setValue(org.hl7.fhir.dstu3.model.Contributor.ContributorType.REVIEWER); + break; + case ENDORSER: + tgt.setValue(org.hl7.fhir.dstu3.model.Contributor.ContributorType.ENDORSER); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Contributor.ContributorType.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/ElementDefinition30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/ElementDefinition30_50.java index 3cf1d0ae9d..54b48644bc 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/ElementDefinition30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/ElementDefinition30_50.java @@ -159,29 +159,29 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentationEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case XMLATTR: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.XMLATTR); - break; - case XMLTEXT: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.XMLTEXT); - break; - case TYPEATTR: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.TYPEATTR); - break; - case CDATEXT: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.CDATEXT); - break; - case XHTML: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.XHTML); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.NULL); - break; - } - } + tgt.setValue(ElementDefinition.PropertyRepresentation.XMLATTR); + break; + case XMLTEXT: + tgt.setValue(ElementDefinition.PropertyRepresentation.XMLTEXT); + break; + case TYPEATTR: + tgt.setValue(ElementDefinition.PropertyRepresentation.TYPEATTR); + break; + case CDATEXT: + tgt.setValue(ElementDefinition.PropertyRepresentation.CDATEXT); + break; + case XHTML: + tgt.setValue(ElementDefinition.PropertyRepresentation.XHTML); + break; + default: + tgt.setValue(ElementDefinition.PropertyRepresentation.NULL); + break; + } +} return tgt; } @@ -190,29 +190,29 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentationEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case XMLATTR: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation.XMLATTR); - break; - case XMLTEXT: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation.XMLTEXT); - break; - case TYPEATTR: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation.TYPEATTR); - break; - case CDATEXT: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation.CDATEXT); - break; - case XHTML: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation.XHTML); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation.XMLATTR); + break; + case XMLTEXT: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation.XMLTEXT); + break; + case TYPEATTR: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation.TYPEATTR); + break; + case CDATEXT: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation.CDATEXT); + break; + case XHTML: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation.XHTML); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation.NULL); + break; + } +} return tgt; } @@ -245,23 +245,23 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ElementDefinition.SlicingRulesEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.SlicingRules.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CLOSED: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.SlicingRules.CLOSED); - break; - case OPEN: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.SlicingRules.OPEN); - break; - case OPENATEND: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.SlicingRules.OPENATEND); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.SlicingRules.NULL); - break; - } - } + tgt.setValue(ElementDefinition.SlicingRules.CLOSED); + break; + case OPEN: + tgt.setValue(ElementDefinition.SlicingRules.OPEN); + break; + case OPENATEND: + tgt.setValue(ElementDefinition.SlicingRules.OPENATEND); + break; + default: + tgt.setValue(ElementDefinition.SlicingRules.NULL); + break; + } +} return tgt; } @@ -270,23 +270,23 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ElementDefinition.SlicingRulesEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.SlicingRules.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CLOSED: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.SlicingRules.CLOSED); - break; - case OPEN: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.SlicingRules.OPEN); - break; - case OPENATEND: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.SlicingRules.OPENATEND); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.SlicingRules.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.SlicingRules.CLOSED); + break; + case OPEN: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.SlicingRules.OPEN); + break; + case OPENATEND: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.SlicingRules.OPENATEND); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.SlicingRules.NULL); + break; + } +} return tgt; } @@ -313,29 +313,29 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ElementDefinition.DiscriminatorTypeEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.DiscriminatorType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case VALUE: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.DiscriminatorType.VALUE); - break; - case EXISTS: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.DiscriminatorType.EXISTS); - break; - case PATTERN: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.DiscriminatorType.PATTERN); - break; - case TYPE: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.DiscriminatorType.TYPE); - break; - case PROFILE: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.DiscriminatorType.PROFILE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.DiscriminatorType.NULL); - break; - } - } + tgt.setValue(ElementDefinition.DiscriminatorType.VALUE); + break; + case EXISTS: + tgt.setValue(ElementDefinition.DiscriminatorType.EXISTS); + break; + case PATTERN: + tgt.setValue(ElementDefinition.DiscriminatorType.PATTERN); + break; + case TYPE: + tgt.setValue(ElementDefinition.DiscriminatorType.TYPE); + break; + case PROFILE: + tgt.setValue(ElementDefinition.DiscriminatorType.PROFILE); + break; + default: + tgt.setValue(ElementDefinition.DiscriminatorType.NULL); + break; + } +} return tgt; } @@ -344,29 +344,29 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ElementDefinition.DiscriminatorTypeEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.DiscriminatorType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case VALUE: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.DiscriminatorType.VALUE); - break; - case EXISTS: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.DiscriminatorType.EXISTS); - break; - case PATTERN: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.DiscriminatorType.PATTERN); - break; - case TYPE: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.DiscriminatorType.TYPE); - break; - case PROFILE: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.DiscriminatorType.PROFILE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.DiscriminatorType.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.DiscriminatorType.VALUE); + break; + case EXISTS: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.DiscriminatorType.EXISTS); + break; + case PATTERN: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.DiscriminatorType.PATTERN); + break; + case TYPE: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.DiscriminatorType.TYPE); + break; + case PROFILE: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.DiscriminatorType.PROFILE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.DiscriminatorType.NULL); + break; + } +} return tgt; } @@ -458,23 +458,23 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new ElementDefinition.AggregationModeEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(ElementDefinition.AggregationMode.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CONTAINED: - tgt.setValue(ElementDefinition.AggregationMode.CONTAINED); - break; - case REFERENCED: - tgt.setValue(ElementDefinition.AggregationMode.REFERENCED); - break; - case BUNDLED: - tgt.setValue(ElementDefinition.AggregationMode.BUNDLED); - break; - default: - tgt.setValue(ElementDefinition.AggregationMode.NULL); - break; - } - } + tgt.setValue(ElementDefinition.AggregationMode.CONTAINED); + break; + case REFERENCED: + tgt.setValue(ElementDefinition.AggregationMode.REFERENCED); + break; + case BUNDLED: + tgt.setValue(ElementDefinition.AggregationMode.BUNDLED); + break; + default: + tgt.setValue(ElementDefinition.AggregationMode.NULL); + break; + } +} return tgt; } @@ -483,23 +483,23 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ElementDefinition.AggregationModeEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.AggregationMode.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CONTAINED: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.AggregationMode.CONTAINED); - break; - case REFERENCED: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.AggregationMode.REFERENCED); - break; - case BUNDLED: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.AggregationMode.BUNDLED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.AggregationMode.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.AggregationMode.CONTAINED); + break; + case REFERENCED: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.AggregationMode.REFERENCED); + break; + case BUNDLED: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.AggregationMode.BUNDLED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.AggregationMode.NULL); + break; + } +} return tgt; } @@ -508,23 +508,23 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new ElementDefinition.ReferenceVersionRulesEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(ElementDefinition.ReferenceVersionRules.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case EITHER: - tgt.setValue(ElementDefinition.ReferenceVersionRules.EITHER); - break; - case INDEPENDENT: - tgt.setValue(ElementDefinition.ReferenceVersionRules.INDEPENDENT); - break; - case SPECIFIC: - tgt.setValue(ElementDefinition.ReferenceVersionRules.SPECIFIC); - break; - default: - tgt.setValue(ElementDefinition.ReferenceVersionRules.NULL); - break; - } - } + tgt.setValue(ElementDefinition.ReferenceVersionRules.EITHER); + break; + case INDEPENDENT: + tgt.setValue(ElementDefinition.ReferenceVersionRules.INDEPENDENT); + break; + case SPECIFIC: + tgt.setValue(ElementDefinition.ReferenceVersionRules.SPECIFIC); + break; + default: + tgt.setValue(ElementDefinition.ReferenceVersionRules.NULL); + break; + } +} return tgt; } @@ -533,23 +533,23 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ElementDefinition.ReferenceVersionRulesEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.ReferenceVersionRules.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case EITHER: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.ReferenceVersionRules.EITHER); - break; - case INDEPENDENT: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.ReferenceVersionRules.INDEPENDENT); - break; - case SPECIFIC: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.ReferenceVersionRules.SPECIFIC); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.ReferenceVersionRules.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.ReferenceVersionRules.EITHER); + break; + case INDEPENDENT: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.ReferenceVersionRules.INDEPENDENT); + break; + case SPECIFIC: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.ReferenceVersionRules.SPECIFIC); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.ReferenceVersionRules.NULL); + break; + } +} return tgt; } @@ -610,20 +610,20 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new ElementDefinition.ConstraintSeverityEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(ElementDefinition.ConstraintSeverity.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case ERROR: - tgt.setValue(ElementDefinition.ConstraintSeverity.ERROR); - break; - case WARNING: - tgt.setValue(ElementDefinition.ConstraintSeverity.WARNING); - break; - default: - tgt.setValue(ElementDefinition.ConstraintSeverity.NULL); - break; - } - } + tgt.setValue(ElementDefinition.ConstraintSeverity.ERROR); + break; + case WARNING: + tgt.setValue(ElementDefinition.ConstraintSeverity.WARNING); + break; + default: + tgt.setValue(ElementDefinition.ConstraintSeverity.NULL); + break; + } +} return tgt; } @@ -632,20 +632,20 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ElementDefinition.ConstraintSeverityEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.ConstraintSeverity.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case ERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.ConstraintSeverity.ERROR); - break; - case WARNING: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.ConstraintSeverity.WARNING); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.ConstraintSeverity.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.ConstraintSeverity.ERROR); + break; + case WARNING: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.ConstraintSeverity.WARNING); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.ConstraintSeverity.NULL); + break; + } +} return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/Narrative30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/Narrative30_50.java index b3618958b7..ed4d10b3b1 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/Narrative30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/Narrative30_50.java @@ -2,6 +2,7 @@ import org.hl7.fhir.convertors.context.ConversionContext30_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Narrative; public class Narrative30_50 { public static org.hl7.fhir.r5.model.Narrative convertNarrative(org.hl7.fhir.dstu3.model.Narrative src) throws FHIRException { @@ -27,26 +28,26 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Narrative.NarrativeStatusEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Narrative.NarrativeStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case GENERATED: - tgt.setValue(org.hl7.fhir.r5.model.Narrative.NarrativeStatus.GENERATED); - break; - case EXTENSIONS: - tgt.setValue(org.hl7.fhir.r5.model.Narrative.NarrativeStatus.EXTENSIONS); - break; - case ADDITIONAL: - tgt.setValue(org.hl7.fhir.r5.model.Narrative.NarrativeStatus.ADDITIONAL); - break; - case EMPTY: - tgt.setValue(org.hl7.fhir.r5.model.Narrative.NarrativeStatus.EMPTY); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Narrative.NarrativeStatus.NULL); - break; - } - } + tgt.setValue(Narrative.NarrativeStatus.GENERATED); + break; + case EXTENSIONS: + tgt.setValue(Narrative.NarrativeStatus.EXTENSIONS); + break; + case ADDITIONAL: + tgt.setValue(Narrative.NarrativeStatus.ADDITIONAL); + break; + case EMPTY: + tgt.setValue(Narrative.NarrativeStatus.EMPTY); + break; + default: + tgt.setValue(Narrative.NarrativeStatus.NULL); + break; + } +} return tgt; } @@ -55,26 +56,26 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Narrative.NarrativeStatusEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case GENERATED: - tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.GENERATED); - break; - case EXTENSIONS: - tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.EXTENSIONS); - break; - case ADDITIONAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.ADDITIONAL); - break; - case EMPTY: - tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.EMPTY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.GENERATED); + break; + case EXTENSIONS: + tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.EXTENSIONS); + break; + case ADDITIONAL: + tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.ADDITIONAL); + break; + case EMPTY: + tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.EMPTY); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/ParameterDefinition30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/ParameterDefinition30_50.java index fb9bc51e25..de67c64508 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/ParameterDefinition30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/ParameterDefinition30_50.java @@ -4,7 +4,9 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Code30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Integer30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; +import org.hl7.fhir.dstu3.model.ParameterDefinition; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumerations; public class ParameterDefinition30_50 { public static org.hl7.fhir.r5.model.ParameterDefinition convertParameterDefinition(org.hl7.fhir.dstu3.model.ParameterDefinition src) throws FHIRException { @@ -42,20 +44,20 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.OperationParameterUseEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.OperationParameterUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case IN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.OperationParameterUse.IN); - break; - case OUT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.OperationParameterUse.OUT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.OperationParameterUse.NULL); - break; - } - } + tgt.setValue(Enumerations.OperationParameterUse.IN); + break; + case OUT: + tgt.setValue(Enumerations.OperationParameterUse.OUT); + break; + default: + tgt.setValue(Enumerations.OperationParameterUse.NULL); + break; + } +} return tgt; } @@ -64,20 +66,20 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ParameterDefinition.ParameterUseEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.ParameterDefinition.ParameterUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case IN: - tgt.setValue(org.hl7.fhir.dstu3.model.ParameterDefinition.ParameterUse.IN); - break; - case OUT: - tgt.setValue(org.hl7.fhir.dstu3.model.ParameterDefinition.ParameterUse.OUT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ParameterDefinition.ParameterUse.NULL); - break; - } - } + tgt.setValue(ParameterDefinition.ParameterUse.IN); + break; + case OUT: + tgt.setValue(ParameterDefinition.ParameterUse.OUT); + break; + default: + tgt.setValue(ParameterDefinition.ParameterUse.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/RelatedArtifact30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/RelatedArtifact30_50.java index 8c86d1bc61..3423f619b7 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/RelatedArtifact30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/RelatedArtifact30_50.java @@ -4,6 +4,7 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.Attachment30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.RelatedArtifact; public class RelatedArtifact30_50 { public static org.hl7.fhir.r5.model.RelatedArtifact convertRelatedArtifact(org.hl7.fhir.dstu3.model.RelatedArtifact src) throws FHIRException { @@ -37,38 +38,38 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactTypeEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case DOCUMENTATION: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.DOCUMENTATION); - break; - case JUSTIFICATION: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.JUSTIFICATION); - break; - case CITATION: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.CITATION); - break; - case PREDECESSOR: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.PREDECESSOR); - break; - case SUCCESSOR: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.SUCCESSOR); - break; - case DERIVEDFROM: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.DERIVEDFROM); - break; - case DEPENDSON: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.DEPENDSON); - break; - case COMPOSEDOF: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.COMPOSEDOF); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.NULL); - break; - } - } + tgt.setValue(RelatedArtifact.RelatedArtifactType.DOCUMENTATION); + break; + case JUSTIFICATION: + tgt.setValue(RelatedArtifact.RelatedArtifactType.JUSTIFICATION); + break; + case CITATION: + tgt.setValue(RelatedArtifact.RelatedArtifactType.CITATION); + break; + case PREDECESSOR: + tgt.setValue(RelatedArtifact.RelatedArtifactType.PREDECESSOR); + break; + case SUCCESSOR: + tgt.setValue(RelatedArtifact.RelatedArtifactType.SUCCESSOR); + break; + case DERIVEDFROM: + tgt.setValue(RelatedArtifact.RelatedArtifactType.DERIVEDFROM); + break; + case DEPENDSON: + tgt.setValue(RelatedArtifact.RelatedArtifactType.DEPENDSON); + break; + case COMPOSEDOF: + tgt.setValue(RelatedArtifact.RelatedArtifactType.COMPOSEDOF); + break; + default: + tgt.setValue(RelatedArtifact.RelatedArtifactType.NULL); + break; + } +} return tgt; } @@ -77,38 +78,38 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.RelatedArtifact.RelatedArtifactTypeEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.RelatedArtifact.RelatedArtifactType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case DOCUMENTATION: - tgt.setValue(org.hl7.fhir.dstu3.model.RelatedArtifact.RelatedArtifactType.DOCUMENTATION); - break; - case JUSTIFICATION: - tgt.setValue(org.hl7.fhir.dstu3.model.RelatedArtifact.RelatedArtifactType.JUSTIFICATION); - break; - case CITATION: - tgt.setValue(org.hl7.fhir.dstu3.model.RelatedArtifact.RelatedArtifactType.CITATION); - break; - case PREDECESSOR: - tgt.setValue(org.hl7.fhir.dstu3.model.RelatedArtifact.RelatedArtifactType.PREDECESSOR); - break; - case SUCCESSOR: - tgt.setValue(org.hl7.fhir.dstu3.model.RelatedArtifact.RelatedArtifactType.SUCCESSOR); - break; - case DERIVEDFROM: - tgt.setValue(org.hl7.fhir.dstu3.model.RelatedArtifact.RelatedArtifactType.DERIVEDFROM); - break; - case DEPENDSON: - tgt.setValue(org.hl7.fhir.dstu3.model.RelatedArtifact.RelatedArtifactType.DEPENDSON); - break; - case COMPOSEDOF: - tgt.setValue(org.hl7.fhir.dstu3.model.RelatedArtifact.RelatedArtifactType.COMPOSEDOF); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.RelatedArtifact.RelatedArtifactType.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.RelatedArtifact.RelatedArtifactType.DOCUMENTATION); + break; + case JUSTIFICATION: + tgt.setValue(org.hl7.fhir.dstu3.model.RelatedArtifact.RelatedArtifactType.JUSTIFICATION); + break; + case CITATION: + tgt.setValue(org.hl7.fhir.dstu3.model.RelatedArtifact.RelatedArtifactType.CITATION); + break; + case PREDECESSOR: + tgt.setValue(org.hl7.fhir.dstu3.model.RelatedArtifact.RelatedArtifactType.PREDECESSOR); + break; + case SUCCESSOR: + tgt.setValue(org.hl7.fhir.dstu3.model.RelatedArtifact.RelatedArtifactType.SUCCESSOR); + break; + case DERIVEDFROM: + tgt.setValue(org.hl7.fhir.dstu3.model.RelatedArtifact.RelatedArtifactType.DERIVEDFROM); + break; + case DEPENDSON: + tgt.setValue(org.hl7.fhir.dstu3.model.RelatedArtifact.RelatedArtifactType.DEPENDSON); + break; + case COMPOSEDOF: + tgt.setValue(org.hl7.fhir.dstu3.model.RelatedArtifact.RelatedArtifactType.COMPOSEDOF); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.RelatedArtifact.RelatedArtifactType.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/TriggerDefinition30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/TriggerDefinition30_50.java index 8f2ae37ba1..4c0b939f3c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/TriggerDefinition30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/TriggerDefinition30_50.java @@ -3,6 +3,7 @@ import org.hl7.fhir.convertors.context.ConversionContext30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.TriggerDefinition; public class TriggerDefinition30_50 { public static org.hl7.fhir.r5.model.TriggerDefinition convertTriggerDefinition(org.hl7.fhir.dstu3.model.TriggerDefinition src) throws FHIRException { @@ -34,35 +35,35 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TriggerDefinition.TriggerTypeEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.TriggerDefinition.TriggerType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case NAMEDEVENT: - tgt.setValue(org.hl7.fhir.r5.model.TriggerDefinition.TriggerType.NAMEDEVENT); - break; - case PERIODIC: - tgt.setValue(org.hl7.fhir.r5.model.TriggerDefinition.TriggerType.PERIODIC); - break; - case DATAADDED: - tgt.setValue(org.hl7.fhir.r5.model.TriggerDefinition.TriggerType.DATAADDED); - break; - case DATAMODIFIED: - tgt.setValue(org.hl7.fhir.r5.model.TriggerDefinition.TriggerType.DATAMODIFIED); - break; - case DATAREMOVED: - tgt.setValue(org.hl7.fhir.r5.model.TriggerDefinition.TriggerType.DATAREMOVED); - break; - case DATAACCESSED: - tgt.setValue(org.hl7.fhir.r5.model.TriggerDefinition.TriggerType.DATAACCESSED); - break; - case DATAACCESSENDED: - tgt.setValue(org.hl7.fhir.r5.model.TriggerDefinition.TriggerType.DATAACCESSENDED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.TriggerDefinition.TriggerType.NULL); - break; - } - } + tgt.setValue(TriggerDefinition.TriggerType.NAMEDEVENT); + break; + case PERIODIC: + tgt.setValue(TriggerDefinition.TriggerType.PERIODIC); + break; + case DATAADDED: + tgt.setValue(TriggerDefinition.TriggerType.DATAADDED); + break; + case DATAMODIFIED: + tgt.setValue(TriggerDefinition.TriggerType.DATAMODIFIED); + break; + case DATAREMOVED: + tgt.setValue(TriggerDefinition.TriggerType.DATAREMOVED); + break; + case DATAACCESSED: + tgt.setValue(TriggerDefinition.TriggerType.DATAACCESSED); + break; + case DATAACCESSENDED: + tgt.setValue(TriggerDefinition.TriggerType.DATAACCESSENDED); + break; + default: + tgt.setValue(TriggerDefinition.TriggerType.NULL); + break; + } +} return tgt; } @@ -71,35 +72,35 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TriggerDefinition.TriggerTypeEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.TriggerDefinition.TriggerType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case NAMEDEVENT: - tgt.setValue(org.hl7.fhir.dstu3.model.TriggerDefinition.TriggerType.NAMEDEVENT); - break; - case PERIODIC: - tgt.setValue(org.hl7.fhir.dstu3.model.TriggerDefinition.TriggerType.PERIODIC); - break; - case DATAADDED: - tgt.setValue(org.hl7.fhir.dstu3.model.TriggerDefinition.TriggerType.DATAADDED); - break; - case DATAMODIFIED: - tgt.setValue(org.hl7.fhir.dstu3.model.TriggerDefinition.TriggerType.DATAMODIFIED); - break; - case DATAREMOVED: - tgt.setValue(org.hl7.fhir.dstu3.model.TriggerDefinition.TriggerType.DATAREMOVED); - break; - case DATAACCESSED: - tgt.setValue(org.hl7.fhir.dstu3.model.TriggerDefinition.TriggerType.DATAACCESSED); - break; - case DATAACCESSENDED: - tgt.setValue(org.hl7.fhir.dstu3.model.TriggerDefinition.TriggerType.DATAACCESSENDED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.TriggerDefinition.TriggerType.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.TriggerDefinition.TriggerType.NAMEDEVENT); + break; + case PERIODIC: + tgt.setValue(org.hl7.fhir.dstu3.model.TriggerDefinition.TriggerType.PERIODIC); + break; + case DATAADDED: + tgt.setValue(org.hl7.fhir.dstu3.model.TriggerDefinition.TriggerType.DATAADDED); + break; + case DATAMODIFIED: + tgt.setValue(org.hl7.fhir.dstu3.model.TriggerDefinition.TriggerType.DATAMODIFIED); + break; + case DATAREMOVED: + tgt.setValue(org.hl7.fhir.dstu3.model.TriggerDefinition.TriggerType.DATAREMOVED); + break; + case DATAACCESSED: + tgt.setValue(org.hl7.fhir.dstu3.model.TriggerDefinition.TriggerType.DATAACCESSED); + break; + case DATAACCESSENDED: + tgt.setValue(org.hl7.fhir.dstu3.model.TriggerDefinition.TriggerType.DATAACCESSENDED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.TriggerDefinition.TriggerType.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/complextypes30_50/Address30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/complextypes30_50/Address30_50.java index 72ed161ffe..6534b99cee 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/complextypes30_50/Address30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/complextypes30_50/Address30_50.java @@ -3,6 +3,7 @@ import org.hl7.fhir.convertors.context.ConversionContext30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Address; public class Address30_50 { public static org.hl7.fhir.r5.model.Address convertAddress(org.hl7.fhir.dstu3.model.Address src) throws FHIRException { @@ -44,26 +45,26 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Address.AddressUseEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HOME: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressUse.HOME); - break; - case WORK: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressUse.WORK); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressUse.OLD); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressUse.NULL); - break; - } - } + tgt.setValue(Address.AddressUse.HOME); + break; + case WORK: + tgt.setValue(Address.AddressUse.WORK); + break; + case TEMP: + tgt.setValue(Address.AddressUse.TEMP); + break; + case OLD: + tgt.setValue(Address.AddressUse.OLD); + break; + default: + tgt.setValue(Address.AddressUse.NULL); + break; + } +} return tgt; } @@ -72,26 +73,26 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Address.AddressUseEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HOME: - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.HOME); - break; - case WORK: - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.WORK); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.OLD); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.HOME); + break; + case WORK: + tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.WORK); + break; + case TEMP: + tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.TEMP); + break; + case OLD: + tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.OLD); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.NULL); + break; + } +} return tgt; } @@ -100,23 +101,23 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Address.AddressTypeEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case POSTAL: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressType.POSTAL); - break; - case PHYSICAL: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressType.PHYSICAL); - break; - case BOTH: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressType.BOTH); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressType.NULL); - break; - } - } + tgt.setValue(Address.AddressType.POSTAL); + break; + case PHYSICAL: + tgt.setValue(Address.AddressType.PHYSICAL); + break; + case BOTH: + tgt.setValue(Address.AddressType.BOTH); + break; + default: + tgt.setValue(Address.AddressType.NULL); + break; + } +} return tgt; } @@ -125,23 +126,23 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Address.AddressTypeEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case POSTAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressType.POSTAL); - break; - case PHYSICAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressType.PHYSICAL); - break; - case BOTH: - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressType.BOTH); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressType.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressType.POSTAL); + break; + case PHYSICAL: + tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressType.PHYSICAL); + break; + case BOTH: + tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressType.BOTH); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressType.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/complextypes30_50/ContactPoint30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/complextypes30_50/ContactPoint30_50.java index 8e55d49787..8808bd4cc6 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/complextypes30_50/ContactPoint30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/complextypes30_50/ContactPoint30_50.java @@ -4,6 +4,7 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.PositiveInt30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.ContactPoint; public class ContactPoint30_50 { public static org.hl7.fhir.r5.model.ContactPoint convertContactPoint(org.hl7.fhir.dstu3.model.ContactPoint src) throws FHIRException { @@ -35,35 +36,35 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ContactPoint.ContactPointSystemEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case PHONE: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.PHONE); - break; - case FAX: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.FAX); - break; - case EMAIL: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.EMAIL); - break; - case PAGER: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.PAGER); - break; - case URL: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.URL); - break; - case SMS: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.SMS); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.NULL); - break; - } - } + tgt.setValue(ContactPoint.ContactPointSystem.PHONE); + break; + case FAX: + tgt.setValue(ContactPoint.ContactPointSystem.FAX); + break; + case EMAIL: + tgt.setValue(ContactPoint.ContactPointSystem.EMAIL); + break; + case PAGER: + tgt.setValue(ContactPoint.ContactPointSystem.PAGER); + break; + case URL: + tgt.setValue(ContactPoint.ContactPointSystem.URL); + break; + case SMS: + tgt.setValue(ContactPoint.ContactPointSystem.SMS); + break; + case OTHER: + tgt.setValue(ContactPoint.ContactPointSystem.OTHER); + break; + default: + tgt.setValue(ContactPoint.ContactPointSystem.NULL); + break; + } +} return tgt; } @@ -72,35 +73,35 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystemEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case PHONE: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.PHONE); - break; - case FAX: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.FAX); - break; - case EMAIL: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.EMAIL); - break; - case PAGER: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.PAGER); - break; - case URL: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.URL); - break; - case SMS: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.SMS); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.PHONE); + break; + case FAX: + tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.FAX); + break; + case EMAIL: + tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.EMAIL); + break; + case PAGER: + tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.PAGER); + break; + case URL: + tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.URL); + break; + case SMS: + tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.SMS); + break; + case OTHER: + tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.OTHER); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.NULL); + break; + } +} return tgt; } @@ -109,29 +110,29 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ContactPoint.ContactPointUseEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HOME: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.HOME); - break; - case WORK: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.WORK); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.OLD); - break; - case MOBILE: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.MOBILE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.NULL); - break; - } - } + tgt.setValue(ContactPoint.ContactPointUse.HOME); + break; + case WORK: + tgt.setValue(ContactPoint.ContactPointUse.WORK); + break; + case TEMP: + tgt.setValue(ContactPoint.ContactPointUse.TEMP); + break; + case OLD: + tgt.setValue(ContactPoint.ContactPointUse.OLD); + break; + case MOBILE: + tgt.setValue(ContactPoint.ContactPointUse.MOBILE); + break; + default: + tgt.setValue(ContactPoint.ContactPointUse.NULL); + break; + } +} return tgt; } @@ -140,29 +141,29 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUseEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HOME: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.HOME); - break; - case WORK: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.WORK); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.OLD); - break; - case MOBILE: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.MOBILE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.HOME); + break; + case WORK: + tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.WORK); + break; + case TEMP: + tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.TEMP); + break; + case OLD: + tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.OLD); + break; + case MOBILE: + tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.MOBILE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/complextypes30_50/HumanName30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/complextypes30_50/HumanName30_50.java index e1cd4d69f1..3c420eadf7 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/complextypes30_50/HumanName30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/complextypes30_50/HumanName30_50.java @@ -3,6 +3,7 @@ import org.hl7.fhir.convertors.context.ConversionContext30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.HumanName; public class HumanName30_50 { public static org.hl7.fhir.r5.model.HumanName convertHumanName(org.hl7.fhir.dstu3.model.HumanName src) throws FHIRException { @@ -38,35 +39,35 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.HumanName.NameUseEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case USUAL: - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.USUAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.OFFICIAL); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.TEMP); - break; - case NICKNAME: - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.NICKNAME); - break; - case ANONYMOUS: - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.ANONYMOUS); - break; - case OLD: - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.OLD); - break; - case MAIDEN: - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.MAIDEN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.NULL); - break; - } - } + tgt.setValue(HumanName.NameUse.USUAL); + break; + case OFFICIAL: + tgt.setValue(HumanName.NameUse.OFFICIAL); + break; + case TEMP: + tgt.setValue(HumanName.NameUse.TEMP); + break; + case NICKNAME: + tgt.setValue(HumanName.NameUse.NICKNAME); + break; + case ANONYMOUS: + tgt.setValue(HumanName.NameUse.ANONYMOUS); + break; + case OLD: + tgt.setValue(HumanName.NameUse.OLD); + break; + case MAIDEN: + tgt.setValue(HumanName.NameUse.MAIDEN); + break; + default: + tgt.setValue(HumanName.NameUse.NULL); + break; + } +} return tgt; } @@ -75,35 +76,35 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.HumanName.NameUseEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case USUAL: - tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.USUAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.OFFICIAL); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.TEMP); - break; - case NICKNAME: - tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.NICKNAME); - break; - case ANONYMOUS: - tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.ANONYMOUS); - break; - case OLD: - tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.OLD); - break; - case MAIDEN: - tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.MAIDEN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.USUAL); + break; + case OFFICIAL: + tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.OFFICIAL); + break; + case TEMP: + tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.TEMP); + break; + case NICKNAME: + tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.NICKNAME); + break; + case ANONYMOUS: + tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.ANONYMOUS); + break; + case OLD: + tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.OLD); + break; + case MAIDEN: + tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.MAIDEN); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/complextypes30_50/Identifier30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/complextypes30_50/Identifier30_50.java index 58105f63df..b80ba0dc88 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/complextypes30_50/Identifier30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/complextypes30_50/Identifier30_50.java @@ -5,6 +5,7 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Uri30_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Identifier; public class Identifier30_50 { public static org.hl7.fhir.r5.model.Identifier convertIdentifier(org.hl7.fhir.dstu3.model.Identifier src) throws FHIRException { @@ -38,26 +39,26 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Identifier.IdentifierUseEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Identifier.IdentifierUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case USUAL: - tgt.setValue(org.hl7.fhir.r5.model.Identifier.IdentifierUse.USUAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.r5.model.Identifier.IdentifierUse.OFFICIAL); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.r5.model.Identifier.IdentifierUse.TEMP); - break; - case SECONDARY: - tgt.setValue(org.hl7.fhir.r5.model.Identifier.IdentifierUse.SECONDARY); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Identifier.IdentifierUse.NULL); - break; - } - } + tgt.setValue(Identifier.IdentifierUse.USUAL); + break; + case OFFICIAL: + tgt.setValue(Identifier.IdentifierUse.OFFICIAL); + break; + case TEMP: + tgt.setValue(Identifier.IdentifierUse.TEMP); + break; + case SECONDARY: + tgt.setValue(Identifier.IdentifierUse.SECONDARY); + break; + default: + tgt.setValue(Identifier.IdentifierUse.NULL); + break; + } +} return tgt; } @@ -66,29 +67,29 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Identifier.IdentifierUseEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case USUAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.USUAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.OFFICIAL); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.TEMP); - break; - case SECONDARY: - tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.SECONDARY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.USUAL); + break; + case OFFICIAL: + tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.OFFICIAL); + break; + case TEMP: + tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.TEMP); + break; + case OLD: + tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.TEMP); + break; + case SECONDARY: + tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.SECONDARY); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/complextypes30_50/Quantity30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/complextypes30_50/Quantity30_50.java index 05719c3306..5166a07282 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/complextypes30_50/Quantity30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/complextypes30_50/Quantity30_50.java @@ -5,7 +5,9 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Decimal30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Uri30_50; +import org.hl7.fhir.dstu3.model.Quantity; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumerations; public class Quantity30_50 { public static void copyQuantity(org.hl7.fhir.dstu3.model.Quantity src, org.hl7.fhir.r5.model.Quantity tgt) throws FHIRException { @@ -57,26 +59,26 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.QuantityComparatorEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.QuantityComparator.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case LESS_THAN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.QuantityComparator.LESS_THAN); - break; - case LESS_OR_EQUAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.QuantityComparator.LESS_OR_EQUAL); - break; - case GREATER_OR_EQUAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.QuantityComparator.GREATER_OR_EQUAL); - break; - case GREATER_THAN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.QuantityComparator.GREATER_THAN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.QuantityComparator.NULL); - break; - } - } + tgt.setValue(Enumerations.QuantityComparator.LESS_THAN); + break; + case LESS_OR_EQUAL: + tgt.setValue(Enumerations.QuantityComparator.LESS_OR_EQUAL); + break; + case GREATER_OR_EQUAL: + tgt.setValue(Enumerations.QuantityComparator.GREATER_OR_EQUAL); + break; + case GREATER_THAN: + tgt.setValue(Enumerations.QuantityComparator.GREATER_THAN); + break; + default: + tgt.setValue(Enumerations.QuantityComparator.NULL); + break; + } +} return tgt; } @@ -85,26 +87,26 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Quantity.QuantityComparatorEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Quantity.QuantityComparator.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case LESS_THAN: - tgt.setValue(org.hl7.fhir.dstu3.model.Quantity.QuantityComparator.LESS_THAN); - break; - case LESS_OR_EQUAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Quantity.QuantityComparator.LESS_OR_EQUAL); - break; - case GREATER_OR_EQUAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Quantity.QuantityComparator.GREATER_OR_EQUAL); - break; - case GREATER_THAN: - tgt.setValue(org.hl7.fhir.dstu3.model.Quantity.QuantityComparator.GREATER_THAN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Quantity.QuantityComparator.NULL); - break; - } - } + tgt.setValue(Quantity.QuantityComparator.LESS_THAN); + break; + case LESS_OR_EQUAL: + tgt.setValue(Quantity.QuantityComparator.LESS_OR_EQUAL); + break; + case GREATER_OR_EQUAL: + tgt.setValue(Quantity.QuantityComparator.GREATER_OR_EQUAL); + break; + case GREATER_THAN: + tgt.setValue(Quantity.QuantityComparator.GREATER_THAN); + break; + default: + tgt.setValue(Quantity.QuantityComparator.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/complextypes30_50/Timing30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/complextypes30_50/Timing30_50.java index 84604fb917..a9578c9e18 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/complextypes30_50/Timing30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/complextypes30_50/Timing30_50.java @@ -6,6 +6,8 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Decimal30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.UnsignedInt30_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumerations; +import org.hl7.fhir.r5.model.Timing; public class Timing30_50 { public static org.hl7.fhir.r5.model.Timing convertTiming(org.hl7.fhir.dstu3.model.Timing src) throws FHIRException { @@ -81,35 +83,35 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Timing.UnitsOfTimeEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case S: - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.S); - break; - case MIN: - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.MIN); - break; - case H: - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.H); - break; - case D: - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.D); - break; - case WK: - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.WK); - break; - case MO: - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.MO); - break; - case A: - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.A); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.NULL); - break; - } - } + tgt.setValue(Timing.UnitsOfTime.S); + break; + case MIN: + tgt.setValue(Timing.UnitsOfTime.MIN); + break; + case H: + tgt.setValue(Timing.UnitsOfTime.H); + break; + case D: + tgt.setValue(Timing.UnitsOfTime.D); + break; + case WK: + tgt.setValue(Timing.UnitsOfTime.WK); + break; + case MO: + tgt.setValue(Timing.UnitsOfTime.MO); + break; + case A: + tgt.setValue(Timing.UnitsOfTime.A); + break; + default: + tgt.setValue(Timing.UnitsOfTime.NULL); + break; + } +} return tgt; } @@ -118,35 +120,35 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Timing.UnitsOfTimeEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case S: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.S); - break; - case MIN: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.MIN); - break; - case H: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.H); - break; - case D: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.D); - break; - case WK: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.WK); - break; - case MO: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.MO); - break; - case A: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.A); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.S); + break; + case MIN: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.MIN); + break; + case H: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.H); + break; + case D: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.D); + break; + case WK: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.WK); + break; + case MO: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.MO); + break; + case A: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.A); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.NULL); + break; + } +} return tgt; } @@ -155,35 +157,35 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.DaysOfWeekEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case MON: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.MON); - break; - case TUE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.TUE); - break; - case WED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.WED); - break; - case THU: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.THU); - break; - case FRI: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.FRI); - break; - case SAT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.SAT); - break; - case SUN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.SUN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.NULL); - break; - } - } + tgt.setValue(Enumerations.DaysOfWeek.MON); + break; + case TUE: + tgt.setValue(Enumerations.DaysOfWeek.TUE); + break; + case WED: + tgt.setValue(Enumerations.DaysOfWeek.WED); + break; + case THU: + tgt.setValue(Enumerations.DaysOfWeek.THU); + break; + case FRI: + tgt.setValue(Enumerations.DaysOfWeek.FRI); + break; + case SAT: + tgt.setValue(Enumerations.DaysOfWeek.SAT); + break; + case SUN: + tgt.setValue(Enumerations.DaysOfWeek.SUN); + break; + default: + tgt.setValue(Enumerations.DaysOfWeek.NULL); + break; + } +} return tgt; } @@ -192,35 +194,35 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Timing.DayOfWeekEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.DayOfWeek.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case MON: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.DayOfWeek.MON); - break; - case TUE: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.DayOfWeek.TUE); - break; - case WED: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.DayOfWeek.WED); - break; - case THU: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.DayOfWeek.THU); - break; - case FRI: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.DayOfWeek.FRI); - break; - case SAT: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.DayOfWeek.SAT); - break; - case SUN: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.DayOfWeek.SUN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.DayOfWeek.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.DayOfWeek.MON); + break; + case TUE: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.DayOfWeek.TUE); + break; + case WED: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.DayOfWeek.WED); + break; + case THU: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.DayOfWeek.THU); + break; + case FRI: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.DayOfWeek.FRI); + break; + case SAT: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.DayOfWeek.SAT); + break; + case SUN: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.DayOfWeek.SUN); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.DayOfWeek.NULL); + break; + } +} return tgt; } @@ -229,71 +231,71 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Timing.EventTimingEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case MORN: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.MORN); - break; - case AFT: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.AFT); - break; - case EVE: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.EVE); - break; - case NIGHT: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.NIGHT); - break; - case PHS: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.PHS); - break; - case HS: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.HS); - break; - case WAKE: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.WAKE); - break; - case C: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.C); - break; - case CM: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.CM); - break; - case CD: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.CD); - break; - case CV: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.CV); - break; - case AC: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.AC); - break; - case ACM: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.ACM); - break; - case ACD: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.ACD); - break; - case ACV: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.ACV); - break; - case PC: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.PC); - break; - case PCM: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.PCM); - break; - case PCD: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.PCD); - break; - case PCV: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.PCV); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.NULL); - break; - } - } + tgt.setValue(Timing.EventTiming.MORN); + break; + case AFT: + tgt.setValue(Timing.EventTiming.AFT); + break; + case EVE: + tgt.setValue(Timing.EventTiming.EVE); + break; + case NIGHT: + tgt.setValue(Timing.EventTiming.NIGHT); + break; + case PHS: + tgt.setValue(Timing.EventTiming.PHS); + break; + case HS: + tgt.setValue(Timing.EventTiming.HS); + break; + case WAKE: + tgt.setValue(Timing.EventTiming.WAKE); + break; + case C: + tgt.setValue(Timing.EventTiming.C); + break; + case CM: + tgt.setValue(Timing.EventTiming.CM); + break; + case CD: + tgt.setValue(Timing.EventTiming.CD); + break; + case CV: + tgt.setValue(Timing.EventTiming.CV); + break; + case AC: + tgt.setValue(Timing.EventTiming.AC); + break; + case ACM: + tgt.setValue(Timing.EventTiming.ACM); + break; + case ACD: + tgt.setValue(Timing.EventTiming.ACD); + break; + case ACV: + tgt.setValue(Timing.EventTiming.ACV); + break; + case PC: + tgt.setValue(Timing.EventTiming.PC); + break; + case PCM: + tgt.setValue(Timing.EventTiming.PCM); + break; + case PCD: + tgt.setValue(Timing.EventTiming.PCD); + break; + case PCV: + tgt.setValue(Timing.EventTiming.PCV); + break; + default: + tgt.setValue(Timing.EventTiming.NULL); + break; + } +} return tgt; } @@ -302,71 +304,71 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Timing.EventTimingEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case MORN: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.MORN); - break; - case AFT: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.AFT); - break; - case EVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.EVE); - break; - case NIGHT: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.NIGHT); - break; - case PHS: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.PHS); - break; - case HS: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.HS); - break; - case WAKE: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.WAKE); - break; - case C: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.C); - break; - case CM: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.CM); - break; - case CD: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.CD); - break; - case CV: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.CV); - break; - case AC: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.AC); - break; - case ACM: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.ACM); - break; - case ACD: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.ACD); - break; - case ACV: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.ACV); - break; - case PC: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.PC); - break; - case PCM: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.PCM); - break; - case PCD: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.PCD); - break; - case PCV: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.PCV); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.MORN); + break; + case AFT: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.AFT); + break; + case EVE: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.EVE); + break; + case NIGHT: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.NIGHT); + break; + case PHS: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.PHS); + break; + case HS: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.HS); + break; + case WAKE: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.WAKE); + break; + case C: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.C); + break; + case CM: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.CM); + break; + case CD: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.CD); + break; + case CV: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.CV); + break; + case AC: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.AC); + break; + case ACM: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.ACM); + break; + case ACD: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.ACD); + break; + case ACV: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.ACV); + break; + case PC: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.PC); + break; + case PCM: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.PCM); + break; + case PCD: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.PCD); + break; + case PCV: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.PCV); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/ActivityDefinition30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/ActivityDefinition30_50.java index 40d5253df1..2b882baaf2 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/ActivityDefinition30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/ActivityDefinition30_50.java @@ -19,7 +19,10 @@ import org.hl7.fhir.dstu3.model.ContactDetail; import org.hl7.fhir.dstu3.model.Contributor.ContributorType; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.ActivityDefinition; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; public class ActivityDefinition30_50 { @@ -238,57 +241,61 @@ public static org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionDyna static public org.hl7.fhir.r5.model.Enumeration convertActivityDefinitionKind(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { if (src == null || src.isEmpty()) return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypesEnumFactory()); + Enumeration tgt = new Enumeration<>(new ActivityDefinition.RequestResourceTypesEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case APPOINTMENT: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.APPOINTMENT); - break; - case APPOINTMENTRESPONSE: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.APPOINTMENTRESPONSE); - break; - case CAREPLAN: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.CAREPLAN); - break; - case CLAIM: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.CLAIM); - break; - case COMMUNICATIONREQUEST: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.COMMUNICATIONREQUEST); - break; - case DEVICEREQUEST: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.DEVICEREQUEST); - break; - case ENROLLMENTREQUEST: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.ENROLLMENTREQUEST); - break; - case IMMUNIZATIONRECOMMENDATION: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.IMMUNIZATIONRECOMMENDATION); - break; - case MEDICATIONREQUEST: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.MEDICATIONREQUEST); - break; - case NUTRITIONORDER: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.NUTRITIONORDER); - break; - case PROCEDUREREQUEST: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.SERVICEREQUEST); - break; - case REFERRALREQUEST: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.SERVICEREQUEST); - break; - case SUPPLYREQUEST: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.SUPPLYREQUEST); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case APPOINTMENT: + tgt.setValue(ActivityDefinition.RequestResourceTypes.APPOINTMENT); + break; + case APPOINTMENTRESPONSE: + tgt.setValue(ActivityDefinition.RequestResourceTypes.APPOINTMENTRESPONSE); + break; + case CAREPLAN: + tgt.setValue(ActivityDefinition.RequestResourceTypes.CAREPLAN); + break; + case CLAIM: + tgt.setValue(ActivityDefinition.RequestResourceTypes.CLAIM); + break; + case COMMUNICATIONREQUEST: + tgt.setValue(ActivityDefinition.RequestResourceTypes.COMMUNICATIONREQUEST); + break; + case DEVICEREQUEST: + tgt.setValue(ActivityDefinition.RequestResourceTypes.DEVICEREQUEST); + break; + case ENROLLMENTREQUEST: + tgt.setValue(ActivityDefinition.RequestResourceTypes.ENROLLMENTREQUEST); + break; + case IMMUNIZATIONRECOMMENDATION: + tgt.setValue(ActivityDefinition.RequestResourceTypes.IMMUNIZATIONRECOMMENDATION); + break; + case MEDICATIONREQUEST: + tgt.setValue(ActivityDefinition.RequestResourceTypes.MEDICATIONREQUEST); + break; + case NUTRITIONORDER: + tgt.setValue(ActivityDefinition.RequestResourceTypes.NUTRITIONORDER); + break; + case PROCEDUREREQUEST: + tgt.setValue(ActivityDefinition.RequestResourceTypes.SERVICEREQUEST); + break; + case REFERRALREQUEST: + tgt.setValue(ActivityDefinition.RequestResourceTypes.SERVICEREQUEST); + break; + case SUPPLYREQUEST: + tgt.setValue(ActivityDefinition.RequestResourceTypes.SUPPLYREQUEST); + break; // case TASK: // tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.TASK); // break; - case VISIONPRESCRIPTION: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.VISIONPRESCRIPTION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.NULL); - break; + case VISIONPRESCRIPTION: + tgt.setValue(ActivityDefinition.RequestResourceTypes.VISIONPRESCRIPTION); + break; + default: + tgt.setValue(ActivityDefinition.RequestResourceTypes.NULL); + break; + } } return tgt; } @@ -298,52 +305,56 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKindEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case APPOINTMENT: - tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.APPOINTMENT); - break; - case APPOINTMENTRESPONSE: - tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.APPOINTMENTRESPONSE); - break; - case CAREPLAN: - tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.CAREPLAN); - break; - case CLAIM: - tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.CLAIM); - break; - case COMMUNICATIONREQUEST: - tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.COMMUNICATIONREQUEST); - break; - case DEVICEREQUEST: - tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.DEVICEREQUEST); - break; - case ENROLLMENTREQUEST: - tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.ENROLLMENTREQUEST); - break; - case IMMUNIZATIONRECOMMENDATION: - tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.IMMUNIZATIONRECOMMENDATION); - break; - case MEDICATIONREQUEST: - tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.MEDICATIONREQUEST); - break; - case NUTRITIONORDER: - tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.NUTRITIONORDER); - break; - case SERVICEREQUEST: - tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.PROCEDUREREQUEST); - break; - case SUPPLYREQUEST: - tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.SUPPLYREQUEST); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case APPOINTMENT: + tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.APPOINTMENT); + break; + case APPOINTMENTRESPONSE: + tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.APPOINTMENTRESPONSE); + break; + case CAREPLAN: + tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.CAREPLAN); + break; + case CLAIM: + tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.CLAIM); + break; + case COMMUNICATIONREQUEST: + tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.COMMUNICATIONREQUEST); + break; + case DEVICEREQUEST: + tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.DEVICEREQUEST); + break; + case ENROLLMENTREQUEST: + tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.ENROLLMENTREQUEST); + break; + case IMMUNIZATIONRECOMMENDATION: + tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.IMMUNIZATIONRECOMMENDATION); + break; + case MEDICATIONREQUEST: + tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.MEDICATIONREQUEST); + break; + case NUTRITIONORDER: + tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.NUTRITIONORDER); + break; + case SERVICEREQUEST: + tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.PROCEDUREREQUEST); + break; + case SUPPLYREQUEST: + tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.SUPPLYREQUEST); + break; // case TASK: // tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.TASK); // break; - case VISIONPRESCRIPTION: - tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.VISIONPRESCRIPTION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.NULL); - break; + case VISIONPRESCRIPTION: + tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.VISIONPRESCRIPTION); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionKind.NULL); + break; + } } return tgt; } @@ -375,21 +386,25 @@ public static org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityDefinitionPart static public org.hl7.fhir.r5.model.Enumeration convertActivityParticipantType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { if (src == null || src.isEmpty()) return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ActionParticipantTypeEnumFactory()); + Enumeration tgt = new Enumeration<>(new Enumerations.ActionParticipantTypeEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PATIENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.PATIENT); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.PRACTITIONER); - break; - case RELATEDPERSON: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.RELATEDPERSON); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PATIENT: + tgt.setValue(Enumerations.ActionParticipantType.PATIENT); + break; + case PRACTITIONER: + tgt.setValue(Enumerations.ActionParticipantType.PRACTITIONER); + break; + case RELATEDPERSON: + tgt.setValue(Enumerations.ActionParticipantType.RELATEDPERSON); + break; + default: + tgt.setValue(Enumerations.ActionParticipantType.NULL); + break; + } } return tgt; } @@ -399,19 +414,23 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityParticipantTypeEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PATIENT: - tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityParticipantType.PATIENT); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityParticipantType.PRACTITIONER); - break; - case RELATEDPERSON: - tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityParticipantType.RELATEDPERSON); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityParticipantType.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PATIENT: + tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityParticipantType.PATIENT); + break; + case PRACTITIONER: + tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityParticipantType.PRACTITIONER); + break; + case RELATEDPERSON: + tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityParticipantType.RELATEDPERSON); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.ActivityDefinition.ActivityParticipantType.NULL); + break; + } } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/AllergyIntolerance30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/AllergyIntolerance30_50.java index 30cd23bbdf..8601ba6b1b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/AllergyIntolerance30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/AllergyIntolerance30_50.java @@ -10,10 +10,8 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.DateTime30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.*; import org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceParticipantComponent; -import org.hl7.fhir.r5.model.CodeableConcept; -import org.hl7.fhir.r5.model.CodeableReference; -import org.hl7.fhir.r5.model.Coding; public class AllergyIntolerance30_50 { @@ -102,24 +100,28 @@ public static org.hl7.fhir.r5.model.AllergyIntolerance convertAllergyIntolerance static public org.hl7.fhir.r5.model.Enumeration convertAllergyIntoleranceCategory(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { if (src == null || src.isEmpty()) return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategoryEnumFactory()); + Enumeration tgt = new Enumeration<>(new AllergyIntolerance.AllergyIntoleranceCategoryEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case FOOD: - tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory.FOOD); - break; - case MEDICATION: - tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory.MEDICATION); - break; - case ENVIRONMENT: - tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory.ENVIRONMENT); - break; - case BIOLOGIC: - tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory.BIOLOGIC); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FOOD: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceCategory.FOOD); + break; + case MEDICATION: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceCategory.MEDICATION); + break; + case ENVIRONMENT: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceCategory.ENVIRONMENT); + break; + case BIOLOGIC: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceCategory.BIOLOGIC); + break; + default: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceCategory.NULL); + break; + } } return tgt; } @@ -129,22 +131,26 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCategoryEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case FOOD: - tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCategory.FOOD); - break; - case MEDICATION: - tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCategory.MEDICATION); - break; - case ENVIRONMENT: - tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCategory.ENVIRONMENT); - break; - case BIOLOGIC: - tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCategory.BIOLOGIC); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCategory.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FOOD: + tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCategory.FOOD); + break; + case MEDICATION: + tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCategory.MEDICATION); + break; + case ENVIRONMENT: + tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCategory.ENVIRONMENT); + break; + case BIOLOGIC: + tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCategory.BIOLOGIC); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCategory.NULL); + break; + } } return tgt; } @@ -181,19 +187,23 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCriticalityEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case LOW: - tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCriticality.LOW); - break; - case HIGH: - tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCriticality.HIGH); - break; - case UNABLETOASSESS: - tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCriticality.UNABLETOASSESS); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCriticality.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case LOW: + tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCriticality.LOW); + break; + case HIGH: + tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCriticality.HIGH); + break; + case UNABLETOASSESS: + tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCriticality.UNABLETOASSESS); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCriticality.NULL); + break; + } } return tgt; } @@ -201,21 +211,25 @@ static public org.hl7.fhir.dstu3.model.Enumeration convertAllergyIntoleranceCriticality(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { if (src == null || src.isEmpty()) return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticalityEnumFactory()); + Enumeration tgt = new Enumeration<>(new AllergyIntolerance.AllergyIntoleranceCriticalityEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case LOW: - tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality.LOW); - break; - case HIGH: - tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality.HIGH); - break; - case UNABLETOASSESS: - tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality.UNABLETOASSESS); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case LOW: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceCriticality.LOW); + break; + case HIGH: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceCriticality.HIGH); + break; + case UNABLETOASSESS: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceCriticality.UNABLETOASSESS); + break; + default: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceCriticality.NULL); + break; + } } return tgt; } @@ -265,21 +279,25 @@ public static org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceReactio static public org.hl7.fhir.r5.model.Enumeration convertAllergyIntoleranceSeverity(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { if (src == null || src.isEmpty()) return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverityEnumFactory()); + Enumeration tgt = new Enumeration<>(new AllergyIntolerance.AllergyIntoleranceSeverityEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case MILD: - tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity.MILD); - break; - case MODERATE: - tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity.MODERATE); - break; - case SEVERE: - tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity.SEVERE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MILD: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceSeverity.MILD); + break; + case MODERATE: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceSeverity.MODERATE); + break; + case SEVERE: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceSeverity.SEVERE); + break; + default: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceSeverity.NULL); + break; + } } return tgt; } @@ -289,19 +307,23 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceSeverityEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case MILD: - tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceSeverity.MILD); - break; - case MODERATE: - tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceSeverity.MODERATE); - break; - case SEVERE: - tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceSeverity.SEVERE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceSeverity.NULL); - break; + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MILD: + tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceSeverity.MILD); + break; + case MODERATE: + tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceSeverity.MODERATE); + break; + case SEVERE: + tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceSeverity.SEVERE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceSeverity.NULL); + break; + } } return tgt; } @@ -322,18 +344,22 @@ static public org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { if (src == null || src.isEmpty()) return null; - org.hl7.fhir.r5.model.CodeableConcept tgt = new org.hl7.fhir.r5.model.CodeableConcept(); + CodeableConcept tgt = new CodeableConcept(); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case ALLERGY: - tgt.addCoding("http://hl7.org/fhir/allergy-intolerance-type", "allergy", "Allergy"); - break; - case INTOLERANCE: - tgt.addCoding("http://hl7.org/fhir/allergy-intolerance-type", "intolerance", "Intolerance"); - break; - default: - break; - } + if (src.getValue() == null) { + // Add nothing + } else { + switch (src.getValue()) { + case ALLERGY: + tgt.addCoding("http://hl7.org/fhir/allergy-intolerance-type", "allergy", "Allergy"); + break; + case INTOLERANCE: + tgt.addCoding("http://hl7.org/fhir/allergy-intolerance-type", "intolerance", "Intolerance"); + break; + default: + break; + } + } return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Appointment30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Appointment30_50.java index 94be56b58e..d546023cec 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Appointment30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Appointment30_50.java @@ -9,8 +9,11 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Instant30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.PositiveInt30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; +import org.hl7.fhir.dstu3.model.Appointment; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.dstu3.model.UnsignedIntType; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.BooleanType; import org.hl7.fhir.r5.model.CodeableConcept; import org.hl7.fhir.r5.model.CodeableReference; @@ -166,77 +169,85 @@ public static org.hl7.fhir.r5.model.Appointment.AppointmentParticipantComponent } static public org.hl7.fhir.dstu3.model.Enumeration convertAppointmentStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Appointment.AppointmentStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSED: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.PROPOSED); - break; - case PENDING: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.PENDING); - break; - case BOOKED: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.BOOKED); - break; - case ARRIVED: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.ARRIVED); - break; - case FULFILLED: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.FULFILLED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.CANCELLED); - break; - case NOSHOW: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.NOSHOW); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Appointment.AppointmentStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSED: + tgt.setValue(Appointment.AppointmentStatus.PROPOSED); + break; + case PENDING: + tgt.setValue(Appointment.AppointmentStatus.PENDING); + break; + case BOOKED: + tgt.setValue(Appointment.AppointmentStatus.BOOKED); + break; + case ARRIVED: + tgt.setValue(Appointment.AppointmentStatus.ARRIVED); + break; + case FULFILLED: + tgt.setValue(Appointment.AppointmentStatus.FULFILLED); + break; + case CANCELLED: + tgt.setValue(Appointment.AppointmentStatus.CANCELLED); + break; + case NOSHOW: + tgt.setValue(Appointment.AppointmentStatus.NOSHOW); + break; + case ENTEREDINERROR: + tgt.setValue(Appointment.AppointmentStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Appointment.AppointmentStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertAppointmentStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Appointment.AppointmentStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSED: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.PROPOSED); - break; - case PENDING: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.PENDING); - break; - case BOOKED: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.BOOKED); - break; - case ARRIVED: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.ARRIVED); - break; - case FULFILLED: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.FULFILLED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.CANCELLED); - break; - case NOSHOW: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.NOSHOW); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Appointment.AppointmentStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSED: + tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.PROPOSED); + break; + case PENDING: + tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.PENDING); + break; + case BOOKED: + tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.BOOKED); + break; + case ARRIVED: + tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.ARRIVED); + break; + case FULFILLED: + tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.FULFILLED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.CANCELLED); + break; + case NOSHOW: + tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.NOSHOW); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertParticipantRequired(org.hl7.fhir.r5.model.BooleanType src) throws FHIRException { @@ -253,73 +264,85 @@ static public org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.BooleanType tgt = new org.hl7.fhir.r5.model.BooleanType(); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case REQUIRED: - tgt.setValue(true); - break; - case OPTIONAL: - tgt.setValue(false); - break; - case INFORMATIONONLY: - tgt.setValue(false); - break; - default: - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + BooleanType tgt = new BooleanType(); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REQUIRED: + tgt.setValue(true); + break; + case OPTIONAL: + tgt.setValue(false); + break; + case INFORMATIONONLY: + tgt.setValue(false); + break; + default: + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertParticipationStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Appointment.ParticipationStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACCEPTED: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipationStatus.ACCEPTED); - break; - case DECLINED: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipationStatus.DECLINED); - break; - case TENTATIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipationStatus.TENTATIVE); - break; - case NEEDSACTION: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipationStatus.NEEDSACTION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Appointment.ParticipationStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACCEPTED: + tgt.setValue(Appointment.ParticipationStatus.ACCEPTED); + break; + case DECLINED: + tgt.setValue(Appointment.ParticipationStatus.DECLINED); + break; + case TENTATIVE: + tgt.setValue(Appointment.ParticipationStatus.TENTATIVE); + break; + case NEEDSACTION: + tgt.setValue(Appointment.ParticipationStatus.NEEDSACTION); + break; + default: + tgt.setValue(Appointment.ParticipationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertParticipationStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Appointment.ParticipationStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACCEPTED: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.ParticipationStatus.ACCEPTED); - break; - case DECLINED: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.ParticipationStatus.DECLINED); - break; - case TENTATIVE: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.ParticipationStatus.TENTATIVE); - break; - case NEEDSACTION: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.ParticipationStatus.NEEDSACTION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.ParticipationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Appointment.ParticipationStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACCEPTED: + tgt.setValue(org.hl7.fhir.r5.model.Appointment.ParticipationStatus.ACCEPTED); + break; + case DECLINED: + tgt.setValue(org.hl7.fhir.r5.model.Appointment.ParticipationStatus.DECLINED); + break; + case TENTATIVE: + tgt.setValue(org.hl7.fhir.r5.model.Appointment.ParticipationStatus.TENTATIVE); + break; + case NEEDSACTION: + tgt.setValue(org.hl7.fhir.r5.model.Appointment.ParticipationStatus.NEEDSACTION); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.Appointment.ParticipationStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/AppointmentResponse30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/AppointmentResponse30_50.java index 9ea7fc2260..8927546fe8 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/AppointmentResponse30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/AppointmentResponse30_50.java @@ -6,6 +6,8 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.Identifier30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Instant30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; +import org.hl7.fhir.dstu3.model.AppointmentResponse; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; public class AppointmentResponse30_50 { @@ -59,52 +61,60 @@ public static org.hl7.fhir.dstu3.model.AppointmentResponse convertAppointmentRes } static public org.hl7.fhir.dstu3.model.Enumeration convertParticipantStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACCEPTED: - tgt.setValue(org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatus.ACCEPTED); - break; - case DECLINED: - tgt.setValue(org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatus.DECLINED); - break; - case TENTATIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatus.TENTATIVE); - break; - case NEEDSACTION: - tgt.setValue(org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatus.NEEDSACTION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new AppointmentResponse.ParticipantStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACCEPTED: + tgt.setValue(AppointmentResponse.ParticipantStatus.ACCEPTED); + break; + case DECLINED: + tgt.setValue(AppointmentResponse.ParticipantStatus.DECLINED); + break; + case TENTATIVE: + tgt.setValue(AppointmentResponse.ParticipantStatus.TENTATIVE); + break; + case NEEDSACTION: + tgt.setValue(AppointmentResponse.ParticipantStatus.NEEDSACTION); + break; + default: + tgt.setValue(AppointmentResponse.ParticipantStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertParticipantStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.AppointmentResponse.AppointmentResponseStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACCEPTED: - tgt.setValue(org.hl7.fhir.r5.model.AppointmentResponse.AppointmentResponseStatus.ACCEPTED); - break; - case DECLINED: - tgt.setValue(org.hl7.fhir.r5.model.AppointmentResponse.AppointmentResponseStatus.DECLINED); - break; - case TENTATIVE: - tgt.setValue(org.hl7.fhir.r5.model.AppointmentResponse.AppointmentResponseStatus.TENTATIVE); - break; - case NEEDSACTION: - tgt.setValue(org.hl7.fhir.r5.model.AppointmentResponse.AppointmentResponseStatus.NEEDSACTION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.AppointmentResponse.AppointmentResponseStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.AppointmentResponse.AppointmentResponseStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACCEPTED: + tgt.setValue(org.hl7.fhir.r5.model.AppointmentResponse.AppointmentResponseStatus.ACCEPTED); + break; + case DECLINED: + tgt.setValue(org.hl7.fhir.r5.model.AppointmentResponse.AppointmentResponseStatus.DECLINED); + break; + case TENTATIVE: + tgt.setValue(org.hl7.fhir.r5.model.AppointmentResponse.AppointmentResponseStatus.TENTATIVE); + break; + case NEEDSACTION: + tgt.setValue(org.hl7.fhir.r5.model.AppointmentResponse.AppointmentResponseStatus.NEEDSACTION); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.AppointmentResponse.AppointmentResponseStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/AuditEvent30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/AuditEvent30_50.java index 463c405362..129f8c64d9 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/AuditEvent30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/AuditEvent30_50.java @@ -10,7 +10,9 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Instant30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.AuditEvent; import org.hl7.fhir.r5.model.CodeableConcept; +import org.hl7.fhir.r5.model.Enumeration; public class AuditEvent30_50 { @@ -70,59 +72,67 @@ public static org.hl7.fhir.dstu3.model.AuditEvent convertAuditEvent(org.hl7.fhir } static public org.hl7.fhir.r5.model.Enumeration convertAuditEventAction(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.AuditEvent.AuditEventActionEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case C: - tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.C); - break; - case R: - tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.R); - break; - case U: - tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.U); - break; - case D: - tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.D); - break; - case E: - tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.E); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new AuditEvent.AuditEventActionEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case C: + tgt.setValue(AuditEvent.AuditEventAction.C); + break; + case R: + tgt.setValue(AuditEvent.AuditEventAction.R); + break; + case U: + tgt.setValue(AuditEvent.AuditEventAction.U); + break; + case D: + tgt.setValue(AuditEvent.AuditEventAction.D); + break; + case E: + tgt.setValue(AuditEvent.AuditEventAction.E); + break; + default: + tgt.setValue(AuditEvent.AuditEventAction.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertAuditEventAction(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventActionEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case C: - tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.C); - break; - case R: - tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.R); - break; - case U: - tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.U); - break; - case D: - tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.D); - break; - case E: - tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.E); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventActionEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case C: + tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.C); + break; + case R: + tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.R); + break; + case U: + tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.U); + break; + case D: + tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.D); + break; + case E: + tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.E); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentComponent convertAuditEventAgentComponent(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Bundle30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Bundle30_50.java index a52ec69bb7..651321f96e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Bundle30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Bundle30_50.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.UnsignedInt30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Uri30_50; +import org.hl7.fhir.dstu3.model.Bundle; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.Bundle.LinkRelationTypes; @@ -216,176 +218,200 @@ public static org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent convertBundleL } static public org.hl7.fhir.dstu3.model.Enumeration convertBundleType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Bundle.BundleTypeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case DOCUMENT: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.DOCUMENT); - break; - case MESSAGE: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.MESSAGE); - break; - case TRANSACTION: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.TRANSACTION); - break; - case TRANSACTIONRESPONSE: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.TRANSACTIONRESPONSE); - break; - case BATCH: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.BATCH); - break; - case BATCHRESPONSE: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.BATCHRESPONSE); - break; - case HISTORY: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.HISTORY); - break; - case SEARCHSET: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.SEARCHSET); - break; - case COLLECTION: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.COLLECTION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Bundle.BundleTypeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DOCUMENT: + tgt.setValue(Bundle.BundleType.DOCUMENT); + break; + case MESSAGE: + tgt.setValue(Bundle.BundleType.MESSAGE); + break; + case TRANSACTION: + tgt.setValue(Bundle.BundleType.TRANSACTION); + break; + case TRANSACTIONRESPONSE: + tgt.setValue(Bundle.BundleType.TRANSACTIONRESPONSE); + break; + case BATCH: + tgt.setValue(Bundle.BundleType.BATCH); + break; + case BATCHRESPONSE: + tgt.setValue(Bundle.BundleType.BATCHRESPONSE); + break; + case HISTORY: + tgt.setValue(Bundle.BundleType.HISTORY); + break; + case SEARCHSET: + tgt.setValue(Bundle.BundleType.SEARCHSET); + break; + case COLLECTION: + tgt.setValue(Bundle.BundleType.COLLECTION); + break; + default: + tgt.setValue(Bundle.BundleType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertBundleType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Bundle.BundleTypeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case DOCUMENT: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.DOCUMENT); - break; - case MESSAGE: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.MESSAGE); - break; - case TRANSACTION: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.TRANSACTION); - break; - case TRANSACTIONRESPONSE: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.TRANSACTIONRESPONSE); - break; - case BATCH: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.BATCH); - break; - case BATCHRESPONSE: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.BATCHRESPONSE); - break; - case HISTORY: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.HISTORY); - break; - case SEARCHSET: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.SEARCHSET); - break; - case COLLECTION: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.COLLECTION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Bundle.BundleTypeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DOCUMENT: + tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.DOCUMENT); + break; + case MESSAGE: + tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.MESSAGE); + break; + case TRANSACTION: + tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.TRANSACTION); + break; + case TRANSACTIONRESPONSE: + tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.TRANSACTIONRESPONSE); + break; + case BATCH: + tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.BATCH); + break; + case BATCHRESPONSE: + tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.BATCHRESPONSE); + break; + case HISTORY: + tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.HISTORY); + break; + case SEARCHSET: + tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.SEARCHSET); + break; + case COLLECTION: + tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.COLLECTION); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertHTTPVerb(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Bundle.HTTPVerbEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case GET: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.HTTPVerb.GET); - break; - case POST: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.HTTPVerb.POST); - break; - case PUT: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.HTTPVerb.PUT); - break; - case DELETE: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.HTTPVerb.DELETE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.HTTPVerb.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Bundle.HTTPVerbEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case GET: + tgt.setValue(Bundle.HTTPVerb.GET); + break; + case POST: + tgt.setValue(Bundle.HTTPVerb.POST); + break; + case PUT: + tgt.setValue(Bundle.HTTPVerb.PUT); + break; + case DELETE: + tgt.setValue(Bundle.HTTPVerb.DELETE); + break; + default: + tgt.setValue(Bundle.HTTPVerb.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertHTTPVerb(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Bundle.HTTPVerbEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case GET: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.GET); - break; - case POST: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.POST); - break; - case PUT: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.PUT); - break; - case DELETE: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.DELETE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Bundle.HTTPVerbEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case GET: + tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.GET); + break; + case POST: + tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.POST); + break; + case PUT: + tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.PUT); + break; + case DELETE: + tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.DELETE); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertSearchEntryMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Bundle.SearchEntryModeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case MATCH: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.SearchEntryMode.MATCH); - break; - case INCLUDE: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.SearchEntryMode.INCLUDE); - break; - case OUTCOME: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.SearchEntryMode.OUTCOME); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.SearchEntryMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Bundle.SearchEntryModeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MATCH: + tgt.setValue(Bundle.SearchEntryMode.MATCH); + break; + case INCLUDE: + tgt.setValue(Bundle.SearchEntryMode.INCLUDE); + break; + case OUTCOME: + tgt.setValue(Bundle.SearchEntryMode.OUTCOME); + break; + default: + tgt.setValue(Bundle.SearchEntryMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertSearchEntryMode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Bundle.SearchEntryModeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case MATCH: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.SearchEntryMode.MATCH); - break; - case INCLUDE: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.SearchEntryMode.INCLUDE); - break; - case OUTCOME: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.SearchEntryMode.OUTCOME); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.SearchEntryMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Bundle.SearchEntryModeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MATCH: + tgt.setValue(org.hl7.fhir.r5.model.Bundle.SearchEntryMode.MATCH); + break; + case INCLUDE: + tgt.setValue(org.hl7.fhir.r5.model.Bundle.SearchEntryMode.INCLUDE); + break; + case OUTCOME: + tgt.setValue(org.hl7.fhir.r5.model.Bundle.SearchEntryMode.OUTCOME); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.Bundle.SearchEntryMode.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/CapabilityStatement30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/CapabilityStatement30_50.java index 2f8e62bd2e..6345d8b2c7 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/CapabilityStatement30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/CapabilityStatement30_50.java @@ -16,7 +16,10 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.UnsignedInt30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Uri30_50; +import org.hl7.fhir.dstu3.model.CapabilityStatement; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumerations; public class CapabilityStatement30_50 { @@ -212,47 +215,55 @@ public static org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementIm } static public org.hl7.fhir.dstu3.model.Enumeration convertCapabilityStatementKind(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementKindEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementKind.INSTANCE); - break; - case CAPABILITY: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementKind.CAPABILITY); - break; - case REQUIREMENTS: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementKind.REQUIREMENTS); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CapabilityStatement.CapabilityStatementKindEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(CapabilityStatement.CapabilityStatementKind.INSTANCE); + break; + case CAPABILITY: + tgt.setValue(CapabilityStatement.CapabilityStatementKind.CAPABILITY); + break; + case REQUIREMENTS: + tgt.setValue(CapabilityStatement.CapabilityStatementKind.REQUIREMENTS); + break; + default: + tgt.setValue(CapabilityStatement.CapabilityStatementKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertCapabilityStatementKind(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKindEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.INSTANCE); - break; - case CAPABILITY: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.CAPABILITY); - break; - case REQUIREMENTS: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.REQUIREMENTS); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new Enumerations.CapabilityStatementKindEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(Enumerations.CapabilityStatementKind.INSTANCE); + break; + case CAPABILITY: + tgt.setValue(Enumerations.CapabilityStatementKind.CAPABILITY); + break; + case REQUIREMENTS: + tgt.setValue(Enumerations.CapabilityStatementKind.REQUIREMENTS); + break; + default: + tgt.setValue(Enumerations.CapabilityStatementKind.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingComponent convertCapabilityStatementMessagingComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingComponent src) throws FHIRException { @@ -607,229 +618,269 @@ public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementSoftw } static public org.hl7.fhir.dstu3.model.Enumeration convertConditionalDeleteStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalDeleteStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalDeleteStatus.NOTSUPPORTED); - break; - case SINGLE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalDeleteStatus.SINGLE); - break; - case MULTIPLE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalDeleteStatus.MULTIPLE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalDeleteStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CapabilityStatement.ConditionalDeleteStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTSUPPORTED: + tgt.setValue(CapabilityStatement.ConditionalDeleteStatus.NOTSUPPORTED); + break; + case SINGLE: + tgt.setValue(CapabilityStatement.ConditionalDeleteStatus.SINGLE); + break; + case MULTIPLE: + tgt.setValue(CapabilityStatement.ConditionalDeleteStatus.MULTIPLE); + break; + default: + tgt.setValue(CapabilityStatement.ConditionalDeleteStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertConditionalDeleteStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus.NOTSUPPORTED); - break; - case SINGLE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus.SINGLE); - break; - case MULTIPLE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus.MULTIPLE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTSUPPORTED: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus.NOTSUPPORTED); + break; + case SINGLE: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus.SINGLE); + break; + case MULTIPLE: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus.MULTIPLE); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertConditionalReadStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalReadStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalReadStatus.NOTSUPPORTED); - break; - case MODIFIEDSINCE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalReadStatus.MODIFIEDSINCE); - break; - case NOTMATCH: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalReadStatus.NOTMATCH); - break; - case FULLSUPPORT: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalReadStatus.FULLSUPPORT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalReadStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CapabilityStatement.ConditionalReadStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTSUPPORTED: + tgt.setValue(CapabilityStatement.ConditionalReadStatus.NOTSUPPORTED); + break; + case MODIFIEDSINCE: + tgt.setValue(CapabilityStatement.ConditionalReadStatus.MODIFIEDSINCE); + break; + case NOTMATCH: + tgt.setValue(CapabilityStatement.ConditionalReadStatus.NOTMATCH); + break; + case FULLSUPPORT: + tgt.setValue(CapabilityStatement.ConditionalReadStatus.FULLSUPPORT); + break; + default: + tgt.setValue(CapabilityStatement.ConditionalReadStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertConditionalReadStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus.NOTSUPPORTED); - break; - case MODIFIEDSINCE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus.MODIFIEDSINCE); - break; - case NOTMATCH: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus.NOTMATCH); - break; - case FULLSUPPORT: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus.FULLSUPPORT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTSUPPORTED: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus.NOTSUPPORTED); + break; + case MODIFIEDSINCE: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus.MODIFIEDSINCE); + break; + case NOTMATCH: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus.NOTMATCH); + break; + case FULLSUPPORT: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus.FULLSUPPORT); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertDocumentMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.DocumentModeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PRODUCER: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.DocumentMode.PRODUCER); - break; - case CONSUMER: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.DocumentMode.CONSUMER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.DocumentMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CapabilityStatement.DocumentModeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRODUCER: + tgt.setValue(CapabilityStatement.DocumentMode.PRODUCER); + break; + case CONSUMER: + tgt.setValue(CapabilityStatement.DocumentMode.CONSUMER); + break; + default: + tgt.setValue(CapabilityStatement.DocumentMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertDocumentMode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.DocumentModeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PRODUCER: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.DocumentMode.PRODUCER); - break; - case CONSUMER: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.DocumentMode.CONSUMER); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.DocumentMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.DocumentModeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRODUCER: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.DocumentMode.PRODUCER); + break; + case CONSUMER: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.DocumentMode.CONSUMER); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.DocumentMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertEventCapabilityMode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityModeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case SENDER: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityMode.SENDER); - break; - case RECEIVER: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityMode.RECEIVER); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityModeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SENDER: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityMode.SENDER); + break; + case RECEIVER: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityMode.RECEIVER); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertEventCapabilityMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.EventCapabilityModeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case SENDER: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.EventCapabilityMode.SENDER); - break; - case RECEIVER: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.EventCapabilityMode.RECEIVER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.EventCapabilityMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CapabilityStatement.EventCapabilityModeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SENDER: + tgt.setValue(CapabilityStatement.EventCapabilityMode.SENDER); + break; + case RECEIVER: + tgt.setValue(CapabilityStatement.EventCapabilityMode.RECEIVER); + break; + default: + tgt.setValue(CapabilityStatement.EventCapabilityMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertReferenceHandlingPolicy(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.ReferenceHandlingPolicyEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case LITERAL: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ReferenceHandlingPolicy.LITERAL); - break; - case LOGICAL: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ReferenceHandlingPolicy.LOGICAL); - break; - case RESOLVES: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ReferenceHandlingPolicy.RESOLVES); - break; - case ENFORCED: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ReferenceHandlingPolicy.ENFORCED); - break; - case LOCAL: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ReferenceHandlingPolicy.LOCAL); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ReferenceHandlingPolicy.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CapabilityStatement.ReferenceHandlingPolicyEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case LITERAL: + tgt.setValue(CapabilityStatement.ReferenceHandlingPolicy.LITERAL); + break; + case LOGICAL: + tgt.setValue(CapabilityStatement.ReferenceHandlingPolicy.LOGICAL); + break; + case RESOLVES: + tgt.setValue(CapabilityStatement.ReferenceHandlingPolicy.RESOLVES); + break; + case ENFORCED: + tgt.setValue(CapabilityStatement.ReferenceHandlingPolicy.ENFORCED); + break; + case LOCAL: + tgt.setValue(CapabilityStatement.ReferenceHandlingPolicy.LOCAL); + break; + default: + tgt.setValue(CapabilityStatement.ReferenceHandlingPolicy.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertReferenceHandlingPolicy(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicyEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case LITERAL: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.LITERAL); - break; - case LOGICAL: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.LOGICAL); - break; - case RESOLVES: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.RESOLVES); - break; - case ENFORCED: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.ENFORCED); - break; - case LOCAL: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.LOCAL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicyEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case LITERAL: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.LITERAL); + break; + case LOGICAL: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.LOGICAL); + break; + case RESOLVES: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.RESOLVES); + break; + case ENFORCED: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.ENFORCED); + break; + case LOCAL: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.LOCAL); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.CapabilityStatement.ResourceInteractionComponent convertResourceInteractionComponent(org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceInteractionComponent src) throws FHIRException { @@ -857,85 +908,101 @@ public static org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceInteractionCo } static public org.hl7.fhir.r5.model.Enumeration convertResourceVersionPolicy(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicyEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case NOVERSION: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy.NOVERSION); - break; - case VERSIONED: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy.VERSIONED); - break; - case VERSIONEDUPDATE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy.VERSIONEDUPDATE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicyEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOVERSION: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy.NOVERSION); + break; + case VERSIONED: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy.VERSIONED); + break; + case VERSIONEDUPDATE: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy.VERSIONEDUPDATE); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertResourceVersionPolicy(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceVersionPolicyEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case NOVERSION: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceVersionPolicy.NOVERSION); - break; - case VERSIONED: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceVersionPolicy.VERSIONED); - break; - case VERSIONEDUPDATE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceVersionPolicy.VERSIONEDUPDATE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceVersionPolicy.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CapabilityStatement.ResourceVersionPolicyEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOVERSION: + tgt.setValue(CapabilityStatement.ResourceVersionPolicy.NOVERSION); + break; + case VERSIONED: + tgt.setValue(CapabilityStatement.ResourceVersionPolicy.VERSIONED); + break; + case VERSIONEDUPDATE: + tgt.setValue(CapabilityStatement.ResourceVersionPolicy.VERSIONEDUPDATE); + break; + default: + tgt.setValue(CapabilityStatement.ResourceVersionPolicy.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertRestfulCapabilityMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.RestfulCapabilityModeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case CLIENT: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.RestfulCapabilityMode.CLIENT); - break; - case SERVER: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.RestfulCapabilityMode.SERVER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.RestfulCapabilityMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CapabilityStatement.RestfulCapabilityModeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CLIENT: + tgt.setValue(CapabilityStatement.RestfulCapabilityMode.CLIENT); + break; + case SERVER: + tgt.setValue(CapabilityStatement.RestfulCapabilityMode.SERVER); + break; + default: + tgt.setValue(CapabilityStatement.RestfulCapabilityMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertRestfulCapabilityMode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.RestfulCapabilityModeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case CLIENT: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.RestfulCapabilityMode.CLIENT); - break; - case SERVER: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.RestfulCapabilityMode.SERVER); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.RestfulCapabilityMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.RestfulCapabilityModeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CLIENT: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.RestfulCapabilityMode.CLIENT); + break; + case SERVER: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.RestfulCapabilityMode.SERVER); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.RestfulCapabilityMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.CapabilityStatement.SystemInteractionComponent convertSystemInteractionComponent(org.hl7.fhir.r5.model.CapabilityStatement.SystemInteractionComponent src) throws FHIRException { @@ -963,132 +1030,148 @@ public static org.hl7.fhir.r5.model.CapabilityStatement.SystemInteractionCompone } static public org.hl7.fhir.r5.model.Enumeration convertSystemRestfulInteraction(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteractionEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case TRANSACTION: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.TRANSACTION); - break; - case BATCH: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.BATCH); - break; - case SEARCHSYSTEM: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.SEARCHSYSTEM); - break; - case HISTORYSYSTEM: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.HISTORYSYSTEM); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteractionEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case TRANSACTION: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.TRANSACTION); + break; + case BATCH: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.BATCH); + break; + case SEARCHSYSTEM: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.SEARCHSYSTEM); + break; + case HISTORYSYSTEM: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.HISTORYSYSTEM); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertSystemRestfulInteraction(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.SystemRestfulInteractionEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case TRANSACTION: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.SystemRestfulInteraction.TRANSACTION); - break; - case BATCH: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.SystemRestfulInteraction.BATCH); - break; - case SEARCHSYSTEM: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.SystemRestfulInteraction.SEARCHSYSTEM); - break; - case HISTORYSYSTEM: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.SystemRestfulInteraction.HISTORYSYSTEM); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.SystemRestfulInteraction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CapabilityStatement.SystemRestfulInteractionEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case TRANSACTION: + tgt.setValue(CapabilityStatement.SystemRestfulInteraction.TRANSACTION); + break; + case BATCH: + tgt.setValue(CapabilityStatement.SystemRestfulInteraction.BATCH); + break; + case SEARCHSYSTEM: + tgt.setValue(CapabilityStatement.SystemRestfulInteraction.SEARCHSYSTEM); + break; + case HISTORYSYSTEM: + tgt.setValue(CapabilityStatement.SystemRestfulInteraction.HISTORYSYSTEM); + break; + default: + tgt.setValue(CapabilityStatement.SystemRestfulInteraction.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertTypeRestfulInteraction(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteractionEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case READ: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.READ); - break; - case VREAD: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.VREAD); - break; - case UPDATE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.UPDATE); - break; - case PATCH: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.PATCH); - break; - case DELETE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.DELETE); - break; - case HISTORYINSTANCE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.HISTORYINSTANCE); - break; - case HISTORYTYPE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.HISTORYTYPE); - break; - case CREATE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.CREATE); - break; - case SEARCHTYPE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.SEARCHTYPE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteractionEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case READ: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.READ); + break; + case VREAD: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.VREAD); + break; + case UPDATE: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.UPDATE); + break; + case PATCH: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.PATCH); + break; + case DELETE: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.DELETE); + break; + case HISTORYINSTANCE: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.HISTORYINSTANCE); + break; + case HISTORYTYPE: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.HISTORYTYPE); + break; + case CREATE: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.CREATE); + break; + case SEARCHTYPE: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.SEARCHTYPE); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertTypeRestfulInteraction(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteractionEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case READ: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.READ); - break; - case VREAD: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.VREAD); - break; - case UPDATE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.UPDATE); - break; - case PATCH: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.PATCH); - break; - case DELETE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.DELETE); - break; - case HISTORYINSTANCE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.HISTORYINSTANCE); - break; - case HISTORYTYPE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.HISTORYTYPE); - break; - case CREATE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.CREATE); - break; - case SEARCHTYPE: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.SEARCHTYPE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CapabilityStatement.TypeRestfulInteractionEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case READ: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.READ); + break; + case VREAD: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.VREAD); + break; + case UPDATE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.UPDATE); + break; + case PATCH: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.PATCH); + break; + case DELETE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.DELETE); + break; + case HISTORYINSTANCE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.HISTORYINSTANCE); + break; + case HISTORYTYPE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.HISTORYTYPE); + break; + case CREATE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.CREATE); + break; + case SEARCHTYPE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.SEARCHTYPE); + break; + default: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/CarePlan30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/CarePlan30_50.java index 34f3164be7..ebfef7dd6d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/CarePlan30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/CarePlan30_50.java @@ -9,9 +9,12 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.Identifier30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.Period30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; +import org.hl7.fhir.dstu3.model.CarePlan; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.dstu3.model.Reference; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumerations; public class CarePlan30_50 { @@ -425,120 +428,136 @@ public static org.hl7.fhir.r5.model.CarePlan.CarePlanActivityComponent convertCa // } static public org.hl7.fhir.dstu3.model.Enumeration convertCarePlanIntent(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CarePlan.CarePlanIntentEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case OPTION: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanIntent.OPTION); - break; - case ORDER: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanIntent.ORDER); - break; - case PLAN: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanIntent.PLAN); - break; - case PROPOSAL: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanIntent.PROPOSAL); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanIntent.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CarePlan.CarePlanIntentEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OPTION: + tgt.setValue(CarePlan.CarePlanIntent.OPTION); + break; + case ORDER: + tgt.setValue(CarePlan.CarePlanIntent.ORDER); + break; + case PLAN: + tgt.setValue(CarePlan.CarePlanIntent.PLAN); + break; + case PROPOSAL: + tgt.setValue(CarePlan.CarePlanIntent.PROPOSAL); + break; + default: + tgt.setValue(CarePlan.CarePlanIntent.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertCarePlanIntent(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CarePlan.CarePlanIntentEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case OPTION: - tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.OPTION); - break; - case ORDER: - tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.ORDER); - break; - case PLAN: - tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.PLAN); - break; - case PROPOSAL: - tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.PROPOSAL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CarePlan.CarePlanIntentEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OPTION: + tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.OPTION); + break; + case ORDER: + tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.ORDER); + break; + case PLAN: + tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.PLAN); + break; + case PROPOSAL: + tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.PROPOSAL); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertCarePlanStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus.ACTIVE); - break; - case REVOKED: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus.CANCELLED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus.COMPLETED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus.ENTEREDINERROR); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus.SUSPENDED); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CarePlan.CarePlanStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(CarePlan.CarePlanStatus.ACTIVE); + break; + case REVOKED: + tgt.setValue(CarePlan.CarePlanStatus.CANCELLED); + break; + case COMPLETED: + tgt.setValue(CarePlan.CarePlanStatus.COMPLETED); + break; + case DRAFT: + tgt.setValue(CarePlan.CarePlanStatus.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(CarePlan.CarePlanStatus.ENTEREDINERROR); + break; + case ONHOLD: + tgt.setValue(CarePlan.CarePlanStatus.SUSPENDED); + break; + case UNKNOWN: + tgt.setValue(CarePlan.CarePlanStatus.UNKNOWN); + break; + default: + tgt.setValue(CarePlan.CarePlanStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertCarePlanStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.REVOKED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.COMPLETED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ENTEREDINERROR); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ONHOLD); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new Enumerations.RequestStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Enumerations.RequestStatus.ACTIVE); + break; + case CANCELLED: + tgt.setValue(Enumerations.RequestStatus.REVOKED); + break; + case COMPLETED: + tgt.setValue(Enumerations.RequestStatus.COMPLETED); + break; + case DRAFT: + tgt.setValue(Enumerations.RequestStatus.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.RequestStatus.ENTEREDINERROR); + break; + case SUSPENDED: + tgt.setValue(Enumerations.RequestStatus.ONHOLD); + break; + case UNKNOWN: + tgt.setValue(Enumerations.RequestStatus.UNKNOWN); + break; + default: + tgt.setValue(Enumerations.RequestStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/CareTeam30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/CareTeam30_50.java index e09eb410ac..4491c9a9a9 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/CareTeam30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/CareTeam30_50.java @@ -7,6 +7,8 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.Identifier30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.Period30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; +import org.hl7.fhir.dstu3.model.CareTeam; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; @@ -105,58 +107,66 @@ public static org.hl7.fhir.r5.model.CareTeam.CareTeamParticipantComponent conver } static public org.hl7.fhir.dstu3.model.Enumeration convertCareTeamStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CareTeam.CareTeamStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSED: - tgt.setValue(org.hl7.fhir.dstu3.model.CareTeam.CareTeamStatus.PROPOSED); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.CareTeam.CareTeamStatus.ACTIVE); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.dstu3.model.CareTeam.CareTeamStatus.SUSPENDED); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.CareTeam.CareTeamStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.CareTeam.CareTeamStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CareTeam.CareTeamStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CareTeam.CareTeamStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSED: + tgt.setValue(CareTeam.CareTeamStatus.PROPOSED); + break; + case ACTIVE: + tgt.setValue(CareTeam.CareTeamStatus.ACTIVE); + break; + case SUSPENDED: + tgt.setValue(CareTeam.CareTeamStatus.SUSPENDED); + break; + case INACTIVE: + tgt.setValue(CareTeam.CareTeamStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(CareTeam.CareTeamStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(CareTeam.CareTeamStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertCareTeamStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CareTeam.CareTeamStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSED: - tgt.setValue(org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.PROPOSED); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.ACTIVE); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.SUSPENDED); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CareTeam.CareTeamStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSED: + tgt.setValue(org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.PROPOSED); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.ACTIVE); + break; + case SUSPENDED: + tgt.setValue(org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.SUSPENDED); + break; + case INACTIVE: + tgt.setValue(org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/ClinicalImpression30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/ClinicalImpression30_50.java index 3e635a6cd9..279648fefe 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/ClinicalImpression30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/ClinicalImpression30_50.java @@ -7,7 +7,10 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.Identifier30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.DateTime30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; +import org.hl7.fhir.dstu3.model.ClinicalImpression; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumerations; public class ClinicalImpression30_50 { @@ -114,46 +117,54 @@ public static org.hl7.fhir.r5.model.ClinicalImpression.ClinicalImpressionFinding } static public org.hl7.fhir.dstu3.model.Enumeration convertClinicalImpressionStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionStatus.DRAFT); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ClinicalImpression.ClinicalImpressionStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(ClinicalImpression.ClinicalImpressionStatus.DRAFT); + break; + case COMPLETED: + tgt.setValue(ClinicalImpression.ClinicalImpressionStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(ClinicalImpression.ClinicalImpressionStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(ClinicalImpression.ClinicalImpressionStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertClinicalImpressionStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.EventStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new Enumerations.EventStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(Enumerations.EventStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(Enumerations.EventStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.EventStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Enumerations.EventStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/CodeSystem30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/CodeSystem30_50.java index a67139548d..51ea03f44f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/CodeSystem30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/CodeSystem30_50.java @@ -15,7 +15,10 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.UnsignedInt30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Uri30_50; +import org.hl7.fhir.dstu3.model.CodeSystem; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; public class CodeSystem30_50 { @@ -136,53 +139,61 @@ public static org.hl7.fhir.r5.model.CodeSystem convertCodeSystem(org.hl7.fhir.ds } static public org.hl7.fhir.r5.model.Enumeration convertCodeSystemContentMode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.CodeSystemContentModeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case NOTPRESENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CodeSystemContentMode.NOTPRESENT); - break; - case EXAMPLE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CodeSystemContentMode.EXAMPLE); - break; - case FRAGMENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CodeSystemContentMode.FRAGMENT); - break; - case COMPLETE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CodeSystemContentMode.COMPLETE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CodeSystemContentMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.CodeSystemContentModeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTPRESENT: + tgt.setValue(Enumerations.CodeSystemContentMode.NOTPRESENT); + break; + case EXAMPLE: + tgt.setValue(Enumerations.CodeSystemContentMode.EXAMPLE); + break; + case FRAGMENT: + tgt.setValue(Enumerations.CodeSystemContentMode.FRAGMENT); + break; + case COMPLETE: + tgt.setValue(Enumerations.CodeSystemContentMode.COMPLETE); + break; + default: + tgt.setValue(Enumerations.CodeSystemContentMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertCodeSystemContentMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemContentModeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case NOTPRESENT: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemContentMode.NOTPRESENT); - break; - case EXAMPLE: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemContentMode.EXAMPLE); - break; - case FRAGMENT: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemContentMode.FRAGMENT); - break; - case COMPLETE: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemContentMode.COMPLETE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemContentMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new CodeSystem.CodeSystemContentModeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTPRESENT: + tgt.setValue(CodeSystem.CodeSystemContentMode.NOTPRESENT); + break; + case EXAMPLE: + tgt.setValue(CodeSystem.CodeSystemContentMode.EXAMPLE); + break; + case FRAGMENT: + tgt.setValue(CodeSystem.CodeSystemContentMode.FRAGMENT); + break; + case COMPLETE: + tgt.setValue(CodeSystem.CodeSystemContentMode.COMPLETE); + break; + default: + tgt.setValue(CodeSystem.CodeSystemContentMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent convertCodeSystemFilterComponent(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemFilterComponent src) throws FHIRException { @@ -220,53 +231,61 @@ public static org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemFilterComponent conv } static public org.hl7.fhir.dstu3.model.Enumeration convertCodeSystemHierarchyMeaning(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemHierarchyMeaningEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case GROUPEDBY: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemHierarchyMeaning.GROUPEDBY); - break; - case ISA: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemHierarchyMeaning.ISA); - break; - case PARTOF: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemHierarchyMeaning.PARTOF); - break; - case CLASSIFIEDWITH: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemHierarchyMeaning.CLASSIFIEDWITH); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemHierarchyMeaning.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new CodeSystem.CodeSystemHierarchyMeaningEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case GROUPEDBY: + tgt.setValue(CodeSystem.CodeSystemHierarchyMeaning.GROUPEDBY); + break; + case ISA: + tgt.setValue(CodeSystem.CodeSystemHierarchyMeaning.ISA); + break; + case PARTOF: + tgt.setValue(CodeSystem.CodeSystemHierarchyMeaning.PARTOF); + break; + case CLASSIFIEDWITH: + tgt.setValue(CodeSystem.CodeSystemHierarchyMeaning.CLASSIFIEDWITH); + break; + default: + tgt.setValue(CodeSystem.CodeSystemHierarchyMeaning.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertCodeSystemHierarchyMeaning(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaningEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case GROUPEDBY: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.GROUPEDBY); - break; - case ISA: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.ISA); - break; - case PARTOF: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.PARTOF); - break; - case CLASSIFIEDWITH: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.CLASSIFIEDWITH); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaningEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case GROUPEDBY: + tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.GROUPEDBY); + break; + case ISA: + tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.ISA); + break; + case PARTOF: + tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.PARTOF); + break; + case CLASSIFIEDWITH: + tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.CLASSIFIEDWITH); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent convertConceptDefinitionComponent(org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent src) throws FHIRException { @@ -394,105 +413,117 @@ public static org.hl7.fhir.dstu3.model.CodeSystem.PropertyComponent convertPrope } static public org.hl7.fhir.dstu3.model.Enumeration convertPropertyType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CodeSystem.PropertyTypeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case CODE: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.PropertyType.CODE); - break; - case CODING: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.PropertyType.CODING); - break; - case STRING: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.PropertyType.STRING); - break; - case INTEGER: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.PropertyType.INTEGER); - break; - case BOOLEAN: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.PropertyType.BOOLEAN); - break; - case DATETIME: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.PropertyType.DATETIME); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.PropertyType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new CodeSystem.PropertyTypeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CODE: + tgt.setValue(CodeSystem.PropertyType.CODE); + break; + case CODING: + tgt.setValue(CodeSystem.PropertyType.CODING); + break; + case STRING: + tgt.setValue(CodeSystem.PropertyType.STRING); + break; + case INTEGER: + tgt.setValue(CodeSystem.PropertyType.INTEGER); + break; + case BOOLEAN: + tgt.setValue(CodeSystem.PropertyType.BOOLEAN); + break; + case DATETIME: + tgt.setValue(CodeSystem.PropertyType.DATETIME); + break; + default: + tgt.setValue(CodeSystem.PropertyType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertPropertyType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CodeSystem.PropertyTypeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case CODE: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.CODE); - break; - case CODING: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.CODING); - break; - case STRING: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.STRING); - break; - case INTEGER: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.INTEGER); - break; - case BOOLEAN: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.BOOLEAN); - break; - case DATETIME: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.DATETIME); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new org.hl7.fhir.r5.model.CodeSystem.PropertyTypeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CODE: + tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.CODE); + break; + case CODING: + tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.CODING); + break; + case STRING: + tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.STRING); + break; + case INTEGER: + tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.INTEGER); + break; + case BOOLEAN: + tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.BOOLEAN); + break; + case DATETIME: + tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.DATETIME); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertFilterOperator(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.FilterOperatorEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case EQUAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.EQUAL); - break; - case ISA: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.ISA); - break; - case DESCENDENTOF: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.DESCENDENTOF); - break; - case ISNOTA: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.ISNOTA); - break; - case REGEX: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.REGEX); - break; - case IN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.NOTIN); - break; - case GENERALIZES: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.GENERALIZES); - break; - case EXISTS: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.EXISTS); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.FilterOperatorEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUAL: + tgt.setValue(Enumerations.FilterOperator.EQUAL); + break; + case ISA: + tgt.setValue(Enumerations.FilterOperator.ISA); + break; + case DESCENDENTOF: + tgt.setValue(Enumerations.FilterOperator.DESCENDENTOF); + break; + case ISNOTA: + tgt.setValue(Enumerations.FilterOperator.ISNOTA); + break; + case REGEX: + tgt.setValue(Enumerations.FilterOperator.REGEX); + break; + case IN: + tgt.setValue(Enumerations.FilterOperator.IN); + break; + case NOTIN: + tgt.setValue(Enumerations.FilterOperator.NOTIN); + break; + case GENERALIZES: + tgt.setValue(Enumerations.FilterOperator.GENERALIZES); + break; + case EXISTS: + tgt.setValue(Enumerations.FilterOperator.EXISTS); + break; + default: + tgt.setValue(Enumerations.FilterOperator.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertFilterOperator(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { @@ -500,41 +531,41 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CodeSystem.FilterOperatorEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.FilterOperator.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case EQUAL: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.FilterOperator.EQUAL); - break; - case ISA: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.FilterOperator.ISA); - break; - case DESCENDENTOF: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.FilterOperator.DESCENDENTOF); - break; - case ISNOTA: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.FilterOperator.ISNOTA); - break; - case REGEX: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.FilterOperator.REGEX); - break; - case IN: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.FilterOperator.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.FilterOperator.NOTIN); - break; - case GENERALIZES: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.FilterOperator.GENERALIZES); - break; - case EXISTS: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.FilterOperator.EXISTS); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.FilterOperator.NULL); - break; - } - } + tgt.setValue(CodeSystem.FilterOperator.EQUAL); + break; + case ISA: + tgt.setValue(CodeSystem.FilterOperator.ISA); + break; + case DESCENDENTOF: + tgt.setValue(CodeSystem.FilterOperator.DESCENDENTOF); + break; + case ISNOTA: + tgt.setValue(CodeSystem.FilterOperator.ISNOTA); + break; + case REGEX: + tgt.setValue(CodeSystem.FilterOperator.REGEX); + break; + case IN: + tgt.setValue(CodeSystem.FilterOperator.IN); + break; + case NOTIN: + tgt.setValue(CodeSystem.FilterOperator.NOTIN); + break; + case GENERALIZES: + tgt.setValue(CodeSystem.FilterOperator.GENERALIZES); + break; + case EXISTS: + tgt.setValue(CodeSystem.FilterOperator.EXISTS); + break; + default: + tgt.setValue(CodeSystem.FilterOperator.NULL); + break; + } +} return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Communication30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Communication30_50.java index 6799d07dea..4e992fbef2 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Communication30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Communication30_50.java @@ -6,8 +6,11 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.CodeableConcept30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.Identifier30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.DateTime30_50; +import org.hl7.fhir.dstu3.model.Communication; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumerations; public class Communication30_50 { @@ -119,70 +122,78 @@ public static org.hl7.fhir.r5.model.Communication.CommunicationPayloadComponent } static public org.hl7.fhir.dstu3.model.Enumeration convertCommunicationStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Communication.CommunicationStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PREPARATION: - tgt.setValue(org.hl7.fhir.dstu3.model.Communication.CommunicationStatus.PREPARATION); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu3.model.Communication.CommunicationStatus.INPROGRESS); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.dstu3.model.Communication.CommunicationStatus.SUSPENDED); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.dstu3.model.Communication.CommunicationStatus.ABORTED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.Communication.CommunicationStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Communication.CommunicationStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu3.model.Communication.CommunicationStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Communication.CommunicationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Communication.CommunicationStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PREPARATION: + tgt.setValue(Communication.CommunicationStatus.PREPARATION); + break; + case INPROGRESS: + tgt.setValue(Communication.CommunicationStatus.INPROGRESS); + break; + case ONHOLD: + tgt.setValue(Communication.CommunicationStatus.SUSPENDED); + break; + case STOPPED: + tgt.setValue(Communication.CommunicationStatus.ABORTED); + break; + case COMPLETED: + tgt.setValue(Communication.CommunicationStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(Communication.CommunicationStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Communication.CommunicationStatus.UNKNOWN); + break; + default: + tgt.setValue(Communication.CommunicationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertCommunicationStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.EventStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PREPARATION: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.PREPARATION); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.INPROGRESS); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.ONHOLD); - break; - case ABORTED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.STOPPED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new Enumerations.EventStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PREPARATION: + tgt.setValue(Enumerations.EventStatus.PREPARATION); + break; + case INPROGRESS: + tgt.setValue(Enumerations.EventStatus.INPROGRESS); + break; + case SUSPENDED: + tgt.setValue(Enumerations.EventStatus.ONHOLD); + break; + case ABORTED: + tgt.setValue(Enumerations.EventStatus.STOPPED); + break; + case COMPLETED: + tgt.setValue(Enumerations.EventStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.EventStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Enumerations.EventStatus.UNKNOWN); + break; + default: + tgt.setValue(Enumerations.EventStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/CompartmentDefinition30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/CompartmentDefinition30_50.java index 23fbdfa0c6..a46247a0f9 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/CompartmentDefinition30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/CompartmentDefinition30_50.java @@ -9,7 +9,10 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.MarkDown30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Uri30_50; +import org.hl7.fhir.dstu3.model.CompartmentDefinition; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumerations; public class CompartmentDefinition30_50 { @@ -112,58 +115,66 @@ public static org.hl7.fhir.dstu3.model.CompartmentDefinition.CompartmentDefiniti } static public org.hl7.fhir.dstu3.model.Enumeration convertCompartmentType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CompartmentDefinition.CompartmentTypeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PATIENT: - tgt.setValue(org.hl7.fhir.dstu3.model.CompartmentDefinition.CompartmentType.PATIENT); - break; - case ENCOUNTER: - tgt.setValue(org.hl7.fhir.dstu3.model.CompartmentDefinition.CompartmentType.ENCOUNTER); - break; - case RELATEDPERSON: - tgt.setValue(org.hl7.fhir.dstu3.model.CompartmentDefinition.CompartmentType.RELATEDPERSON); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.dstu3.model.CompartmentDefinition.CompartmentType.PRACTITIONER); - break; - case DEVICE: - tgt.setValue(org.hl7.fhir.dstu3.model.CompartmentDefinition.CompartmentType.DEVICE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.CompartmentDefinition.CompartmentType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CompartmentDefinition.CompartmentTypeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PATIENT: + tgt.setValue(CompartmentDefinition.CompartmentType.PATIENT); + break; + case ENCOUNTER: + tgt.setValue(CompartmentDefinition.CompartmentType.ENCOUNTER); + break; + case RELATEDPERSON: + tgt.setValue(CompartmentDefinition.CompartmentType.RELATEDPERSON); + break; + case PRACTITIONER: + tgt.setValue(CompartmentDefinition.CompartmentType.PRACTITIONER); + break; + case DEVICE: + tgt.setValue(CompartmentDefinition.CompartmentType.DEVICE); + break; + default: + tgt.setValue(CompartmentDefinition.CompartmentType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertCompartmentType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.CompartmentTypeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PATIENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.PATIENT); - break; - case ENCOUNTER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.ENCOUNTER); - break; - case RELATEDPERSON: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.RELATEDPERSON); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.PRACTITIONER); - break; - case DEVICE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.DEVICE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new Enumerations.CompartmentTypeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PATIENT: + tgt.setValue(Enumerations.CompartmentType.PATIENT); + break; + case ENCOUNTER: + tgt.setValue(Enumerations.CompartmentType.ENCOUNTER); + break; + case RELATEDPERSON: + tgt.setValue(Enumerations.CompartmentType.RELATEDPERSON); + break; + case PRACTITIONER: + tgt.setValue(Enumerations.CompartmentType.PRACTITIONER); + break; + case DEVICE: + tgt.setValue(Enumerations.CompartmentType.DEVICE); + break; + default: + tgt.setValue(Enumerations.CompartmentType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Composition30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Composition30_50.java index a8b52450d9..94d124f604 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Composition30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Composition30_50.java @@ -10,8 +10,12 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.Period30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.DateTime30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; +import org.hl7.fhir.dstu3.model.Composition; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.CodeableConcept; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumerations; import org.hl7.fhir.r5.model.RelatedArtifact; public class Composition30_50 { @@ -117,27 +121,31 @@ static public org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.CodeableConcept tgt = new org.hl7.fhir.r5.model.CodeableConcept(); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PERSONAL: - tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("personal"); - break; - case PROFESSIONAL: - tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("professional"); - break; - case LEGAL: - tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("legal"); - break; - case OFFICIAL: - tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("official"); - break; - default: - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + CodeableConcept tgt = new CodeableConcept(); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + // Add nothing + } else { + switch (src.getValue()) { + case PERSONAL: + tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("personal"); + break; + case PROFESSIONAL: + tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("professional"); + break; + case LEGAL: + tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("legal"); + break; + case OFFICIAL: + tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("official"); + break; + default: + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Composition.CompositionAttesterComponent convertCompositionAttesterComponent(org.hl7.fhir.dstu3.model.Composition.CompositionAttesterComponent src) throws FHIRException { @@ -224,103 +232,119 @@ public static org.hl7.fhir.r5.model.RelatedArtifact convertCompositionRelatesToC } static public org.hl7.fhir.dstu3.model.Enumeration convertDocumentRelationshipType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Composition.DocumentRelationshipTypeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case REPLACES: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.DocumentRelationshipType.REPLACES); - break; - case TRANSFORMS: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.DocumentRelationshipType.TRANSFORMS); - break; - case SIGNS: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.DocumentRelationshipType.SIGNS); - break; - case APPENDS: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.DocumentRelationshipType.APPENDS); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.DocumentRelationshipType.NULL); - break; - } - return tgt; + if (src == null) + return null; + Enumeration tgt = new Enumeration<>(new Composition.DocumentRelationshipTypeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REPLACES: + tgt.setValue(Composition.DocumentRelationshipType.REPLACES); + break; + case TRANSFORMS: + tgt.setValue(Composition.DocumentRelationshipType.TRANSFORMS); + break; + case SIGNS: + tgt.setValue(Composition.DocumentRelationshipType.SIGNS); + break; + case APPENDS: + tgt.setValue(Composition.DocumentRelationshipType.APPENDS); + break; + default: + tgt.setValue(Composition.DocumentRelationshipType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertDocumentRelationshipType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactTypeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case REPLACES: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.REPLACES); - break; - case TRANSFORMS: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.TRANSFORMS); - break; - case SIGNS: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.SIGNS); - break; - case APPENDS: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.APPENDS); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.NULL); - break; - } - return tgt; + if (src == null) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new RelatedArtifact.RelatedArtifactTypeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REPLACES: + tgt.setValue(RelatedArtifact.RelatedArtifactType.REPLACES); + break; + case TRANSFORMS: + tgt.setValue(RelatedArtifact.RelatedArtifactType.TRANSFORMS); + break; + case SIGNS: + tgt.setValue(RelatedArtifact.RelatedArtifactType.SIGNS); + break; + case APPENDS: + tgt.setValue(RelatedArtifact.RelatedArtifactType.APPENDS); + break; + default: + tgt.setValue(RelatedArtifact.RelatedArtifactType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertCompositionStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Composition.CompositionStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionStatus.AMENDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Composition.CompositionStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRELIMINARY: + tgt.setValue(Composition.CompositionStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(Composition.CompositionStatus.FINAL); + break; + case AMENDED: + tgt.setValue(Composition.CompositionStatus.AMENDED); + break; + case ENTEREDINERROR: + tgt.setValue(Composition.CompositionStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Composition.CompositionStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertCompositionStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.CompositionStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.AMENDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new Enumerations.CompositionStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRELIMINARY: + tgt.setValue(Enumerations.CompositionStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(Enumerations.CompositionStatus.FINAL); + break; + case AMENDED: + tgt.setValue(Enumerations.CompositionStatus.AMENDED); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.CompositionStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Enumerations.CompositionStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Coding convertDocumentConfidentiality(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { @@ -410,46 +434,54 @@ public static org.hl7.fhir.r5.model.Composition.SectionComponent convertSectionC } static public org.hl7.fhir.dstu3.model.Enumeration convertSectionMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Composition.SectionModeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case WORKING: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.SectionMode.WORKING); - break; - case SNAPSHOT: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.SectionMode.SNAPSHOT); - break; - case CHANGES: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.SectionMode.CHANGES); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Composition.SectionMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Composition.SectionModeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case WORKING: + tgt.setValue(Composition.SectionMode.WORKING); + break; + case SNAPSHOT: + tgt.setValue(Composition.SectionMode.SNAPSHOT); + break; + case CHANGES: + tgt.setValue(Composition.SectionMode.CHANGES); + break; + default: + tgt.setValue(Composition.SectionMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertSectionMode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ListModeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case WORKING: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ListMode.WORKING); - break; - case SNAPSHOT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ListMode.SNAPSHOT); - break; - case CHANGES: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ListMode.CHANGES); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ListMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new Enumerations.ListModeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case WORKING: + tgt.setValue(Enumerations.ListMode.WORKING); + break; + case SNAPSHOT: + tgt.setValue(Enumerations.ListMode.SNAPSHOT); + break; + case CHANGES: + tgt.setValue(Enumerations.ListMode.CHANGES); + break; + default: + tgt.setValue(Enumerations.ListMode.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/ConceptMap30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/ConceptMap30_50.java index 7ac2b7daff..8fa631937e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/ConceptMap30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/ConceptMap30_50.java @@ -14,10 +14,7 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Uri30_50; import org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence; import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.r5.model.CanonicalType; -import org.hl7.fhir.r5.model.Coding; -import org.hl7.fhir.r5.model.Enumeration; -import org.hl7.fhir.r5.model.Enumerations; +import org.hl7.fhir.r5.model.*; import org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship; import org.hl7.fhir.r5.utils.ToolingExtensions; import org.hl7.fhir.utilities.CanonicalPair; @@ -204,47 +201,55 @@ public static org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedCompone } static public org.hl7.fhir.r5.model.Enumeration convertConceptMapGroupUnmappedMode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedModeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROVIDED: - tgt.setValue(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode.USESOURCECODE); - break; - case FIXED: - tgt.setValue(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode.FIXED); - break; - case OTHERMAP: - tgt.setValue(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode.OTHERMAP); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ConceptMap.ConceptMapGroupUnmappedModeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROVIDED: + tgt.setValue(ConceptMap.ConceptMapGroupUnmappedMode.USESOURCECODE); + break; + case FIXED: + tgt.setValue(ConceptMap.ConceptMapGroupUnmappedMode.FIXED); + break; + case OTHERMAP: + tgt.setValue(ConceptMap.ConceptMapGroupUnmappedMode.OTHERMAP); + break; + default: + tgt.setValue(ConceptMap.ConceptMapGroupUnmappedMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertConceptMapGroupUnmappedMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedModeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case USESOURCECODE: - tgt.setValue(org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedMode.PROVIDED); - break; - case FIXED: - tgt.setValue(org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedMode.FIXED); - break; - case OTHERMAP: - tgt.setValue(org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedMode.OTHERMAP); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedModeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case USESOURCECODE: + tgt.setValue(org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedMode.PROVIDED); + break; + case FIXED: + tgt.setValue(org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedMode.FIXED); + break; + case OTHERMAP: + tgt.setValue(org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedMode.OTHERMAP); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.Enumeration convertConceptMapEquivalence(Enumeration src, org.hl7.fhir.r5.model.ConceptMap.TargetElementComponent ccm) throws FHIRException { @@ -255,72 +260,80 @@ public static org.hl7.fhir.dstu3.model.Enumeration conver if (ccm.hasExtension(VersionConvertorConstants.EXT_OLD_CONCEPTMAP_EQUIVALENCE)) { tgt.setValueAsString(ccm.getExtensionString(VersionConvertorConstants.EXT_OLD_CONCEPTMAP_EQUIVALENCE)); } else { - switch (src.getValue()) { - case EQUIVALENT: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.EQUIVALENT); - break; - case SOURCEISNARROWERTHANTARGET: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.WIDER); - break; - case SOURCEISBROADERTHANTARGET: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.NARROWER); - break; - case NOTRELATEDTO: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.DISJOINT); - break; - case RELATEDTO: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.RELATEDTO); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.NULL); - break; - } + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUIVALENT: + tgt.setValue(ConceptMapEquivalence.EQUIVALENT); + break; + case SOURCEISNARROWERTHANTARGET: + tgt.setValue(ConceptMapEquivalence.WIDER); + break; + case SOURCEISBROADERTHANTARGET: + tgt.setValue(ConceptMapEquivalence.NARROWER); + break; + case NOTRELATEDTO: + tgt.setValue(ConceptMapEquivalence.DISJOINT); + break; + case RELATEDTO: + tgt.setValue(ConceptMapEquivalence.RELATEDTO); + break; + default: + tgt.setValue(ConceptMapEquivalence.NULL); + break; + } + } } return tgt; } public static Enumeration convertConceptMapRelationship(org.hl7.fhir.dstu3.model.Enumeration src, org.hl7.fhir.r5.model.ConceptMap.TargetElementComponent tgtCtxt) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - Enumeration tgt = new Enumeration(new Enumerations.ConceptMapRelationshipEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - ToolingExtensions.setCodeExtensionMod(tgtCtxt, VersionConvertorConstants.EXT_OLD_CONCEPTMAP_EQUIVALENCE, src.getValueAsString()); - switch (src.getValue()) { - case EQUIVALENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.EQUIVALENT); - break; - case EQUAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.EQUIVALENT); - break; - case WIDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.SOURCEISNARROWERTHANTARGET); - break; - case SUBSUMES: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.SOURCEISNARROWERTHANTARGET); - break; - case NARROWER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.SOURCEISBROADERTHANTARGET); - break; - case SPECIALIZES: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.SOURCEISBROADERTHANTARGET); - break; - case INEXACT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.RELATEDTO); - break; - case UNMATCHED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NULL); - break; - case DISJOINT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NOTRELATEDTO); - break; - case RELATEDTO: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.RELATEDTO); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration(new Enumerations.ConceptMapRelationshipEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + ToolingExtensions.setCodeExtensionMod(tgtCtxt, VersionConvertorConstants.EXT_OLD_CONCEPTMAP_EQUIVALENCE, src.getValueAsString()); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUIVALENT: + tgt.setValue(ConceptMapRelationship.EQUIVALENT); + break; + case EQUAL: + tgt.setValue(ConceptMapRelationship.EQUIVALENT); + break; + case WIDER: + tgt.setValue(ConceptMapRelationship.SOURCEISNARROWERTHANTARGET); + break; + case SUBSUMES: + tgt.setValue(ConceptMapRelationship.SOURCEISNARROWERTHANTARGET); + break; + case NARROWER: + tgt.setValue(ConceptMapRelationship.SOURCEISBROADERTHANTARGET); + break; + case SPECIALIZES: + tgt.setValue(ConceptMapRelationship.SOURCEISBROADERTHANTARGET); + break; + case INEXACT: + tgt.setValue(ConceptMapRelationship.RELATEDTO); + break; + case UNMATCHED: + tgt.setValue(ConceptMapRelationship.NULL); + break; + case DISJOINT: + tgt.setValue(ConceptMapRelationship.NOTRELATEDTO); + break; + case RELATEDTO: + tgt.setValue(ConceptMapRelationship.RELATEDTO); + break; + default: + tgt.setValue(ConceptMapRelationship.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent convertOtherElementComponent(org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent src, org.hl7.fhir.r5.model.ConceptMap tgtMap) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/DetectedIssue30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/DetectedIssue30_50.java index c874124fac..166cd8f30d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/DetectedIssue30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/DetectedIssue30_50.java @@ -7,6 +7,8 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.DateTime30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Uri30_50; +import org.hl7.fhir.dstu3.model.DetectedIssue; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; public class DetectedIssue30_50 { @@ -99,108 +101,124 @@ public static org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueMitigationCompone } static public org.hl7.fhir.dstu3.model.Enumeration convertDetectedIssueSeverity(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueSeverityEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case HIGH: - tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueSeverity.HIGH); - break; - case MODERATE: - tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueSeverity.MODERATE); - break; - case LOW: - tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueSeverity.LOW); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueSeverity.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DetectedIssue.DetectedIssueSeverityEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case HIGH: + tgt.setValue(DetectedIssue.DetectedIssueSeverity.HIGH); + break; + case MODERATE: + tgt.setValue(DetectedIssue.DetectedIssueSeverity.MODERATE); + break; + case LOW: + tgt.setValue(DetectedIssue.DetectedIssueSeverity.LOW); + break; + default: + tgt.setValue(DetectedIssue.DetectedIssueSeverity.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertDetectedIssueSeverity(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverityEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case HIGH: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity.HIGH); - break; - case MODERATE: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity.MODERATE); - break; - case LOW: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity.LOW); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverityEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case HIGH: + tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity.HIGH); + break; + case MODERATE: + tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity.MODERATE); + break; + case LOW: + tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity.LOW); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertDetectedIssueStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.PRELIMINARY); - break; - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.FINAL); - break; - case CORRECTED: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.MITIGATED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.MITIGATED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.NULL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.PRELIMINARY); + break; + case PRELIMINARY: + tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.FINAL); + break; + case AMENDED: + tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.FINAL); + break; + case CORRECTED: + tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.MITIGATED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.MITIGATED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.NULL); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertDetectedIssueStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueStatus.FINAL); - break; - case MITIGATED: - tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueStatus.CORRECTED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DetectedIssue.DetectedIssueStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRELIMINARY: + tgt.setValue(DetectedIssue.DetectedIssueStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(DetectedIssue.DetectedIssueStatus.FINAL); + break; + case MITIGATED: + tgt.setValue(DetectedIssue.DetectedIssueStatus.CORRECTED); + break; + case ENTEREDINERROR: + tgt.setValue(DetectedIssue.DetectedIssueStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(DetectedIssue.DetectedIssueStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/DeviceUseStatement30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/DeviceUseStatement30_50.java index 3c7160d9ff..a1822d0013 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/DeviceUseStatement30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/DeviceUseStatement30_50.java @@ -6,8 +6,11 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.CodeableConcept30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.Identifier30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.DateTime30_50; +import org.hl7.fhir.dstu3.model.DeviceUseStatement; +import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.DeviceUsage; public class DeviceUseStatement30_50 { @@ -67,64 +70,72 @@ public static org.hl7.fhir.r5.model.DeviceUsage convertDeviceUseStatement(org.hl } static public org.hl7.fhir.dstu3.model.Enumeration convertDeviceUseStatementStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DeviceUseStatement.DeviceUseStatementStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceUseStatement.DeviceUseStatementStatus.ACTIVE); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceUseStatement.DeviceUseStatementStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceUseStatement.DeviceUseStatementStatus.ENTEREDINERROR); - break; - case INTENDED: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceUseStatement.DeviceUseStatementStatus.INTENDED); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceUseStatement.DeviceUseStatementStatus.STOPPED); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceUseStatement.DeviceUseStatementStatus.ONHOLD); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.DeviceUseStatement.DeviceUseStatementStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DeviceUseStatement.DeviceUseStatementStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(DeviceUseStatement.DeviceUseStatementStatus.ACTIVE); + break; + case COMPLETED: + tgt.setValue(DeviceUseStatement.DeviceUseStatementStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(DeviceUseStatement.DeviceUseStatementStatus.ENTEREDINERROR); + break; + case INTENDED: + tgt.setValue(DeviceUseStatement.DeviceUseStatementStatus.INTENDED); + break; + case STOPPED: + tgt.setValue(DeviceUseStatement.DeviceUseStatementStatus.STOPPED); + break; + case ONHOLD: + tgt.setValue(DeviceUseStatement.DeviceUseStatementStatus.ONHOLD); + break; + default: + tgt.setValue(DeviceUseStatement.DeviceUseStatementStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertDeviceUseStatementStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DeviceUsage.DeviceUsageStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.DeviceUsage.DeviceUsageStatus.ACTIVE); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.DeviceUsage.DeviceUsageStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.DeviceUsage.DeviceUsageStatus.ENTEREDINERROR); - break; - case INTENDED: - tgt.setValue(org.hl7.fhir.r5.model.DeviceUsage.DeviceUsageStatus.INTENDED); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r5.model.DeviceUsage.DeviceUsageStatus.STOPPED); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r5.model.DeviceUsage.DeviceUsageStatus.ONHOLD); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.DeviceUsage.DeviceUsageStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new DeviceUsage.DeviceUsageStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(DeviceUsage.DeviceUsageStatus.ACTIVE); + break; + case COMPLETED: + tgt.setValue(DeviceUsage.DeviceUsageStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(DeviceUsage.DeviceUsageStatus.ENTEREDINERROR); + break; + case INTENDED: + tgt.setValue(DeviceUsage.DeviceUsageStatus.INTENDED); + break; + case STOPPED: + tgt.setValue(DeviceUsage.DeviceUsageStatus.STOPPED); + break; + case ONHOLD: + tgt.setValue(DeviceUsage.DeviceUsageStatus.ONHOLD); + break; + default: + tgt.setValue(DeviceUsage.DeviceUsageStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/DiagnosticReport30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/DiagnosticReport30_50.java index 99109c16cd..d527f899f8 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/DiagnosticReport30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/DiagnosticReport30_50.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Instant30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.DiagnosticReport; +import org.hl7.fhir.r5.model.Enumeration; public class DiagnosticReport30_50 { @@ -106,88 +108,96 @@ public static org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportMediaCompon } static public org.hl7.fhir.r5.model.Enumeration convertDiagnosticReportStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.REGISTERED); - break; - case PARTIAL: - tgt.setValue(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.PARTIAL); - break; - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.AMENDED); - break; - case CORRECTED: - tgt.setValue(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.CORRECTED); - break; - case APPENDED: - tgt.setValue(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.APPENDED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DiagnosticReport.DiagnosticReportStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.REGISTERED); + break; + case PARTIAL: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.PARTIAL); + break; + case PRELIMINARY: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.FINAL); + break; + case AMENDED: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.AMENDED); + break; + case CORRECTED: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.CORRECTED); + break; + case APPENDED: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.APPENDED); + break; + case CANCELLED: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.UNKNOWN); + break; + default: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertDiagnosticReportStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.REGISTERED); - break; - case PARTIAL: - tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.PARTIAL); - break; - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.AMENDED); - break; - case CORRECTED: - tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.CORRECTED); - break; - case APPENDED: - tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.APPENDED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.REGISTERED); + break; + case PARTIAL: + tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.PARTIAL); + break; + case PRELIMINARY: + tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.FINAL); + break; + case AMENDED: + tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.AMENDED); + break; + case CORRECTED: + tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.CORRECTED); + break; + case APPENDED: + tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.APPENDED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/DocumentReference30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/DocumentReference30_50.java index d8ca4b646f..96359a0bf3 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/DocumentReference30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/DocumentReference30_50.java @@ -7,8 +7,11 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.Identifier30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.Period30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.Enumerations; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.DocumentReference; import org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceAttesterComponent; public class DocumentReference30_50 { @@ -196,47 +199,55 @@ public static org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceRelate } static public org.hl7.fhir.dstu3.model.Enumeration convertDocumentReferenceStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case CURRENT: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatus.CURRENT); - break; - case SUPERSEDED: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatus.SUPERSEDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.DocumentReferenceStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CURRENT: + tgt.setValue(Enumerations.DocumentReferenceStatus.CURRENT); + break; + case SUPERSEDED: + tgt.setValue(Enumerations.DocumentReferenceStatus.SUPERSEDED); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.DocumentReferenceStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Enumerations.DocumentReferenceStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertDocumentReferenceStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case CURRENT: - tgt.setValue(org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceStatus.CURRENT); - break; - case SUPERSEDED: - tgt.setValue(org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceStatus.SUPERSEDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new DocumentReference.DocumentReferenceStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CURRENT: + tgt.setValue(DocumentReference.DocumentReferenceStatus.CURRENT); + break; + case SUPERSEDED: + tgt.setValue(DocumentReference.DocumentReferenceStatus.SUPERSEDED); + break; + case ENTEREDINERROR: + tgt.setValue(DocumentReference.DocumentReferenceStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(DocumentReference.DocumentReferenceStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertDocumentRelationshipType2(org.hl7.fhir.r5.model.CodeableConcept src) throws FHIRException { @@ -266,53 +277,61 @@ static public org.hl7.fhir.dstu3.model.Enumeration convertReferredDocumentStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatus.AMENDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRELIMINARY: + tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatus.FINAL); + break; + case AMENDED: + tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatus.AMENDED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertReferredDocumentStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.CompositionStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.AMENDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.CompositionStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRELIMINARY: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.FINAL); + break; + case AMENDED: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.AMENDED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.CodeableConcept convertDocumentRelationshipType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { @@ -321,22 +340,26 @@ static public org.hl7.fhir.r5.model.CodeableConcept convertDocumentRelationshipT ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { } else { - switch (src.getValue()) { - case REPLACES: - tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("replaces"); - break; - case TRANSFORMS: - tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("transforms"); - break; - case SIGNS: - tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("signs"); - break; - case APPENDS: - tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("appends"); - break; - default: - break; - } + if (src.getValue() == null) { + // Add nothing + } else { + switch (src.getValue()) { + case REPLACES: + tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("replaces"); + break; + case TRANSFORMS: + tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("transforms"); + break; + case SIGNS: + tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("signs"); + break; + case APPENDS: + tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("appends"); + break; + default: + break; + } + } } return tgt; diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Encounter30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Encounter30_50.java index 1044c321f2..bc28be75c8 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Encounter30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Encounter30_50.java @@ -9,7 +9,10 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.Period30_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Encounter; import org.hl7.fhir.r5.model.Encounter.ReasonComponent; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; public class Encounter30_50 { @@ -218,53 +221,61 @@ public static org.hl7.fhir.r5.model.Encounter.EncounterLocationComponent convert } static public org.hl7.fhir.r5.model.Enumeration convertEncounterLocationStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Encounter.EncounterLocationStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.PLANNED); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.ACTIVE); - break; - case RESERVED: - tgt.setValue(org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.RESERVED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.COMPLETED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Encounter.EncounterLocationStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(Encounter.EncounterLocationStatus.PLANNED); + break; + case ACTIVE: + tgt.setValue(Encounter.EncounterLocationStatus.ACTIVE); + break; + case RESERVED: + tgt.setValue(Encounter.EncounterLocationStatus.RESERVED); + break; + case COMPLETED: + tgt.setValue(Encounter.EncounterLocationStatus.COMPLETED); + break; + default: + tgt.setValue(Encounter.EncounterLocationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertEncounterLocationStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Encounter.EncounterLocationStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterLocationStatus.PLANNED); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterLocationStatus.ACTIVE); - break; - case RESERVED: - tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterLocationStatus.RESERVED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterLocationStatus.COMPLETED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterLocationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Encounter.EncounterLocationStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterLocationStatus.PLANNED); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterLocationStatus.ACTIVE); + break; + case RESERVED: + tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterLocationStatus.RESERVED); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterLocationStatus.COMPLETED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterLocationStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.Encounter.EncounterParticipantComponent convertEncounterParticipantComponent(org.hl7.fhir.r5.model.Encounter.EncounterParticipantComponent src) throws FHIRException { @@ -296,74 +307,82 @@ public static org.hl7.fhir.r5.model.Encounter.EncounterParticipantComponent conv } static public org.hl7.fhir.dstu3.model.Enumeration convertEncounterStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Encounter.EncounterStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterStatus.PLANNED); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterStatus.FINISHED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Encounter.EncounterStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterStatus.PLANNED); + break; + case INPROGRESS: + tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterStatus.FINISHED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Encounter.EncounterStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertEncounterStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.EncounterStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EncounterStatus.PLANNED); - break; - case ARRIVED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EncounterStatus.INPROGRESS); - break; - case TRIAGED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EncounterStatus.INPROGRESS); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EncounterStatus.INPROGRESS); - break; - case ONLEAVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EncounterStatus.INPROGRESS); - break; - case FINISHED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EncounterStatus.COMPLETED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EncounterStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EncounterStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EncounterStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EncounterStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.EncounterStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(Enumerations.EncounterStatus.PLANNED); + break; + case ARRIVED: + tgt.setValue(Enumerations.EncounterStatus.INPROGRESS); + break; + case TRIAGED: + tgt.setValue(Enumerations.EncounterStatus.INPROGRESS); + break; + case INPROGRESS: + tgt.setValue(Enumerations.EncounterStatus.INPROGRESS); + break; + case ONLEAVE: + tgt.setValue(Enumerations.EncounterStatus.INPROGRESS); + break; + case FINISHED: + tgt.setValue(Enumerations.EncounterStatus.COMPLETED); + break; + case CANCELLED: + tgt.setValue(Enumerations.EncounterStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.EncounterStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Enumerations.EncounterStatus.UNKNOWN); + break; + default: + tgt.setValue(Enumerations.EncounterStatus.NULL); + break; + } + } + return tgt; } // public static org.hl7.fhir.r5.model.Encounter.StatusHistoryComponent convertStatusHistoryComponent(org.hl7.fhir.dstu3.model.Encounter.StatusHistoryComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Endpoint30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Endpoint30_50.java index 5727410830..da93332abd 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Endpoint30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Endpoint30_50.java @@ -10,7 +10,9 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Code30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Endpoint; import org.hl7.fhir.r5.model.Endpoint.EndpointPayloadComponent; +import org.hl7.fhir.r5.model.Enumeration; public class Endpoint30_50 { @@ -74,58 +76,66 @@ public static org.hl7.fhir.r5.model.Endpoint convertEndpoint(org.hl7.fhir.dstu3. } static public org.hl7.fhir.r5.model.Enumeration convertEndpointStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Endpoint.EndpointStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Endpoint.EndpointStatus.ACTIVE); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.r5.model.Endpoint.EndpointStatus.SUSPENDED); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.r5.model.Endpoint.EndpointStatus.ERROR); - break; - case OFF: - tgt.setValue(org.hl7.fhir.r5.model.Endpoint.EndpointStatus.OFF); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Endpoint.EndpointStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Endpoint.EndpointStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Endpoint.EndpointStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Endpoint.EndpointStatus.ACTIVE); + break; + case SUSPENDED: + tgt.setValue(Endpoint.EndpointStatus.SUSPENDED); + break; + case ERROR: + tgt.setValue(Endpoint.EndpointStatus.ERROR); + break; + case OFF: + tgt.setValue(Endpoint.EndpointStatus.OFF); + break; + case ENTEREDINERROR: + tgt.setValue(Endpoint.EndpointStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Endpoint.EndpointStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertEndpointStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Endpoint.EndpointStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Endpoint.EndpointStatus.ACTIVE); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.dstu3.model.Endpoint.EndpointStatus.SUSPENDED); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Endpoint.EndpointStatus.ERROR); - break; - case OFF: - tgt.setValue(org.hl7.fhir.dstu3.model.Endpoint.EndpointStatus.OFF); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Endpoint.EndpointStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Endpoint.EndpointStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Endpoint.EndpointStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu3.model.Endpoint.EndpointStatus.ACTIVE); + break; + case SUSPENDED: + tgt.setValue(org.hl7.fhir.dstu3.model.Endpoint.EndpointStatus.SUSPENDED); + break; + case ERROR: + tgt.setValue(org.hl7.fhir.dstu3.model.Endpoint.EndpointStatus.ERROR); + break; + case OFF: + tgt.setValue(org.hl7.fhir.dstu3.model.Endpoint.EndpointStatus.OFF); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu3.model.Endpoint.EndpointStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Endpoint.EndpointStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Enumerations30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Enumerations30_50.java index cead027ab1..412b690325 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Enumerations30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Enumerations30_50.java @@ -2,6 +2,7 @@ import org.hl7.fhir.convertors.context.ConversionContext30_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumerations; public class Enumerations30_50 { static public org.hl7.fhir.r5.model.Enumeration convertBindingStrength(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { @@ -9,26 +10,26 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.BindingStrengthEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.BindingStrength.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case REQUIRED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.BindingStrength.REQUIRED); - break; - case EXTENSIBLE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.BindingStrength.EXTENSIBLE); - break; - case PREFERRED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.BindingStrength.PREFERRED); - break; - case EXAMPLE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.BindingStrength.EXAMPLE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.BindingStrength.NULL); - break; - } - } + tgt.setValue(Enumerations.BindingStrength.REQUIRED); + break; + case EXTENSIBLE: + tgt.setValue(Enumerations.BindingStrength.EXTENSIBLE); + break; + case PREFERRED: + tgt.setValue(Enumerations.BindingStrength.PREFERRED); + break; + case EXAMPLE: + tgt.setValue(Enumerations.BindingStrength.EXAMPLE); + break; + default: + tgt.setValue(Enumerations.BindingStrength.NULL); + break; + } +} return tgt; } @@ -37,26 +38,26 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Enumerations.BindingStrengthEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case REQUIRED: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.REQUIRED); - break; - case EXTENSIBLE: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.EXTENSIBLE); - break; - case PREFERRED: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.PREFERRED); - break; - case EXAMPLE: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.EXAMPLE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.REQUIRED); + break; + case EXTENSIBLE: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.EXTENSIBLE); + break; + case PREFERRED: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.PREFERRED); + break; + case EXAMPLE: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.EXAMPLE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.NULL); + break; + } +} return tgt; } @@ -65,26 +66,26 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.PublicationStatusEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.ACTIVE); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.RETIRED); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.NULL); - break; - } - } + tgt.setValue(Enumerations.PublicationStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(Enumerations.PublicationStatus.ACTIVE); + break; + case RETIRED: + tgt.setValue(Enumerations.PublicationStatus.RETIRED); + break; + case UNKNOWN: + tgt.setValue(Enumerations.PublicationStatus.UNKNOWN); + break; + default: + tgt.setValue(Enumerations.PublicationStatus.NULL); + break; + } +} return tgt; } @@ -93,26 +94,26 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Enumerations.PublicationStatusEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case DRAFT: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.ACTIVE); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.RETIRED); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.ACTIVE); + break; + case RETIRED: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.RETIRED); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.NULL); + break; + } +} return tgt; } @@ -121,38 +122,38 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.SearchParamTypeEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case NUMBER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.NUMBER); - break; - case DATE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.DATE); - break; - case STRING: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.STRING); - break; - case TOKEN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.TOKEN); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.REFERENCE); - break; - case COMPOSITE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.COMPOSITE); - break; - case QUANTITY: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.QUANTITY); - break; - case URI: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.URI); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.NULL); - break; - } - } + tgt.setValue(Enumerations.SearchParamType.NUMBER); + break; + case DATE: + tgt.setValue(Enumerations.SearchParamType.DATE); + break; + case STRING: + tgt.setValue(Enumerations.SearchParamType.STRING); + break; + case TOKEN: + tgt.setValue(Enumerations.SearchParamType.TOKEN); + break; + case REFERENCE: + tgt.setValue(Enumerations.SearchParamType.REFERENCE); + break; + case COMPOSITE: + tgt.setValue(Enumerations.SearchParamType.COMPOSITE); + break; + case QUANTITY: + tgt.setValue(Enumerations.SearchParamType.QUANTITY); + break; + case URI: + tgt.setValue(Enumerations.SearchParamType.URI); + break; + default: + tgt.setValue(Enumerations.SearchParamType.NULL); + break; + } +} return tgt; } @@ -161,38 +162,38 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Enumerations.SearchParamTypeEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case NUMBER: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.NUMBER); - break; - case DATE: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.DATE); - break; - case STRING: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.STRING); - break; - case TOKEN: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.TOKEN); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.REFERENCE); - break; - case COMPOSITE: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.COMPOSITE); - break; - case QUANTITY: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.QUANTITY); - break; - case URI: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.URI); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.NUMBER); + break; + case DATE: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.DATE); + break; + case STRING: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.STRING); + break; + case TOKEN: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.TOKEN); + break; + case REFERENCE: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.REFERENCE); + break; + case COMPOSITE: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.COMPOSITE); + break; + case QUANTITY: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.QUANTITY); + break; + case URI: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.URI); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.NULL); + break; + } +} return tgt; } @@ -201,26 +202,26 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.AdministrativeGenderEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case MALE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.MALE); - break; - case FEMALE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.FEMALE); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.OTHER); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.NULL); - break; - } - } + tgt.setValue(Enumerations.AdministrativeGender.MALE); + break; + case FEMALE: + tgt.setValue(Enumerations.AdministrativeGender.FEMALE); + break; + case OTHER: + tgt.setValue(Enumerations.AdministrativeGender.OTHER); + break; + case UNKNOWN: + tgt.setValue(Enumerations.AdministrativeGender.UNKNOWN); + break; + default: + tgt.setValue(Enumerations.AdministrativeGender.NULL); + break; + } +} return tgt; } @@ -229,26 +230,26 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGenderEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case MALE: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender.MALE); - break; - case FEMALE: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender.FEMALE); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender.OTHER); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender.MALE); + break; + case FEMALE: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender.FEMALE); + break; + case OTHER: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender.OTHER); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender.NULL); + break; + } +} return tgt; } @@ -257,41 +258,41 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.FilterOperatorEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case EQUAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.EQUAL); - break; - case ISA: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.ISA); - break; - case DESCENDENTOF: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.DESCENDENTOF); - break; - case ISNOTA: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.ISNOTA); - break; - case REGEX: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.REGEX); - break; - case IN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.NOTIN); - break; - case GENERALIZES: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.GENERALIZES); - break; - case EXISTS: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.EXISTS); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.NULL); - break; - } - } + tgt.setValue(Enumerations.FilterOperator.EQUAL); + break; + case ISA: + tgt.setValue(Enumerations.FilterOperator.ISA); + break; + case DESCENDENTOF: + tgt.setValue(Enumerations.FilterOperator.DESCENDENTOF); + break; + case ISNOTA: + tgt.setValue(Enumerations.FilterOperator.ISNOTA); + break; + case REGEX: + tgt.setValue(Enumerations.FilterOperator.REGEX); + break; + case IN: + tgt.setValue(Enumerations.FilterOperator.IN); + break; + case NOTIN: + tgt.setValue(Enumerations.FilterOperator.NOTIN); + break; + case GENERALIZES: + tgt.setValue(Enumerations.FilterOperator.GENERALIZES); + break; + case EXISTS: + tgt.setValue(Enumerations.FilterOperator.EXISTS); + break; + default: + tgt.setValue(Enumerations.FilterOperator.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/EpisodeOfCare30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/EpisodeOfCare30_50.java index 1296dc1191..89a1660024 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/EpisodeOfCare30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/EpisodeOfCare30_50.java @@ -6,6 +6,8 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.Identifier30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.Period30_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.EpisodeOfCare; public class EpisodeOfCare30_50 { @@ -70,71 +72,79 @@ public static org.hl7.fhir.r5.model.EpisodeOfCare convertEpisodeOfCare(org.hl7.f } static public org.hl7.fhir.r5.model.Enumeration convertEpisodeOfCareStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.PLANNED); - break; - case WAITLIST: - tgt.setValue(org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.WAITLIST); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.ONHOLD); - break; - case FINISHED: - tgt.setValue(org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.FINISHED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new EpisodeOfCare.EpisodeOfCareStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.PLANNED); + break; + case WAITLIST: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.WAITLIST); + break; + case ACTIVE: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.ONHOLD); + break; + case FINISHED: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.FINISHED); + break; + case CANCELLED: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertEpisodeOfCareStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.PLANNED); - break; - case WAITLIST: - tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.WAITLIST); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.ONHOLD); - break; - case FINISHED: - tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.FINISHED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.PLANNED); + break; + case WAITLIST: + tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.WAITLIST); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.ONHOLD); + break; + case FINISHED: + tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.FINISHED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent convertEpisodeOfCareStatusHistoryComponent(org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/FamilyMemberHistory30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/FamilyMemberHistory30_50.java index 4d658c7938..86d75f605c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/FamilyMemberHistory30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/FamilyMemberHistory30_50.java @@ -8,59 +8,69 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Boolean30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.DateTime30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.FamilyMemberHistory; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; public class FamilyMemberHistory30_50 { static public org.hl7.fhir.dstu3.model.Enumeration convertFamilyHistoryStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.FamilyMemberHistory.FamilyHistoryStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PARTIAL: - tgt.setValue(org.hl7.fhir.dstu3.model.FamilyMemberHistory.FamilyHistoryStatus.PARTIAL); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.FamilyMemberHistory.FamilyHistoryStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.FamilyMemberHistory.FamilyHistoryStatus.ENTEREDINERROR); - break; - case HEALTHUNKNOWN: - tgt.setValue(org.hl7.fhir.dstu3.model.FamilyMemberHistory.FamilyHistoryStatus.HEALTHUNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.FamilyMemberHistory.FamilyHistoryStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new FamilyMemberHistory.FamilyHistoryStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PARTIAL: + tgt.setValue(FamilyMemberHistory.FamilyHistoryStatus.PARTIAL); + break; + case COMPLETED: + tgt.setValue(FamilyMemberHistory.FamilyHistoryStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(FamilyMemberHistory.FamilyHistoryStatus.ENTEREDINERROR); + break; + case HEALTHUNKNOWN: + tgt.setValue(FamilyMemberHistory.FamilyHistoryStatus.HEALTHUNKNOWN); + break; + default: + tgt.setValue(FamilyMemberHistory.FamilyHistoryStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertFamilyHistoryStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PARTIAL: - tgt.setValue(org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus.PARTIAL); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus.ENTEREDINERROR); - break; - case HEALTHUNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus.HEALTHUNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PARTIAL: + tgt.setValue(org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus.PARTIAL); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus.ENTEREDINERROR); + break; + case HEALTHUNKNOWN: + tgt.setValue(org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus.HEALTHUNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.FamilyMemberHistory convertFamilyMemberHistory(org.hl7.fhir.r5.model.FamilyMemberHistory src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Flag30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Flag30_50.java index 394e469f32..16d3ad1758 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Flag30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Flag30_50.java @@ -5,6 +5,8 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.CodeableConcept30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.Identifier30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.Period30_50; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.Flag; import org.hl7.fhir.exceptions.FHIRException; public class Flag30_50 { @@ -58,46 +60,54 @@ public static org.hl7.fhir.dstu3.model.Flag convertFlag(org.hl7.fhir.r5.model.Fl } static public org.hl7.fhir.dstu3.model.Enumeration convertFlagStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Flag.FlagStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Flag.FlagStatus.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Flag.FlagStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Flag.FlagStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Flag.FlagStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Flag.FlagStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Flag.FlagStatus.ACTIVE); + break; + case INACTIVE: + tgt.setValue(Flag.FlagStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(Flag.FlagStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Flag.FlagStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertFlagStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Flag.FlagStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Flag.FlagStatus.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Flag.FlagStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Flag.FlagStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Flag.FlagStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Flag.FlagStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.r5.model.Flag.FlagStatus.ACTIVE); + break; + case INACTIVE: + tgt.setValue(org.hl7.fhir.r5.model.Flag.FlagStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r5.model.Flag.FlagStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.Flag.FlagStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Goal30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Goal30_50.java index fddf7200f4..2739b56143 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Goal30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Goal30_50.java @@ -7,6 +7,8 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.Identifier30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Date30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.Goal; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; @@ -84,95 +86,103 @@ public static org.hl7.fhir.r5.model.Goal convertGoal(org.hl7.fhir.dstu3.model.Go } static public org.hl7.fhir.dstu3.model.Enumeration convertGoalStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Goal.GoalStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSED: - tgt.setValue(org.hl7.fhir.dstu3.model.Goal.GoalStatus.PROPOSED); - break; - case ACCEPTED: - tgt.setValue(org.hl7.fhir.dstu3.model.Goal.GoalStatus.ACCEPTED); - break; - case PLANNED: - tgt.setValue(org.hl7.fhir.dstu3.model.Goal.GoalStatus.PLANNED); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Goal.GoalStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.Goal.GoalStatus.ACHIEVED); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.dstu3.model.Goal.GoalStatus.ONHOLD); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu3.model.Goal.GoalStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Goal.GoalStatus.ENTEREDINERROR); - break; - case REJECTED: - tgt.setValue(org.hl7.fhir.dstu3.model.Goal.GoalStatus.REJECTED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Goal.GoalStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Goal.GoalStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSED: + tgt.setValue(Goal.GoalStatus.PROPOSED); + break; + case ACCEPTED: + tgt.setValue(Goal.GoalStatus.ACCEPTED); + break; + case PLANNED: + tgt.setValue(Goal.GoalStatus.PLANNED); + break; + case ACTIVE: + tgt.setValue(Goal.GoalStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(Goal.GoalStatus.ACHIEVED); + break; + case ONHOLD: + tgt.setValue(Goal.GoalStatus.ONHOLD); + break; + case CANCELLED: + tgt.setValue(Goal.GoalStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(Goal.GoalStatus.ENTEREDINERROR); + break; + case REJECTED: + tgt.setValue(Goal.GoalStatus.REJECTED); + break; + default: + tgt.setValue(Goal.GoalStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertGoalStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Goal.GoalLifecycleStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSED: - tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.PROPOSED); - break; - case ACCEPTED: - tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.ACCEPTED); - break; - case PLANNED: - tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.PLANNED); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.ACTIVE); - break; - case ONTARGET: - tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.ACTIVE); - break; - case AHEADOFTARGET: - tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.ACTIVE); - break; - case BEHINDTARGET: - tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.ACTIVE); - break; - case SUSTAINING: - tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.ACTIVE); - break; - case ACHIEVED: - tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.COMPLETED); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.ONHOLD); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.ENTEREDINERROR); - break; - case REJECTED: - tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.REJECTED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Goal.GoalLifecycleStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSED: + tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.PROPOSED); + break; + case ACCEPTED: + tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.ACCEPTED); + break; + case PLANNED: + tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.PLANNED); + break; + case INPROGRESS: + tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.ACTIVE); + break; + case ONTARGET: + tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.ACTIVE); + break; + case AHEADOFTARGET: + tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.ACTIVE); + break; + case BEHINDTARGET: + tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.ACTIVE); + break; + case SUSTAINING: + tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.ACTIVE); + break; + case ACHIEVED: + tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.COMPLETED); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.ONHOLD); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.ENTEREDINERROR); + break; + case REJECTED: + tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.REJECTED); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Goal.GoalTargetComponent convertGoalTargetComponent(org.hl7.fhir.dstu3.model.Goal.GoalTargetComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/GraphDefinition30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/GraphDefinition30_50.java index c9f000f254..739833b0b6 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/GraphDefinition30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/GraphDefinition30_50.java @@ -9,114 +9,133 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.MarkDown30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Uri30_50; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.GraphDefinition; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumerations; public class GraphDefinition30_50 { static public org.hl7.fhir.dstu3.model.Enumeration convertCompartmentCode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.GraphDefinition.CompartmentCodeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PATIENT: - tgt.setValue(org.hl7.fhir.dstu3.model.GraphDefinition.CompartmentCode.PATIENT); - break; - case ENCOUNTER: - tgt.setValue(org.hl7.fhir.dstu3.model.GraphDefinition.CompartmentCode.ENCOUNTER); - break; - case RELATEDPERSON: - tgt.setValue(org.hl7.fhir.dstu3.model.GraphDefinition.CompartmentCode.RELATEDPERSON); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.dstu3.model.GraphDefinition.CompartmentCode.PRACTITIONER); - break; - case DEVICE: - tgt.setValue(org.hl7.fhir.dstu3.model.GraphDefinition.CompartmentCode.DEVICE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.GraphDefinition.CompartmentCode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new GraphDefinition.CompartmentCodeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PATIENT: + tgt.setValue(GraphDefinition.CompartmentCode.PATIENT); + break; + case ENCOUNTER: + tgt.setValue(GraphDefinition.CompartmentCode.ENCOUNTER); + break; + case RELATEDPERSON: + tgt.setValue(GraphDefinition.CompartmentCode.RELATEDPERSON); + break; + case PRACTITIONER: + tgt.setValue(GraphDefinition.CompartmentCode.PRACTITIONER); + break; + case DEVICE: + tgt.setValue(GraphDefinition.CompartmentCode.DEVICE); + break; + default: + tgt.setValue(GraphDefinition.CompartmentCode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertCompartmentCode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.CompartmentTypeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PATIENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.PATIENT); - break; - case ENCOUNTER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.ENCOUNTER); - break; - case RELATEDPERSON: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.RELATEDPERSON); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.PRACTITIONER); - break; - case DEVICE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.DEVICE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new Enumerations.CompartmentTypeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PATIENT: + tgt.setValue(Enumerations.CompartmentType.PATIENT); + break; + case ENCOUNTER: + tgt.setValue(Enumerations.CompartmentType.ENCOUNTER); + break; + case RELATEDPERSON: + tgt.setValue(Enumerations.CompartmentType.RELATEDPERSON); + break; + case PRACTITIONER: + tgt.setValue(Enumerations.CompartmentType.PRACTITIONER); + break; + case DEVICE: + tgt.setValue(Enumerations.CompartmentType.DEVICE); + break; + default: + tgt.setValue(Enumerations.CompartmentType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertGraphCompartmentRule(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.GraphDefinition.GraphCompartmentRuleEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case IDENTICAL: - tgt.setValue(org.hl7.fhir.dstu3.model.GraphDefinition.GraphCompartmentRule.IDENTICAL); - break; - case MATCHING: - tgt.setValue(org.hl7.fhir.dstu3.model.GraphDefinition.GraphCompartmentRule.MATCHING); - break; - case DIFFERENT: - tgt.setValue(org.hl7.fhir.dstu3.model.GraphDefinition.GraphCompartmentRule.DIFFERENT); - break; - case CUSTOM: - tgt.setValue(org.hl7.fhir.dstu3.model.GraphDefinition.GraphCompartmentRule.CUSTOM); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.GraphDefinition.GraphCompartmentRule.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new GraphDefinition.GraphCompartmentRuleEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case IDENTICAL: + tgt.setValue(GraphDefinition.GraphCompartmentRule.IDENTICAL); + break; + case MATCHING: + tgt.setValue(GraphDefinition.GraphCompartmentRule.MATCHING); + break; + case DIFFERENT: + tgt.setValue(GraphDefinition.GraphCompartmentRule.DIFFERENT); + break; + case CUSTOM: + tgt.setValue(GraphDefinition.GraphCompartmentRule.CUSTOM); + break; + default: + tgt.setValue(GraphDefinition.GraphCompartmentRule.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertGraphCompartmentRule(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRuleEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case IDENTICAL: - tgt.setValue(org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRule.IDENTICAL); - break; - case MATCHING: - tgt.setValue(org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRule.MATCHING); - break; - case DIFFERENT: - tgt.setValue(org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRule.DIFFERENT); - break; - case CUSTOM: - tgt.setValue(org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRule.CUSTOM); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRule.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRuleEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case IDENTICAL: + tgt.setValue(org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRule.IDENTICAL); + break; + case MATCHING: + tgt.setValue(org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRule.MATCHING); + break; + case DIFFERENT: + tgt.setValue(org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRule.DIFFERENT); + break; + case CUSTOM: + tgt.setValue(org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRule.CUSTOM); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRule.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.GraphDefinition convertGraphDefinition(org.hl7.fhir.dstu3.model.GraphDefinition src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Group30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Group30_50.java index 4705746307..ed4f558f5c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Group30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Group30_50.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Boolean30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.UnsignedInt30_50; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.Group; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.Group.GroupMembershipBasis; @@ -126,52 +128,60 @@ public static org.hl7.fhir.r5.model.Group.GroupMemberComponent convertGroupMembe } static public org.hl7.fhir.dstu3.model.Enumeration convertGroupType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Group.GroupTypeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PERSON: - tgt.setValue(org.hl7.fhir.dstu3.model.Group.GroupType.PERSON); - break; - case ANIMAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Group.GroupType.ANIMAL); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.dstu3.model.Group.GroupType.PRACTITIONER); - break; - case DEVICE: - tgt.setValue(org.hl7.fhir.dstu3.model.Group.GroupType.DEVICE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Group.GroupType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Group.GroupTypeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PERSON: + tgt.setValue(Group.GroupType.PERSON); + break; + case ANIMAL: + tgt.setValue(Group.GroupType.ANIMAL); + break; + case PRACTITIONER: + tgt.setValue(Group.GroupType.PRACTITIONER); + break; + case DEVICE: + tgt.setValue(Group.GroupType.DEVICE); + break; + default: + tgt.setValue(Group.GroupType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertGroupType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Group.GroupTypeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PERSON: - tgt.setValue(org.hl7.fhir.r5.model.Group.GroupType.PERSON); - break; - case ANIMAL: - tgt.setValue(org.hl7.fhir.r5.model.Group.GroupType.ANIMAL); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.r5.model.Group.GroupType.PRACTITIONER); - break; - case DEVICE: - tgt.setValue(org.hl7.fhir.r5.model.Group.GroupType.DEVICE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Group.GroupType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Group.GroupTypeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PERSON: + tgt.setValue(org.hl7.fhir.r5.model.Group.GroupType.PERSON); + break; + case ANIMAL: + tgt.setValue(org.hl7.fhir.r5.model.Group.GroupType.ANIMAL); + break; + case PRACTITIONER: + tgt.setValue(org.hl7.fhir.r5.model.Group.GroupType.PRACTITIONER); + break; + case DEVICE: + tgt.setValue(org.hl7.fhir.r5.model.Group.GroupType.DEVICE); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.Group.GroupType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/HealthcareService30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/HealthcareService30_50.java index 1e0424e341..fda99b4624 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/HealthcareService30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/HealthcareService30_50.java @@ -8,8 +8,11 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.Identifier30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Boolean30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.HealthcareService; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableConcept; +import org.hl7.fhir.r5.model.Enumerations; import org.hl7.fhir.r5.model.ExtendedContactDetail; import org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceEligibilityComponent; @@ -160,71 +163,79 @@ public static org.hl7.fhir.dstu3.model.HealthcareService convertHealthcareServic // } static public org.hl7.fhir.dstu3.model.Enumeration convertDaysOfWeek(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeekEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case MON: - tgt.setValue(org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeek.MON); - break; - case TUE: - tgt.setValue(org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeek.TUE); - break; - case WED: - tgt.setValue(org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeek.WED); - break; - case THU: - tgt.setValue(org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeek.THU); - break; - case FRI: - tgt.setValue(org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeek.FRI); - break; - case SAT: - tgt.setValue(org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeek.SAT); - break; - case SUN: - tgt.setValue(org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeek.SUN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeek.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new HealthcareService.DaysOfWeekEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MON: + tgt.setValue(HealthcareService.DaysOfWeek.MON); + break; + case TUE: + tgt.setValue(HealthcareService.DaysOfWeek.TUE); + break; + case WED: + tgt.setValue(HealthcareService.DaysOfWeek.WED); + break; + case THU: + tgt.setValue(HealthcareService.DaysOfWeek.THU); + break; + case FRI: + tgt.setValue(HealthcareService.DaysOfWeek.FRI); + break; + case SAT: + tgt.setValue(HealthcareService.DaysOfWeek.SAT); + break; + case SUN: + tgt.setValue(HealthcareService.DaysOfWeek.SUN); + break; + default: + tgt.setValue(HealthcareService.DaysOfWeek.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertDaysOfWeek(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.DaysOfWeekEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case MON: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.MON); - break; - case TUE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.TUE); - break; - case WED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.WED); - break; - case THU: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.THU); - break; - case FRI: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.FRI); - break; - case SAT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.SAT); - break; - case SUN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.SUN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new Enumerations.DaysOfWeekEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MON: + tgt.setValue(Enumerations.DaysOfWeek.MON); + break; + case TUE: + tgt.setValue(Enumerations.DaysOfWeek.TUE); + break; + case WED: + tgt.setValue(Enumerations.DaysOfWeek.WED); + break; + case THU: + tgt.setValue(Enumerations.DaysOfWeek.THU); + break; + case FRI: + tgt.setValue(Enumerations.DaysOfWeek.FRI); + break; + case SAT: + tgt.setValue(Enumerations.DaysOfWeek.SAT); + break; + case SUN: + tgt.setValue(Enumerations.DaysOfWeek.SUN); + break; + default: + tgt.setValue(Enumerations.DaysOfWeek.NULL); + break; + } + } + return tgt; } // // public static org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceNotAvailableComponent convertHealthcareServiceNotAvailableComponent(org.hl7.fhir.dstu3.model.HealthcareService.HealthcareServiceNotAvailableComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Immunization30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Immunization30_50.java index 3cfa56a9fe..1bc7f75f6b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Immunization30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Immunization30_50.java @@ -10,6 +10,8 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Date30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.DateTime30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.Immunization; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; @@ -127,40 +129,48 @@ public static org.hl7.fhir.r5.model.Immunization.ImmunizationPerformerComponent } static public org.hl7.fhir.dstu3.model.Enumeration convertImmunizationStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Immunization.ImmunizationStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.Immunization.ImmunizationStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Immunization.ImmunizationStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Immunization.ImmunizationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Immunization.ImmunizationStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case COMPLETED: + tgt.setValue(Immunization.ImmunizationStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(Immunization.ImmunizationStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Immunization.ImmunizationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertImmunizationStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Immunization.ImmunizationStatusCodesEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.Immunization.ImmunizationStatusCodes.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Immunization.ImmunizationStatusCodes.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Immunization.ImmunizationStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Immunization.ImmunizationStatusCodesEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case COMPLETED: + tgt.setValue(org.hl7.fhir.r5.model.Immunization.ImmunizationStatusCodes.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r5.model.Immunization.ImmunizationStatusCodes.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.Immunization.ImmunizationStatusCodes.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Linkage30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Linkage30_50.java index 03441e5a33..c225547e22 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Linkage30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Linkage30_50.java @@ -4,6 +4,8 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.Reference30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Boolean30_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Linkage; public class Linkage30_50 { @@ -60,46 +62,54 @@ public static org.hl7.fhir.r5.model.Linkage.LinkageItemComponent convertLinkageI } static public org.hl7.fhir.r5.model.Enumeration convertLinkageType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Linkage.LinkageTypeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case SOURCE: - tgt.setValue(org.hl7.fhir.r5.model.Linkage.LinkageType.SOURCE); - break; - case ALTERNATE: - tgt.setValue(org.hl7.fhir.r5.model.Linkage.LinkageType.ALTERNATE); - break; - case HISTORICAL: - tgt.setValue(org.hl7.fhir.r5.model.Linkage.LinkageType.HISTORICAL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Linkage.LinkageType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Linkage.LinkageTypeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SOURCE: + tgt.setValue(Linkage.LinkageType.SOURCE); + break; + case ALTERNATE: + tgt.setValue(Linkage.LinkageType.ALTERNATE); + break; + case HISTORICAL: + tgt.setValue(Linkage.LinkageType.HISTORICAL); + break; + default: + tgt.setValue(Linkage.LinkageType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertLinkageType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Linkage.LinkageTypeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case SOURCE: - tgt.setValue(org.hl7.fhir.dstu3.model.Linkage.LinkageType.SOURCE); - break; - case ALTERNATE: - tgt.setValue(org.hl7.fhir.dstu3.model.Linkage.LinkageType.ALTERNATE); - break; - case HISTORICAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Linkage.LinkageType.HISTORICAL); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Linkage.LinkageType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Linkage.LinkageTypeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SOURCE: + tgt.setValue(org.hl7.fhir.dstu3.model.Linkage.LinkageType.SOURCE); + break; + case ALTERNATE: + tgt.setValue(org.hl7.fhir.dstu3.model.Linkage.LinkageType.ALTERNATE); + break; + case HISTORICAL: + tgt.setValue(org.hl7.fhir.dstu3.model.Linkage.LinkageType.HISTORICAL); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Linkage.LinkageType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/List30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/List30_50.java index 82e5db0856..d9b805657b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/List30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/List30_50.java @@ -8,7 +8,10 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Boolean30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.DateTime30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; +import org.hl7.fhir.dstu3.model.ListResource; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; public class List30_50 { @@ -111,90 +114,106 @@ public static org.hl7.fhir.dstu3.model.ListResource.ListEntryComponent convertLi } static public org.hl7.fhir.r5.model.Enumeration convertListMode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ListModeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case WORKING: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ListMode.WORKING); - break; - case SNAPSHOT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ListMode.SNAPSHOT); - break; - case CHANGES: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ListMode.CHANGES); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ListMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ListModeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case WORKING: + tgt.setValue(Enumerations.ListMode.WORKING); + break; + case SNAPSHOT: + tgt.setValue(Enumerations.ListMode.SNAPSHOT); + break; + case CHANGES: + tgt.setValue(Enumerations.ListMode.CHANGES); + break; + default: + tgt.setValue(Enumerations.ListMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertListMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ListResource.ListModeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case WORKING: - tgt.setValue(org.hl7.fhir.dstu3.model.ListResource.ListMode.WORKING); - break; - case SNAPSHOT: - tgt.setValue(org.hl7.fhir.dstu3.model.ListResource.ListMode.SNAPSHOT); - break; - case CHANGES: - tgt.setValue(org.hl7.fhir.dstu3.model.ListResource.ListMode.CHANGES); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ListResource.ListMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new ListResource.ListModeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case WORKING: + tgt.setValue(ListResource.ListMode.WORKING); + break; + case SNAPSHOT: + tgt.setValue(ListResource.ListMode.SNAPSHOT); + break; + case CHANGES: + tgt.setValue(ListResource.ListMode.CHANGES); + break; + default: + tgt.setValue(ListResource.ListMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertListStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ListResource.ListStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case CURRENT: - tgt.setValue(org.hl7.fhir.r5.model.ListResource.ListStatus.CURRENT); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.r5.model.ListResource.ListStatus.RETIRED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.ListResource.ListStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ListResource.ListStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new org.hl7.fhir.r5.model.ListResource.ListStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CURRENT: + tgt.setValue(org.hl7.fhir.r5.model.ListResource.ListStatus.CURRENT); + break; + case RETIRED: + tgt.setValue(org.hl7.fhir.r5.model.ListResource.ListStatus.RETIRED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r5.model.ListResource.ListStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.ListResource.ListStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertListStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ListResource.ListStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case CURRENT: - tgt.setValue(org.hl7.fhir.dstu3.model.ListResource.ListStatus.CURRENT); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.dstu3.model.ListResource.ListStatus.RETIRED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.ListResource.ListStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ListResource.ListStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new ListResource.ListStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CURRENT: + tgt.setValue(ListResource.ListStatus.CURRENT); + break; + case RETIRED: + tgt.setValue(ListResource.ListStatus.RETIRED); + break; + case ENTEREDINERROR: + tgt.setValue(ListResource.ListStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(ListResource.ListStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Location30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Location30_50.java index b1b382f87f..9b90889e60 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Location30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Location30_50.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.Identifier30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Decimal30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.Location; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.ContactPoint; import org.hl7.fhir.r5.model.ExtendedContactDetail; @@ -89,41 +91,49 @@ public static org.hl7.fhir.dstu3.model.Location convertLocation(org.hl7.fhir.r5. } static public org.hl7.fhir.dstu3.model.Enumeration convertLocationMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Location.LocationModeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.dstu3.model.Location.LocationMode.INSTANCE); - break; - case KIND: - tgt.setValue(org.hl7.fhir.dstu3.model.Location.LocationMode.KIND); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Location.LocationMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Location.LocationModeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(Location.LocationMode.INSTANCE); + break; + case KIND: + tgt.setValue(Location.LocationMode.KIND); + break; + default: + tgt.setValue(Location.LocationMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertLocationMode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Location.LocationModeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.r5.model.Location.LocationMode.INSTANCE); - break; - case KIND: - tgt.setValue(org.hl7.fhir.r5.model.Location.LocationMode.KIND); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Location.LocationMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Location.LocationModeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(org.hl7.fhir.r5.model.Location.LocationMode.INSTANCE); + break; + case KIND: + tgt.setValue(org.hl7.fhir.r5.model.Location.LocationMode.KIND); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.Location.LocationMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.Location.LocationPositionComponent convertLocationPositionComponent(org.hl7.fhir.r5.model.Location.LocationPositionComponent src) throws FHIRException { @@ -155,46 +165,54 @@ public static org.hl7.fhir.r5.model.Location.LocationPositionComponent convertLo } static public org.hl7.fhir.dstu3.model.Enumeration convertLocationStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Location.LocationStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Location.LocationStatus.ACTIVE); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.dstu3.model.Location.LocationStatus.SUSPENDED); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Location.LocationStatus.INACTIVE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Location.LocationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Location.LocationStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Location.LocationStatus.ACTIVE); + break; + case SUSPENDED: + tgt.setValue(Location.LocationStatus.SUSPENDED); + break; + case INACTIVE: + tgt.setValue(Location.LocationStatus.INACTIVE); + break; + default: + tgt.setValue(Location.LocationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertLocationStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Location.LocationStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Location.LocationStatus.ACTIVE); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.r5.model.Location.LocationStatus.SUSPENDED); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Location.LocationStatus.INACTIVE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Location.LocationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Location.LocationStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.r5.model.Location.LocationStatus.ACTIVE); + break; + case SUSPENDED: + tgt.setValue(org.hl7.fhir.r5.model.Location.LocationStatus.SUSPENDED); + break; + case INACTIVE: + tgt.setValue(org.hl7.fhir.r5.model.Location.LocationStatus.INACTIVE); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.Location.LocationStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Medication30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Medication30_50.java index e19bbe1cea..18bd69f5e8 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Medication30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Medication30_50.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.DateTime30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Medication; public class Medication30_50 { @@ -108,46 +110,54 @@ public static org.hl7.fhir.r5.model.Medication.MedicationBatchComponent convertM } static public org.hl7.fhir.r5.model.Enumeration convertMedicationStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Medication.MedicationStatusCodesEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Medication.MedicationStatusCodes.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Medication.MedicationStatusCodes.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Medication.MedicationStatusCodes.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Medication.MedicationStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Medication.MedicationStatusCodesEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Medication.MedicationStatusCodes.ACTIVE); + break; + case INACTIVE: + tgt.setValue(Medication.MedicationStatusCodes.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(Medication.MedicationStatusCodes.ENTEREDINERROR); + break; + default: + tgt.setValue(Medication.MedicationStatusCodes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertMedicationStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Medication.MedicationStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Medication.MedicationStatus.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Medication.MedicationStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Medication.MedicationStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Medication.MedicationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Medication.MedicationStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu3.model.Medication.MedicationStatus.ACTIVE); + break; + case INACTIVE: + tgt.setValue(org.hl7.fhir.dstu3.model.Medication.MedicationStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu3.model.Medication.MedicationStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Medication.MedicationStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/MedicationDispense30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/MedicationDispense30_50.java index 0626f977c3..ac90382f13 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/MedicationDispense30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/MedicationDispense30_50.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.SimpleQuantity30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Boolean30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.DateTime30_50; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.MedicationDispense; import org.hl7.fhir.exceptions.FHIRException; public class MedicationDispense30_50 { @@ -136,68 +138,76 @@ public static org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispensePerf } static public org.hl7.fhir.dstu3.model.Enumeration convertMedicationDispenseStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration(); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PREPARATION: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatus.PREPARATION); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatus.INPROGRESS); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatus.ONHOLD); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatus.ENTEREDINERROR); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatus.STOPPED); - break; - case DECLINED: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatus.STOPPED); - break; - case NULL: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseStatus.NULL); - break; - } - return tgt; + if (src == null) + return null; + Enumeration tgt = new Enumeration(); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PREPARATION: + tgt.setValue(MedicationDispense.MedicationDispenseStatus.PREPARATION); + break; + case INPROGRESS: + tgt.setValue(MedicationDispense.MedicationDispenseStatus.INPROGRESS); + break; + case ONHOLD: + tgt.setValue(MedicationDispense.MedicationDispenseStatus.ONHOLD); + break; + case COMPLETED: + tgt.setValue(MedicationDispense.MedicationDispenseStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(MedicationDispense.MedicationDispenseStatus.ENTEREDINERROR); + break; + case STOPPED: + tgt.setValue(MedicationDispense.MedicationDispenseStatus.STOPPED); + break; + case DECLINED: + tgt.setValue(MedicationDispense.MedicationDispenseStatus.STOPPED); + break; + case NULL: + tgt.setValue(MedicationDispense.MedicationDispenseStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertMedicationDispenseStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration(new org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodesEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PREPARATION: - tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.PREPARATION); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.INPROGRESS); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.ONHOLD); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.ENTEREDINERROR); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.STOPPED); - break; - case NULL: - tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.NULL); - break; - } - return tgt; + if (src == null) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration(new org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodesEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PREPARATION: + tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.PREPARATION); + break; + case INPROGRESS: + tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.INPROGRESS); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.ONHOLD); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.ENTEREDINERROR); + break; + case STOPPED: + tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.STOPPED); + break; + case NULL: + tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseSubstitutionComponent convertMedicationDispenseSubstitutionComponent(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseSubstitutionComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/MedicationRequest30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/MedicationRequest30_50.java index a2025d1395..e68fbd1a3c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/MedicationRequest30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/MedicationRequest30_50.java @@ -13,6 +13,9 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.DateTime30_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; +import org.hl7.fhir.r5.model.MedicationRequest; public class MedicationRequest30_50 { @@ -157,177 +160,201 @@ public static org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestDispen } static public org.hl7.fhir.r5.model.Enumeration convertMedicationRequestIntent(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntentEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSAL: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.PROPOSAL); - break; - case PLAN: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.PLAN); - break; - case ORDER: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.ORDER); - break; - case INSTANCEORDER: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.INSTANCEORDER); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new MedicationRequest.MedicationRequestIntentEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSAL: + tgt.setValue(MedicationRequest.MedicationRequestIntent.PROPOSAL); + break; + case PLAN: + tgt.setValue(MedicationRequest.MedicationRequestIntent.PLAN); + break; + case ORDER: + tgt.setValue(MedicationRequest.MedicationRequestIntent.ORDER); + break; + case INSTANCEORDER: + tgt.setValue(MedicationRequest.MedicationRequestIntent.INSTANCEORDER); + break; + default: + tgt.setValue(MedicationRequest.MedicationRequestIntent.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertMedicationRequestIntent(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestIntentEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSAL: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestIntent.PROPOSAL); - break; - case PLAN: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestIntent.PLAN); - break; - case ORDER: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestIntent.ORDER); - break; - case INSTANCEORDER: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestIntent.INSTANCEORDER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestIntent.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestIntentEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSAL: + tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestIntent.PROPOSAL); + break; + case PLAN: + tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestIntent.PLAN); + break; + case ORDER: + tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestIntent.ORDER); + break; + case INSTANCEORDER: + tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestIntent.INSTANCEORDER); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestIntent.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertMedicationRequestPriority(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestPriorityEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT); - break; - case STAT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.RequestPriorityEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(Enumerations.RequestPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(Enumerations.RequestPriority.URGENT); + break; + case STAT: + tgt.setValue(Enumerations.RequestPriority.STAT); + break; + case ASAP: + tgt.setValue(Enumerations.RequestPriority.ASAP); + break; + default: + tgt.setValue(Enumerations.RequestPriority.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertMedicationRequestPriority(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestPriorityEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestPriority.URGENT); - break; - case STAT: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestPriority.STAT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestPriority.ASAP); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestPriorityEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestPriority.URGENT); + break; + case STAT: + tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestPriority.STAT); + break; + case ASAP: + tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestPriority.ASAP); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestPriority.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertMedicationRequestStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.ONHOLD); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.CANCELLED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.ENTEREDINERROR); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.STOPPED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.DRAFT); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new MedicationRequest.MedicationrequestStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(MedicationRequest.MedicationrequestStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(MedicationRequest.MedicationrequestStatus.ONHOLD); + break; + case CANCELLED: + tgt.setValue(MedicationRequest.MedicationrequestStatus.CANCELLED); + break; + case COMPLETED: + tgt.setValue(MedicationRequest.MedicationrequestStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(MedicationRequest.MedicationrequestStatus.ENTEREDINERROR); + break; + case STOPPED: + tgt.setValue(MedicationRequest.MedicationrequestStatus.STOPPED); + break; + case DRAFT: + tgt.setValue(MedicationRequest.MedicationrequestStatus.DRAFT); + break; + case UNKNOWN: + tgt.setValue(MedicationRequest.MedicationrequestStatus.UNKNOWN); + break; + default: + tgt.setValue(MedicationRequest.MedicationrequestStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertMedicationRequestStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestStatus.ONHOLD); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestStatus.CANCELLED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestStatus.ENTEREDINERROR); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestStatus.STOPPED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestStatus.DRAFT); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestStatus.ONHOLD); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestStatus.CANCELLED); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestStatus.ENTEREDINERROR); + break; + case STOPPED: + tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestStatus.STOPPED); + break; + case DRAFT: + tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestStatus.DRAFT); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestSubstitutionComponent convertMedicationRequestSubstitutionComponent(org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestSubstitutionComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/MedicationStatement30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/MedicationStatement30_50.java index 85f8b7f097..d7a602e50c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/MedicationStatement30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/MedicationStatement30_50.java @@ -7,6 +7,8 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.CodeableConcept30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.Identifier30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.DateTime30_50; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.MedicationStatement; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; @@ -95,64 +97,72 @@ public static org.hl7.fhir.dstu3.model.MedicationStatement convertMedicationStat } static public org.hl7.fhir.dstu3.model.Enumeration convertMedicationStatementStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.MedicationStatement.MedicationStatementStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { -// case ACTIVE: + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new MedicationStatement.MedicationStatementStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + // case ACTIVE: // tgt.setValue(org.hl7.fhir.dstu3.model.MedicationStatement.MedicationStatementStatus.ACTIVE); // break; - case RECORDED: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationStatement.MedicationStatementStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationStatement.MedicationStatementStatus.ENTEREDINERROR); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationStatement.MedicationStatementStatus.COMPLETED); - break; + case RECORDED: + tgt.setValue(MedicationStatement.MedicationStatementStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(MedicationStatement.MedicationStatementStatus.ENTEREDINERROR); + break; + case DRAFT: + tgt.setValue(MedicationStatement.MedicationStatementStatus.COMPLETED); + break; // case STOPPED: // tgt.setValue(org.hl7.fhir.dstu3.model.MedicationStatement.MedicationStatementStatus.STOPPED); // break; // case ONHOLD: // tgt.setValue(org.hl7.fhir.dstu3.model.MedicationStatement.MedicationStatementStatus.ONHOLD); // break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.MedicationStatement.MedicationStatementStatus.NULL); - break; - } - return tgt; + default: + tgt.setValue(MedicationStatement.MedicationStatementStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertMedicationStatementStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodesEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodes.RECORDED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodes.RECORDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodes.ENTEREDINERROR); - break; - case INTENDED: - tgt.setValue(org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodes.RECORDED); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodes.RECORDED); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodes.RECORDED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodesEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodes.RECORDED); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodes.RECORDED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodes.ENTEREDINERROR); + break; + case INTENDED: + tgt.setValue(org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodes.RECORDED); + break; + case STOPPED: + tgt.setValue(org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodes.RECORDED); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodes.RECORDED); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodes.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/MessageDefinition30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/MessageDefinition30_50.java index efe85adece..f3e9b9fadb 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/MessageDefinition30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/MessageDefinition30_50.java @@ -14,6 +14,8 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.UnsignedInt30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Uri30_50; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.MessageDefinition; import org.hl7.fhir.exceptions.FHIRException; public class MessageDefinition30_50 { @@ -183,46 +185,54 @@ public static org.hl7.fhir.r5.model.MessageDefinition.MessageDefinitionFocusComp } static public org.hl7.fhir.dstu3.model.Enumeration convertMessageSignificanceCategory(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.MessageDefinition.MessageSignificanceCategoryEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case CONSEQUENCE: - tgt.setValue(org.hl7.fhir.dstu3.model.MessageDefinition.MessageSignificanceCategory.CONSEQUENCE); - break; - case CURRENCY: - tgt.setValue(org.hl7.fhir.dstu3.model.MessageDefinition.MessageSignificanceCategory.CURRENCY); - break; - case NOTIFICATION: - tgt.setValue(org.hl7.fhir.dstu3.model.MessageDefinition.MessageSignificanceCategory.NOTIFICATION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.MessageDefinition.MessageSignificanceCategory.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new MessageDefinition.MessageSignificanceCategoryEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CONSEQUENCE: + tgt.setValue(MessageDefinition.MessageSignificanceCategory.CONSEQUENCE); + break; + case CURRENCY: + tgt.setValue(MessageDefinition.MessageSignificanceCategory.CURRENCY); + break; + case NOTIFICATION: + tgt.setValue(MessageDefinition.MessageSignificanceCategory.NOTIFICATION); + break; + default: + tgt.setValue(MessageDefinition.MessageSignificanceCategory.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertMessageSignificanceCategory(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.MessageDefinition.MessageSignificanceCategoryEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case CONSEQUENCE: - tgt.setValue(org.hl7.fhir.r5.model.MessageDefinition.MessageSignificanceCategory.CONSEQUENCE); - break; - case CURRENCY: - tgt.setValue(org.hl7.fhir.r5.model.MessageDefinition.MessageSignificanceCategory.CURRENCY); - break; - case NOTIFICATION: - tgt.setValue(org.hl7.fhir.r5.model.MessageDefinition.MessageSignificanceCategory.NOTIFICATION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.MessageDefinition.MessageSignificanceCategory.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.MessageDefinition.MessageSignificanceCategoryEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CONSEQUENCE: + tgt.setValue(org.hl7.fhir.r5.model.MessageDefinition.MessageSignificanceCategory.CONSEQUENCE); + break; + case CURRENCY: + tgt.setValue(org.hl7.fhir.r5.model.MessageDefinition.MessageSignificanceCategory.CURRENCY); + break; + case NOTIFICATION: + tgt.setValue(org.hl7.fhir.r5.model.MessageDefinition.MessageSignificanceCategory.NOTIFICATION); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.MessageDefinition.MessageSignificanceCategory.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/MessageHeader30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/MessageHeader30_50.java index 8c1a339039..d62f7b2b7d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/MessageHeader30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/MessageHeader30_50.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Uri30_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.MessageHeader; public class MessageHeader30_50 { @@ -158,46 +160,54 @@ public static org.hl7.fhir.r5.model.MessageHeader.MessageSourceComponent convert } static public org.hl7.fhir.r5.model.Enumeration convertResponseType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.MessageHeader.ResponseTypeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case OK: - tgt.setValue(org.hl7.fhir.r5.model.MessageHeader.ResponseType.OK); - break; - case TRANSIENTERROR: - tgt.setValue(org.hl7.fhir.r5.model.MessageHeader.ResponseType.TRANSIENTERROR); - break; - case FATALERROR: - tgt.setValue(org.hl7.fhir.r5.model.MessageHeader.ResponseType.FATALERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.MessageHeader.ResponseType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new MessageHeader.ResponseTypeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OK: + tgt.setValue(MessageHeader.ResponseType.OK); + break; + case TRANSIENTERROR: + tgt.setValue(MessageHeader.ResponseType.TRANSIENTERROR); + break; + case FATALERROR: + tgt.setValue(MessageHeader.ResponseType.FATALERROR); + break; + default: + tgt.setValue(MessageHeader.ResponseType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertResponseType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.MessageHeader.ResponseTypeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case OK: - tgt.setValue(org.hl7.fhir.dstu3.model.MessageHeader.ResponseType.OK); - break; - case TRANSIENTERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.MessageHeader.ResponseType.TRANSIENTERROR); - break; - case FATALERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.MessageHeader.ResponseType.FATALERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.MessageHeader.ResponseType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.MessageHeader.ResponseTypeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OK: + tgt.setValue(org.hl7.fhir.dstu3.model.MessageHeader.ResponseType.OK); + break; + case TRANSIENTERROR: + tgt.setValue(org.hl7.fhir.dstu3.model.MessageHeader.ResponseType.TRANSIENTERROR); + break; + case FATALERROR: + tgt.setValue(org.hl7.fhir.dstu3.model.MessageHeader.ResponseType.FATALERROR); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.MessageHeader.ResponseType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/NamingSystem30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/NamingSystem30_50.java index a3eb544184..a447457b57 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/NamingSystem30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/NamingSystem30_50.java @@ -15,6 +15,8 @@ import org.hl7.fhir.dstu3.model.StringType; import org.hl7.fhir.dstu3.model.UriType; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.NamingSystem; public class NamingSystem30_50 { @@ -104,97 +106,113 @@ public static org.hl7.fhir.r5.model.NamingSystem convertNamingSystem(org.hl7.fhi } static public org.hl7.fhir.r5.model.Enumeration convertNamingSystemIdentifierType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierTypeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case OID: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierType.OID); - break; - case UUID: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierType.UUID); - break; - case URI: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierType.URI); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierType.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new NamingSystem.NamingSystemIdentifierTypeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OID: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.OID); + break; + case UUID: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.UUID); + break; + case URI: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.URI); + break; + case OTHER: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.OTHER); + break; + default: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertNamingSystemIdentifierType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierTypeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case OID: - tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierType.OID); - break; - case UUID: - tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierType.UUID); - break; - case URI: - tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierType.URI); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierType.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierTypeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OID: + tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierType.OID); + break; + case UUID: + tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierType.UUID); + break; + case URI: + tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierType.URI); + break; + case OTHER: + tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierType.OTHER); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemIdentifierType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertNamingSystemType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.NamingSystem.NamingSystemTypeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case CODESYSTEM: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemType.CODESYSTEM); - break; - case IDENTIFIER: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemType.IDENTIFIER); - break; - case ROOT: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemType.ROOT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new NamingSystem.NamingSystemTypeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CODESYSTEM: + tgt.setValue(NamingSystem.NamingSystemType.CODESYSTEM); + break; + case IDENTIFIER: + tgt.setValue(NamingSystem.NamingSystemType.IDENTIFIER); + break; + case ROOT: + tgt.setValue(NamingSystem.NamingSystemType.ROOT); + break; + default: + tgt.setValue(NamingSystem.NamingSystemType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertNamingSystemType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemTypeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case CODESYSTEM: - tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemType.CODESYSTEM); - break; - case IDENTIFIER: - tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemType.IDENTIFIER); - break; - case ROOT: - tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemType.ROOT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemTypeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CODESYSTEM: + tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemType.CODESYSTEM); + break; + case IDENTIFIER: + tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemType.IDENTIFIER); + break; + case ROOT: + tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemType.ROOT); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.NamingSystem.NamingSystemUniqueIdComponent convertNamingSystemUniqueIdComponent(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemUniqueIdComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Observation30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Observation30_50.java index f872f2c3c0..fc5142b3a0 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Observation30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Observation30_50.java @@ -8,7 +8,10 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.SimpleQuantity30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Instant30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; +import org.hl7.fhir.dstu3.model.Observation; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; public class Observation30_50 { @@ -208,76 +211,84 @@ public static org.hl7.fhir.dstu3.model.Observation.ObservationRelatedComponent c } static public org.hl7.fhir.r5.model.Enumeration convertObservationStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ObservationStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.REGISTERED); - break; - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.AMENDED); - break; - case CORRECTED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.CORRECTED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ObservationStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(Enumerations.ObservationStatus.REGISTERED); + break; + case PRELIMINARY: + tgt.setValue(Enumerations.ObservationStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(Enumerations.ObservationStatus.FINAL); + break; + case AMENDED: + tgt.setValue(Enumerations.ObservationStatus.AMENDED); + break; + case CORRECTED: + tgt.setValue(Enumerations.ObservationStatus.CORRECTED); + break; + case CANCELLED: + tgt.setValue(Enumerations.ObservationStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.ObservationStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Enumerations.ObservationStatus.UNKNOWN); + break; + default: + tgt.setValue(Enumerations.ObservationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertObservationStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Observation.ObservationStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.dstu3.model.Observation.ObservationStatus.REGISTERED); - break; - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.dstu3.model.Observation.ObservationStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Observation.ObservationStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.dstu3.model.Observation.ObservationStatus.AMENDED); - break; - case CORRECTED: - tgt.setValue(org.hl7.fhir.dstu3.model.Observation.ObservationStatus.CORRECTED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu3.model.Observation.ObservationStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Observation.ObservationStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu3.model.Observation.ObservationStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Observation.ObservationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new Observation.ObservationStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(Observation.ObservationStatus.REGISTERED); + break; + case PRELIMINARY: + tgt.setValue(Observation.ObservationStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(Observation.ObservationStatus.FINAL); + break; + case AMENDED: + tgt.setValue(Observation.ObservationStatus.AMENDED); + break; + case CORRECTED: + tgt.setValue(Observation.ObservationStatus.CORRECTED); + break; + case CANCELLED: + tgt.setValue(Observation.ObservationStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(Observation.ObservationStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Observation.ObservationStatus.UNKNOWN); + break; + default: + tgt.setValue(Observation.ObservationStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/OperationDefinition30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/OperationDefinition30_50.java index 36c47db398..08f034a855 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/OperationDefinition30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/OperationDefinition30_50.java @@ -13,6 +13,7 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.MarkDown30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Uri30_50; +import org.hl7.fhir.dstu3.model.OperationDefinition; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.DataType; import org.hl7.fhir.r5.model.Enumeration; @@ -242,78 +243,94 @@ public static org.hl7.fhir.dstu3.model.OperationDefinition.OperationDefinitionPa } static public org.hl7.fhir.dstu3.model.Enumeration convertOperationKind(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.OperationDefinition.OperationKindEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case OPERATION: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationDefinition.OperationKind.OPERATION); - break; - case QUERY: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationDefinition.OperationKind.QUERY); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationDefinition.OperationKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new OperationDefinition.OperationKindEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OPERATION: + tgt.setValue(OperationDefinition.OperationKind.OPERATION); + break; + case QUERY: + tgt.setValue(OperationDefinition.OperationKind.QUERY); + break; + default: + tgt.setValue(OperationDefinition.OperationKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertOperationKind(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.OperationDefinition.OperationKindEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case OPERATION: - tgt.setValue(org.hl7.fhir.r5.model.OperationDefinition.OperationKind.OPERATION); - break; - case QUERY: - tgt.setValue(org.hl7.fhir.r5.model.OperationDefinition.OperationKind.QUERY); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.OperationDefinition.OperationKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new org.hl7.fhir.r5.model.OperationDefinition.OperationKindEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OPERATION: + tgt.setValue(org.hl7.fhir.r5.model.OperationDefinition.OperationKind.OPERATION); + break; + case QUERY: + tgt.setValue(org.hl7.fhir.r5.model.OperationDefinition.OperationKind.QUERY); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.OperationDefinition.OperationKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertOperationParameterUse(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.OperationParameterUseEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case IN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.OperationParameterUse.IN); - break; - case OUT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.OperationParameterUse.OUT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.OperationParameterUse.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.OperationParameterUseEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case IN: + tgt.setValue(Enumerations.OperationParameterUse.IN); + break; + case OUT: + tgt.setValue(Enumerations.OperationParameterUse.OUT); + break; + default: + tgt.setValue(Enumerations.OperationParameterUse.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertOperationParameterUse(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.OperationDefinition.OperationParameterUseEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case IN: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationDefinition.OperationParameterUse.IN); - break; - case OUT: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationDefinition.OperationParameterUse.OUT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationDefinition.OperationParameterUse.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new OperationDefinition.OperationParameterUseEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case IN: + tgt.setValue(OperationDefinition.OperationParameterUse.IN); + break; + case OUT: + tgt.setValue(OperationDefinition.OperationParameterUse.OUT); + break; + default: + tgt.setValue(OperationDefinition.OperationParameterUse.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/OperationOutcome30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/OperationOutcome30_50.java index 66c52c4a0a..0d9c3313ae 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/OperationOutcome30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/OperationOutcome30_50.java @@ -3,258 +3,276 @@ import org.hl7.fhir.convertors.context.ConversionContext30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.CodeableConcept30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.OperationOutcome; import org.hl7.fhir.exceptions.FHIRException; public class OperationOutcome30_50 { static public org.hl7.fhir.dstu3.model.Enumeration convertIssueSeverity(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverityEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case FATAL: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverity.FATAL); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverity.ERROR); - break; - case WARNING: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverity.WARNING); - break; - case INFORMATION: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverity.INFORMATION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverity.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new OperationOutcome.IssueSeverityEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FATAL: + tgt.setValue(OperationOutcome.IssueSeverity.FATAL); + break; + case ERROR: + tgt.setValue(OperationOutcome.IssueSeverity.ERROR); + break; + case WARNING: + tgt.setValue(OperationOutcome.IssueSeverity.WARNING); + break; + case INFORMATION: + tgt.setValue(OperationOutcome.IssueSeverity.INFORMATION); + break; + default: + tgt.setValue(OperationOutcome.IssueSeverity.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertIssueSeverity(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.OperationOutcome.IssueSeverityEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case FATAL: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.FATAL); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.ERROR); - break; - case WARNING: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.WARNING); - break; - case INFORMATION: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.INFORMATION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.OperationOutcome.IssueSeverityEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FATAL: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.FATAL); + break; + case ERROR: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.ERROR); + break; + case WARNING: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.WARNING); + break; + case INFORMATION: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.INFORMATION); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertIssueType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.OperationOutcome.IssueTypeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case INVALID: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.INVALID); - break; - case STRUCTURE: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.STRUCTURE); - break; - case REQUIRED: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.REQUIRED); - break; - case VALUE: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.VALUE); - break; - case INVARIANT: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.INVARIANT); - break; - case SECURITY: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.SECURITY); - break; - case LOGIN: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.LOGIN); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.UNKNOWN); - break; - case EXPIRED: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.EXPIRED); - break; - case FORBIDDEN: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.FORBIDDEN); - break; - case SUPPRESSED: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.SUPPRESSED); - break; - case PROCESSING: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.PROCESSING); - break; - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.NOTSUPPORTED); - break; - case DUPLICATE: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.DUPLICATE); - break; - case NOTFOUND: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.NOTFOUND); - break; - case TOOLONG: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.TOOLONG); - break; - case CODEINVALID: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.CODEINVALID); - break; - case EXTENSION: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.EXTENSION); - break; - case TOOCOSTLY: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.TOOCOSTLY); - break; - case BUSINESSRULE: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.BUSINESSRULE); - break; - case CONFLICT: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.CONFLICT); - break; - case INCOMPLETE: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.INCOMPLETE); - break; - case TRANSIENT: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.TRANSIENT); - break; - case LOCKERROR: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.LOCKERROR); - break; - case NOSTORE: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.NOSTORE); - break; - case EXCEPTION: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.EXCEPTION); - break; - case TIMEOUT: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.TIMEOUT); - break; - case THROTTLED: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.THROTTLED); - break; - case INFORMATIONAL: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.INFORMATIONAL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.OperationOutcome.IssueTypeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INVALID: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.INVALID); + break; + case STRUCTURE: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.STRUCTURE); + break; + case REQUIRED: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.REQUIRED); + break; + case VALUE: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.VALUE); + break; + case INVARIANT: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.INVARIANT); + break; + case SECURITY: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.SECURITY); + break; + case LOGIN: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.LOGIN); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.UNKNOWN); + break; + case EXPIRED: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.EXPIRED); + break; + case FORBIDDEN: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.FORBIDDEN); + break; + case SUPPRESSED: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.SUPPRESSED); + break; + case PROCESSING: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.PROCESSING); + break; + case NOTSUPPORTED: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.NOTSUPPORTED); + break; + case DUPLICATE: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.DUPLICATE); + break; + case NOTFOUND: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.NOTFOUND); + break; + case TOOLONG: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.TOOLONG); + break; + case CODEINVALID: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.CODEINVALID); + break; + case EXTENSION: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.EXTENSION); + break; + case TOOCOSTLY: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.TOOCOSTLY); + break; + case BUSINESSRULE: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.BUSINESSRULE); + break; + case CONFLICT: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.CONFLICT); + break; + case INCOMPLETE: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.INCOMPLETE); + break; + case TRANSIENT: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.TRANSIENT); + break; + case LOCKERROR: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.LOCKERROR); + break; + case NOSTORE: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.NOSTORE); + break; + case EXCEPTION: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.EXCEPTION); + break; + case TIMEOUT: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.TIMEOUT); + break; + case THROTTLED: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.THROTTLED); + break; + case INFORMATIONAL: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.INFORMATIONAL); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertIssueType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.OperationOutcome.IssueTypeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case INVALID: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.INVALID); - break; - case STRUCTURE: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.STRUCTURE); - break; - case REQUIRED: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.REQUIRED); - break; - case VALUE: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.VALUE); - break; - case INVARIANT: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.INVARIANT); - break; - case SECURITY: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.SECURITY); - break; - case LOGIN: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.LOGIN); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.UNKNOWN); - break; - case EXPIRED: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.EXPIRED); - break; - case FORBIDDEN: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.FORBIDDEN); - break; - case SUPPRESSED: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.SUPPRESSED); - break; - case PROCESSING: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.PROCESSING); - break; - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.NOTSUPPORTED); - break; - case DUPLICATE: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.DUPLICATE); - break; - case NOTFOUND: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.NOTFOUND); - break; - case TOOLONG: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.TOOLONG); - break; - case CODEINVALID: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.CODEINVALID); - break; - case EXTENSION: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.EXTENSION); - break; - case TOOCOSTLY: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.TOOCOSTLY); - break; - case BUSINESSRULE: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.BUSINESSRULE); - break; - case CONFLICT: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.CONFLICT); - break; - case INCOMPLETE: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.INCOMPLETE); - break; - case TRANSIENT: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.TRANSIENT); - break; - case LOCKERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.LOCKERROR); - break; - case NOSTORE: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.NOSTORE); - break; - case EXCEPTION: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.EXCEPTION); - break; - case TIMEOUT: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.TIMEOUT); - break; - case THROTTLED: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.THROTTLED); - break; - case INFORMATIONAL: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.INFORMATIONAL); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new OperationOutcome.IssueTypeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INVALID: + tgt.setValue(OperationOutcome.IssueType.INVALID); + break; + case STRUCTURE: + tgt.setValue(OperationOutcome.IssueType.STRUCTURE); + break; + case REQUIRED: + tgt.setValue(OperationOutcome.IssueType.REQUIRED); + break; + case VALUE: + tgt.setValue(OperationOutcome.IssueType.VALUE); + break; + case INVARIANT: + tgt.setValue(OperationOutcome.IssueType.INVARIANT); + break; + case SECURITY: + tgt.setValue(OperationOutcome.IssueType.SECURITY); + break; + case LOGIN: + tgt.setValue(OperationOutcome.IssueType.LOGIN); + break; + case UNKNOWN: + tgt.setValue(OperationOutcome.IssueType.UNKNOWN); + break; + case EXPIRED: + tgt.setValue(OperationOutcome.IssueType.EXPIRED); + break; + case FORBIDDEN: + tgt.setValue(OperationOutcome.IssueType.FORBIDDEN); + break; + case SUPPRESSED: + tgt.setValue(OperationOutcome.IssueType.SUPPRESSED); + break; + case PROCESSING: + tgt.setValue(OperationOutcome.IssueType.PROCESSING); + break; + case NOTSUPPORTED: + tgt.setValue(OperationOutcome.IssueType.NOTSUPPORTED); + break; + case DUPLICATE: + tgt.setValue(OperationOutcome.IssueType.DUPLICATE); + break; + case NOTFOUND: + tgt.setValue(OperationOutcome.IssueType.NOTFOUND); + break; + case TOOLONG: + tgt.setValue(OperationOutcome.IssueType.TOOLONG); + break; + case CODEINVALID: + tgt.setValue(OperationOutcome.IssueType.CODEINVALID); + break; + case EXTENSION: + tgt.setValue(OperationOutcome.IssueType.EXTENSION); + break; + case TOOCOSTLY: + tgt.setValue(OperationOutcome.IssueType.TOOCOSTLY); + break; + case BUSINESSRULE: + tgt.setValue(OperationOutcome.IssueType.BUSINESSRULE); + break; + case CONFLICT: + tgt.setValue(OperationOutcome.IssueType.CONFLICT); + break; + case INCOMPLETE: + tgt.setValue(OperationOutcome.IssueType.INCOMPLETE); + break; + case TRANSIENT: + tgt.setValue(OperationOutcome.IssueType.TRANSIENT); + break; + case LOCKERROR: + tgt.setValue(OperationOutcome.IssueType.LOCKERROR); + break; + case NOSTORE: + tgt.setValue(OperationOutcome.IssueType.NOSTORE); + break; + case EXCEPTION: + tgt.setValue(OperationOutcome.IssueType.EXCEPTION); + break; + case TIMEOUT: + tgt.setValue(OperationOutcome.IssueType.TIMEOUT); + break; + case THROTTLED: + tgt.setValue(OperationOutcome.IssueType.THROTTLED); + break; + case INFORMATIONAL: + tgt.setValue(OperationOutcome.IssueType.INFORMATIONAL); + break; + default: + tgt.setValue(OperationOutcome.IssueType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.OperationOutcome convertOperationOutcome(org.hl7.fhir.dstu3.model.OperationOutcome src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Patient30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Patient30_50.java index 98ac4f92e6..e80c0afaba 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Patient30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Patient30_50.java @@ -11,6 +11,8 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.Period30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Boolean30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Date30_50; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.Patient; import org.hl7.fhir.exceptions.FHIRException; public class Patient30_50 { @@ -89,53 +91,61 @@ public static org.hl7.fhir.dstu3.model.Patient.ContactComponent convertContactCo } static public org.hl7.fhir.dstu3.model.Enumeration convertLinkType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Patient.LinkTypeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case REPLACEDBY: - tgt.setValue(org.hl7.fhir.dstu3.model.Patient.LinkType.REPLACEDBY); - break; - case REPLACES: - tgt.setValue(org.hl7.fhir.dstu3.model.Patient.LinkType.REPLACES); - break; - case REFER: - tgt.setValue(org.hl7.fhir.dstu3.model.Patient.LinkType.REFER); - break; - case SEEALSO: - tgt.setValue(org.hl7.fhir.dstu3.model.Patient.LinkType.SEEALSO); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Patient.LinkType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Patient.LinkTypeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REPLACEDBY: + tgt.setValue(Patient.LinkType.REPLACEDBY); + break; + case REPLACES: + tgt.setValue(Patient.LinkType.REPLACES); + break; + case REFER: + tgt.setValue(Patient.LinkType.REFER); + break; + case SEEALSO: + tgt.setValue(Patient.LinkType.SEEALSO); + break; + default: + tgt.setValue(Patient.LinkType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertLinkType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Patient.LinkTypeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case REPLACEDBY: - tgt.setValue(org.hl7.fhir.r5.model.Patient.LinkType.REPLACEDBY); - break; - case REPLACES: - tgt.setValue(org.hl7.fhir.r5.model.Patient.LinkType.REPLACES); - break; - case REFER: - tgt.setValue(org.hl7.fhir.r5.model.Patient.LinkType.REFER); - break; - case SEEALSO: - tgt.setValue(org.hl7.fhir.r5.model.Patient.LinkType.SEEALSO); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Patient.LinkType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Patient.LinkTypeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REPLACEDBY: + tgt.setValue(org.hl7.fhir.r5.model.Patient.LinkType.REPLACEDBY); + break; + case REPLACES: + tgt.setValue(org.hl7.fhir.r5.model.Patient.LinkType.REPLACES); + break; + case REFER: + tgt.setValue(org.hl7.fhir.r5.model.Patient.LinkType.REFER); + break; + case SEEALSO: + tgt.setValue(org.hl7.fhir.r5.model.Patient.LinkType.SEEALSO); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.Patient.LinkType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Patient convertPatient(org.hl7.fhir.dstu3.model.Patient src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/PaymentNotice30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/PaymentNotice30_50.java index cc1ca428ec..e03bfe33f3 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/PaymentNotice30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/PaymentNotice30_50.java @@ -6,7 +6,10 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.Identifier30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Date30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.DateTime30_50; +import org.hl7.fhir.dstu3.model.PaymentNotice; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; public class PaymentNotice30_50 { @@ -63,52 +66,60 @@ public static org.hl7.fhir.r5.model.PaymentNotice convertPaymentNotice(org.hl7.f } static public org.hl7.fhir.r5.model.Enumeration convertPaymentNoticeStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodesEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.CANCELLED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.FinancialResourceStatusCodesEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.ACTIVE); + break; + case CANCELLED: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.CANCELLED); + break; + case DRAFT: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); + break; + default: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertPaymentNoticeStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.PaymentNotice.PaymentNoticeStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.PaymentNotice.PaymentNoticeStatus.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu3.model.PaymentNotice.PaymentNoticeStatus.CANCELLED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.dstu3.model.PaymentNotice.PaymentNoticeStatus.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.PaymentNotice.PaymentNoticeStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.PaymentNotice.PaymentNoticeStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new PaymentNotice.PaymentNoticeStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(PaymentNotice.PaymentNoticeStatus.ACTIVE); + break; + case CANCELLED: + tgt.setValue(PaymentNotice.PaymentNoticeStatus.CANCELLED); + break; + case DRAFT: + tgt.setValue(PaymentNotice.PaymentNoticeStatus.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(PaymentNotice.PaymentNoticeStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(PaymentNotice.PaymentNoticeStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Person30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Person30_50.java index ed1bc8adf5..8c35c5b036 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Person30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Person30_50.java @@ -9,58 +9,68 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.Identifier30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Boolean30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Date30_50; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.Person; import org.hl7.fhir.exceptions.FHIRException; public class Person30_50 { static public org.hl7.fhir.dstu3.model.Enumeration convertIdentityAssuranceLevel(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Person.IdentityAssuranceLevelEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case LEVEL1: - tgt.setValue(org.hl7.fhir.dstu3.model.Person.IdentityAssuranceLevel.LEVEL1); - break; - case LEVEL2: - tgt.setValue(org.hl7.fhir.dstu3.model.Person.IdentityAssuranceLevel.LEVEL2); - break; - case LEVEL3: - tgt.setValue(org.hl7.fhir.dstu3.model.Person.IdentityAssuranceLevel.LEVEL3); - break; - case LEVEL4: - tgt.setValue(org.hl7.fhir.dstu3.model.Person.IdentityAssuranceLevel.LEVEL4); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Person.IdentityAssuranceLevel.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Person.IdentityAssuranceLevelEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case LEVEL1: + tgt.setValue(Person.IdentityAssuranceLevel.LEVEL1); + break; + case LEVEL2: + tgt.setValue(Person.IdentityAssuranceLevel.LEVEL2); + break; + case LEVEL3: + tgt.setValue(Person.IdentityAssuranceLevel.LEVEL3); + break; + case LEVEL4: + tgt.setValue(Person.IdentityAssuranceLevel.LEVEL4); + break; + default: + tgt.setValue(Person.IdentityAssuranceLevel.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertIdentityAssuranceLevel(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Person.IdentityAssuranceLevelEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case LEVEL1: - tgt.setValue(org.hl7.fhir.r5.model.Person.IdentityAssuranceLevel.LEVEL1); - break; - case LEVEL2: - tgt.setValue(org.hl7.fhir.r5.model.Person.IdentityAssuranceLevel.LEVEL2); - break; - case LEVEL3: - tgt.setValue(org.hl7.fhir.r5.model.Person.IdentityAssuranceLevel.LEVEL3); - break; - case LEVEL4: - tgt.setValue(org.hl7.fhir.r5.model.Person.IdentityAssuranceLevel.LEVEL4); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Person.IdentityAssuranceLevel.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Person.IdentityAssuranceLevelEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case LEVEL1: + tgt.setValue(org.hl7.fhir.r5.model.Person.IdentityAssuranceLevel.LEVEL1); + break; + case LEVEL2: + tgt.setValue(org.hl7.fhir.r5.model.Person.IdentityAssuranceLevel.LEVEL2); + break; + case LEVEL3: + tgt.setValue(org.hl7.fhir.r5.model.Person.IdentityAssuranceLevel.LEVEL3); + break; + case LEVEL4: + tgt.setValue(org.hl7.fhir.r5.model.Person.IdentityAssuranceLevel.LEVEL4); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.Person.IdentityAssuranceLevel.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.Person convertPerson(org.hl7.fhir.r5.model.Person src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/PlanDefinition30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/PlanDefinition30_50.java index ec8be925a9..77f3b8b9a4 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/PlanDefinition30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/PlanDefinition30_50.java @@ -21,405 +21,472 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Uri30_50; import org.hl7.fhir.dstu3.model.ContactDetail; import org.hl7.fhir.dstu3.model.Contributor.ContributorType; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.PlanDefinition; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.DataRequirement; +import org.hl7.fhir.r5.model.Enumerations; import org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionInputComponent; import org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionOutputComponent; public class PlanDefinition30_50 { static public org.hl7.fhir.dstu3.model.Enumeration convertActionCardinalityBehavior(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.PlanDefinition.ActionCardinalityBehaviorEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case SINGLE: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionCardinalityBehavior.SINGLE); - break; - case MULTIPLE: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionCardinalityBehavior.MULTIPLE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionCardinalityBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new PlanDefinition.ActionCardinalityBehaviorEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SINGLE: + tgt.setValue(PlanDefinition.ActionCardinalityBehavior.SINGLE); + break; + case MULTIPLE: + tgt.setValue(PlanDefinition.ActionCardinalityBehavior.MULTIPLE); + break; + default: + tgt.setValue(PlanDefinition.ActionCardinalityBehavior.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertActionCardinalityBehavior(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ActionCardinalityBehaviorEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case SINGLE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionCardinalityBehavior.SINGLE); - break; - case MULTIPLE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionCardinalityBehavior.MULTIPLE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionCardinalityBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new Enumerations.ActionCardinalityBehaviorEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SINGLE: + tgt.setValue(Enumerations.ActionCardinalityBehavior.SINGLE); + break; + case MULTIPLE: + tgt.setValue(Enumerations.ActionCardinalityBehavior.MULTIPLE); + break; + default: + tgt.setValue(Enumerations.ActionCardinalityBehavior.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertActionConditionKind(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ActionConditionKindEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case APPLICABILITY: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionConditionKind.APPLICABILITY); - break; - case START: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionConditionKind.START); - break; - case STOP: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionConditionKind.STOP); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionConditionKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new Enumerations.ActionConditionKindEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case APPLICABILITY: + tgt.setValue(Enumerations.ActionConditionKind.APPLICABILITY); + break; + case START: + tgt.setValue(Enumerations.ActionConditionKind.START); + break; + case STOP: + tgt.setValue(Enumerations.ActionConditionKind.STOP); + break; + default: + tgt.setValue(Enumerations.ActionConditionKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertActionConditionKind(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.PlanDefinition.ActionConditionKindEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case APPLICABILITY: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionConditionKind.APPLICABILITY); - break; - case START: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionConditionKind.START); - break; - case STOP: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionConditionKind.STOP); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionConditionKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new PlanDefinition.ActionConditionKindEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case APPLICABILITY: + tgt.setValue(PlanDefinition.ActionConditionKind.APPLICABILITY); + break; + case START: + tgt.setValue(PlanDefinition.ActionConditionKind.START); + break; + case STOP: + tgt.setValue(PlanDefinition.ActionConditionKind.STOP); + break; + default: + tgt.setValue(PlanDefinition.ActionConditionKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertActionGroupingBehavior(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehaviorEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case VISUALGROUP: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior.VISUALGROUP); - break; - case LOGICALGROUP: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior.LOGICALGROUP); - break; - case SENTENCEGROUP: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior.SENTENCEGROUP); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new Enumerations.ActionGroupingBehaviorEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case VISUALGROUP: + tgt.setValue(Enumerations.ActionGroupingBehavior.VISUALGROUP); + break; + case LOGICALGROUP: + tgt.setValue(Enumerations.ActionGroupingBehavior.LOGICALGROUP); + break; + case SENTENCEGROUP: + tgt.setValue(Enumerations.ActionGroupingBehavior.SENTENCEGROUP); + break; + default: + tgt.setValue(Enumerations.ActionGroupingBehavior.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertActionGroupingBehavior(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.PlanDefinition.ActionGroupingBehaviorEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case VISUALGROUP: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionGroupingBehavior.VISUALGROUP); - break; - case LOGICALGROUP: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionGroupingBehavior.LOGICALGROUP); - break; - case SENTENCEGROUP: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionGroupingBehavior.SENTENCEGROUP); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionGroupingBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new PlanDefinition.ActionGroupingBehaviorEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case VISUALGROUP: + tgt.setValue(PlanDefinition.ActionGroupingBehavior.VISUALGROUP); + break; + case LOGICALGROUP: + tgt.setValue(PlanDefinition.ActionGroupingBehavior.LOGICALGROUP); + break; + case SENTENCEGROUP: + tgt.setValue(PlanDefinition.ActionGroupingBehavior.SENTENCEGROUP); + break; + default: + tgt.setValue(PlanDefinition.ActionGroupingBehavior.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertActionParticipantType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ActionParticipantTypeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PATIENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.PATIENT); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.PRACTITIONER); - break; - case RELATEDPERSON: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.RELATEDPERSON); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new Enumerations.ActionParticipantTypeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PATIENT: + tgt.setValue(Enumerations.ActionParticipantType.PATIENT); + break; + case PRACTITIONER: + tgt.setValue(Enumerations.ActionParticipantType.PRACTITIONER); + break; + case RELATEDPERSON: + tgt.setValue(Enumerations.ActionParticipantType.RELATEDPERSON); + break; + default: + tgt.setValue(Enumerations.ActionParticipantType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertActionParticipantType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.PlanDefinition.ActionParticipantTypeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PATIENT: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionParticipantType.PATIENT); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionParticipantType.PRACTITIONER); - break; - case RELATEDPERSON: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionParticipantType.RELATEDPERSON); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionParticipantType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new PlanDefinition.ActionParticipantTypeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PATIENT: + tgt.setValue(PlanDefinition.ActionParticipantType.PATIENT); + break; + case PRACTITIONER: + tgt.setValue(PlanDefinition.ActionParticipantType.PRACTITIONER); + break; + case RELATEDPERSON: + tgt.setValue(PlanDefinition.ActionParticipantType.RELATEDPERSON); + break; + default: + tgt.setValue(PlanDefinition.ActionParticipantType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertActionPrecheckBehavior(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.PlanDefinition.ActionPrecheckBehaviorEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case YES: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionPrecheckBehavior.YES); - break; - case NO: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionPrecheckBehavior.NO); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionPrecheckBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new PlanDefinition.ActionPrecheckBehaviorEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case YES: + tgt.setValue(PlanDefinition.ActionPrecheckBehavior.YES); + break; + case NO: + tgt.setValue(PlanDefinition.ActionPrecheckBehavior.NO); + break; + default: + tgt.setValue(PlanDefinition.ActionPrecheckBehavior.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertActionPrecheckBehavior(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ActionPrecheckBehaviorEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case YES: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionPrecheckBehavior.YES); - break; - case NO: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionPrecheckBehavior.NO); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionPrecheckBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new Enumerations.ActionPrecheckBehaviorEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case YES: + tgt.setValue(Enumerations.ActionPrecheckBehavior.YES); + break; + case NO: + tgt.setValue(Enumerations.ActionPrecheckBehavior.NO); + break; + default: + tgt.setValue(Enumerations.ActionPrecheckBehavior.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertActionRelationshipType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ActionRelationshipTypeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case BEFORESTART: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.BEFORESTART); - break; - case BEFORE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.BEFORE); - break; - case BEFOREEND: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.BEFOREEND); - break; - case CONCURRENTWITHSTART: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.CONCURRENTWITHSTART); - break; - case CONCURRENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.CONCURRENT); - break; - case CONCURRENTWITHEND: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.CONCURRENTWITHEND); - break; - case AFTERSTART: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.AFTERSTART); - break; - case AFTER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.AFTER); - break; - case AFTEREND: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.AFTEREND); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new Enumerations.ActionRelationshipTypeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case BEFORESTART: + tgt.setValue(Enumerations.ActionRelationshipType.BEFORESTART); + break; + case BEFORE: + tgt.setValue(Enumerations.ActionRelationshipType.BEFORE); + break; + case BEFOREEND: + tgt.setValue(Enumerations.ActionRelationshipType.BEFOREEND); + break; + case CONCURRENTWITHSTART: + tgt.setValue(Enumerations.ActionRelationshipType.CONCURRENTWITHSTART); + break; + case CONCURRENT: + tgt.setValue(Enumerations.ActionRelationshipType.CONCURRENT); + break; + case CONCURRENTWITHEND: + tgt.setValue(Enumerations.ActionRelationshipType.CONCURRENTWITHEND); + break; + case AFTERSTART: + tgt.setValue(Enumerations.ActionRelationshipType.AFTERSTART); + break; + case AFTER: + tgt.setValue(Enumerations.ActionRelationshipType.AFTER); + break; + case AFTEREND: + tgt.setValue(Enumerations.ActionRelationshipType.AFTEREND); + break; + default: + tgt.setValue(Enumerations.ActionRelationshipType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertActionRelationshipType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.PlanDefinition.ActionRelationshipTypeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case BEFORESTART: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRelationshipType.BEFORESTART); - break; - case BEFORE: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRelationshipType.BEFORE); - break; - case BEFOREEND: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRelationshipType.BEFOREEND); - break; - case CONCURRENTWITHSTART: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRelationshipType.CONCURRENTWITHSTART); - break; - case CONCURRENT: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRelationshipType.CONCURRENT); - break; - case CONCURRENTWITHEND: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRelationshipType.CONCURRENTWITHEND); - break; - case AFTERSTART: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRelationshipType.AFTERSTART); - break; - case AFTER: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRelationshipType.AFTER); - break; - case AFTEREND: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRelationshipType.AFTEREND); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRelationshipType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new PlanDefinition.ActionRelationshipTypeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case BEFORESTART: + tgt.setValue(PlanDefinition.ActionRelationshipType.BEFORESTART); + break; + case BEFORE: + tgt.setValue(PlanDefinition.ActionRelationshipType.BEFORE); + break; + case BEFOREEND: + tgt.setValue(PlanDefinition.ActionRelationshipType.BEFOREEND); + break; + case CONCURRENTWITHSTART: + tgt.setValue(PlanDefinition.ActionRelationshipType.CONCURRENTWITHSTART); + break; + case CONCURRENT: + tgt.setValue(PlanDefinition.ActionRelationshipType.CONCURRENT); + break; + case CONCURRENTWITHEND: + tgt.setValue(PlanDefinition.ActionRelationshipType.CONCURRENTWITHEND); + break; + case AFTERSTART: + tgt.setValue(PlanDefinition.ActionRelationshipType.AFTERSTART); + break; + case AFTER: + tgt.setValue(PlanDefinition.ActionRelationshipType.AFTER); + break; + case AFTEREND: + tgt.setValue(PlanDefinition.ActionRelationshipType.AFTEREND); + break; + default: + tgt.setValue(PlanDefinition.ActionRelationshipType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertActionRequiredBehavior(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.PlanDefinition.ActionRequiredBehaviorEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case MUST: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRequiredBehavior.MUST); - break; - case COULD: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRequiredBehavior.COULD); - break; - case MUSTUNLESSDOCUMENTED: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRequiredBehavior.MUSTUNLESSDOCUMENTED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionRequiredBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new PlanDefinition.ActionRequiredBehaviorEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MUST: + tgt.setValue(PlanDefinition.ActionRequiredBehavior.MUST); + break; + case COULD: + tgt.setValue(PlanDefinition.ActionRequiredBehavior.COULD); + break; + case MUSTUNLESSDOCUMENTED: + tgt.setValue(PlanDefinition.ActionRequiredBehavior.MUSTUNLESSDOCUMENTED); + break; + default: + tgt.setValue(PlanDefinition.ActionRequiredBehavior.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertActionRequiredBehavior(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehaviorEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case MUST: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior.MUST); - break; - case COULD: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior.COULD); - break; - case MUSTUNLESSDOCUMENTED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior.MUSTUNLESSDOCUMENTED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new Enumerations.ActionRequiredBehaviorEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MUST: + tgt.setValue(Enumerations.ActionRequiredBehavior.MUST); + break; + case COULD: + tgt.setValue(Enumerations.ActionRequiredBehavior.COULD); + break; + case MUSTUNLESSDOCUMENTED: + tgt.setValue(Enumerations.ActionRequiredBehavior.MUSTUNLESSDOCUMENTED); + break; + default: + tgt.setValue(Enumerations.ActionRequiredBehavior.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertActionSelectionBehavior(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehaviorEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case ANY: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.ANY); - break; - case ALL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.ALL); - break; - case ALLORNONE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.ALLORNONE); - break; - case EXACTLYONE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.EXACTLYONE); - break; - case ATMOSTONE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.ATMOSTONE); - break; - case ONEORMORE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.ONEORMORE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new Enumerations.ActionSelectionBehaviorEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ANY: + tgt.setValue(Enumerations.ActionSelectionBehavior.ANY); + break; + case ALL: + tgt.setValue(Enumerations.ActionSelectionBehavior.ALL); + break; + case ALLORNONE: + tgt.setValue(Enumerations.ActionSelectionBehavior.ALLORNONE); + break; + case EXACTLYONE: + tgt.setValue(Enumerations.ActionSelectionBehavior.EXACTLYONE); + break; + case ATMOSTONE: + tgt.setValue(Enumerations.ActionSelectionBehavior.ATMOSTONE); + break; + case ONEORMORE: + tgt.setValue(Enumerations.ActionSelectionBehavior.ONEORMORE); + break; + default: + tgt.setValue(Enumerations.ActionSelectionBehavior.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertActionSelectionBehavior(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.PlanDefinition.ActionSelectionBehaviorEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case ANY: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionSelectionBehavior.ANY); - break; - case ALL: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionSelectionBehavior.ALL); - break; - case ALLORNONE: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionSelectionBehavior.ALLORNONE); - break; - case EXACTLYONE: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionSelectionBehavior.EXACTLYONE); - break; - case ATMOSTONE: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionSelectionBehavior.ATMOSTONE); - break; - case ONEORMORE: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionSelectionBehavior.ONEORMORE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.PlanDefinition.ActionSelectionBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new PlanDefinition.ActionSelectionBehaviorEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ANY: + tgt.setValue(PlanDefinition.ActionSelectionBehavior.ANY); + break; + case ALL: + tgt.setValue(PlanDefinition.ActionSelectionBehavior.ALL); + break; + case ALLORNONE: + tgt.setValue(PlanDefinition.ActionSelectionBehavior.ALLORNONE); + break; + case EXACTLYONE: + tgt.setValue(PlanDefinition.ActionSelectionBehavior.EXACTLYONE); + break; + case ATMOSTONE: + tgt.setValue(PlanDefinition.ActionSelectionBehavior.ATMOSTONE); + break; + case ONEORMORE: + tgt.setValue(PlanDefinition.ActionSelectionBehavior.ONEORMORE); + break; + default: + tgt.setValue(PlanDefinition.ActionSelectionBehavior.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.PlanDefinition convertPlanDefinition(org.hl7.fhir.r5.model.PlanDefinition src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Provenance30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Provenance30_50.java index c823115cc6..37fe0b0ad8 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Provenance30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Provenance30_50.java @@ -11,6 +11,8 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Uri30_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Provenance; /* Copyright (c) 2011+, HL7, Inc. @@ -153,58 +155,66 @@ public static org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityComponent conv } static public org.hl7.fhir.r5.model.Enumeration convertProvenanceEntityRole(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRoleEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case DERIVATION: - tgt.setValue(org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRole.INSTANTIATES); - break; - case REVISION: - tgt.setValue(org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRole.REVISION); - break; - case QUOTATION: - tgt.setValue(org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRole.QUOTATION); - break; - case SOURCE: - tgt.setValue(org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRole.SOURCE); - break; - case REMOVAL: - tgt.setValue(org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRole.REMOVAL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRole.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Provenance.ProvenanceEntityRoleEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DERIVATION: + tgt.setValue(Provenance.ProvenanceEntityRole.INSTANTIATES); + break; + case REVISION: + tgt.setValue(Provenance.ProvenanceEntityRole.REVISION); + break; + case QUOTATION: + tgt.setValue(Provenance.ProvenanceEntityRole.QUOTATION); + break; + case SOURCE: + tgt.setValue(Provenance.ProvenanceEntityRole.SOURCE); + break; + case REMOVAL: + tgt.setValue(Provenance.ProvenanceEntityRole.REMOVAL); + break; + default: + tgt.setValue(Provenance.ProvenanceEntityRole.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertProvenanceEntityRole(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityRoleEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANTIATES: - tgt.setValue(org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityRole.DERIVATION); - break; - case REVISION: - tgt.setValue(org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityRole.REVISION); - break; - case QUOTATION: - tgt.setValue(org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityRole.QUOTATION); - break; - case SOURCE: - tgt.setValue(org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityRole.SOURCE); - break; - case REMOVAL: - tgt.setValue(org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityRole.REMOVAL); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityRole.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityRoleEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANTIATES: + tgt.setValue(org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityRole.DERIVATION); + break; + case REVISION: + tgt.setValue(org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityRole.REVISION); + break; + case QUOTATION: + tgt.setValue(org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityRole.QUOTATION); + break; + case SOURCE: + tgt.setValue(org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityRole.SOURCE); + break; + case REMOVAL: + tgt.setValue(org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityRole.REMOVAL); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityRole.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Questionnaire30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Questionnaire30_50.java index b27ad9d07e..7fdb58d67e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Questionnaire30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Questionnaire30_50.java @@ -20,6 +20,7 @@ import org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeType; +import org.hl7.fhir.r5.model.Enumeration; import org.hl7.fhir.r5.model.Questionnaire; import org.hl7.fhir.r5.model.Questionnaire.QuestionnaireAnswerConstraint; @@ -266,122 +267,130 @@ static public org.hl7.fhir.dstu3.model.Enumeration convertQuestionnaireItemType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemTypeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - tgt.addExtension(VersionConvertorConstants.EXT_QUESTIONNAIRE_ITEM_TYPE_ORIGINAL, new CodeType(src.getValueAsString())); - switch (src.getValue()) { - case GROUP: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.GROUP); - break; - case DISPLAY: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.DISPLAY); - break; - case BOOLEAN: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.BOOLEAN); - break; - case DECIMAL: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.DECIMAL); - break; - case INTEGER: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.INTEGER); - break; - case DATE: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.DATE); - break; - case DATETIME: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.DATETIME); - break; - case TIME: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.TIME); - break; - case STRING: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.STRING); - break; - case TEXT: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.TEXT); - break; - case URL: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.URL); - break; - case CHOICE: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.CODING); - break; - case OPENCHOICE: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.CODING); - break; - case ATTACHMENT: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.ATTACHMENT); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.REFERENCE); - break; - case QUANTITY: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.QUANTITY); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Questionnaire.QuestionnaireItemTypeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + tgt.addExtension(VersionConvertorConstants.EXT_QUESTIONNAIRE_ITEM_TYPE_ORIGINAL, new CodeType(src.getValueAsString())); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case GROUP: + tgt.setValue(Questionnaire.QuestionnaireItemType.GROUP); + break; + case DISPLAY: + tgt.setValue(Questionnaire.QuestionnaireItemType.DISPLAY); + break; + case BOOLEAN: + tgt.setValue(Questionnaire.QuestionnaireItemType.BOOLEAN); + break; + case DECIMAL: + tgt.setValue(Questionnaire.QuestionnaireItemType.DECIMAL); + break; + case INTEGER: + tgt.setValue(Questionnaire.QuestionnaireItemType.INTEGER); + break; + case DATE: + tgt.setValue(Questionnaire.QuestionnaireItemType.DATE); + break; + case DATETIME: + tgt.setValue(Questionnaire.QuestionnaireItemType.DATETIME); + break; + case TIME: + tgt.setValue(Questionnaire.QuestionnaireItemType.TIME); + break; + case STRING: + tgt.setValue(Questionnaire.QuestionnaireItemType.STRING); + break; + case TEXT: + tgt.setValue(Questionnaire.QuestionnaireItemType.TEXT); + break; + case URL: + tgt.setValue(Questionnaire.QuestionnaireItemType.URL); + break; + case CHOICE: + tgt.setValue(Questionnaire.QuestionnaireItemType.CODING); + break; + case OPENCHOICE: + tgt.setValue(Questionnaire.QuestionnaireItemType.CODING); + break; + case ATTACHMENT: + tgt.setValue(Questionnaire.QuestionnaireItemType.ATTACHMENT); + break; + case REFERENCE: + tgt.setValue(Questionnaire.QuestionnaireItemType.REFERENCE); + break; + case QUANTITY: + tgt.setValue(Questionnaire.QuestionnaireItemType.QUANTITY); + break; + default: + tgt.setValue(Questionnaire.QuestionnaireItemType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/QuestionnaireResponse30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/QuestionnaireResponse30_50.java index efa1bd0bbc..daf8aaf966 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/QuestionnaireResponse30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/QuestionnaireResponse30_50.java @@ -7,6 +7,8 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Uri30_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.QuestionnaireResponse; public class QuestionnaireResponse30_50 { @@ -127,58 +129,66 @@ public static org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireRespon } static public org.hl7.fhir.r5.model.Enumeration convertQuestionnaireResponseStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.ENTEREDINERROR); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.STOPPED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED); + break; + case AMENDED: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED); + break; + case ENTEREDINERROR: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.ENTEREDINERROR); + break; + case STOPPED: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.STOPPED); + break; + default: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertQuestionnaireResponseStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseStatus.ENTEREDINERROR); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseStatus.STOPPED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED); + break; + case AMENDED: + tgt.setValue(org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseStatus.ENTEREDINERROR); + break; + case STOPPED: + tgt.setValue(org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseStatus.STOPPED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/RiskAssessment30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/RiskAssessment30_50.java index 818731d59f..0712b7e521 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/RiskAssessment30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/RiskAssessment30_50.java @@ -6,7 +6,10 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.Identifier30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Decimal30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; +import org.hl7.fhir.dstu3.model.RiskAssessment; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; public class RiskAssessment30_50 { @@ -135,76 +138,84 @@ public static org.hl7.fhir.dstu3.model.RiskAssessment.RiskAssessmentPredictionCo } static public org.hl7.fhir.r5.model.Enumeration convertRiskAssessmentStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ObservationStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.REGISTERED); - break; - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.AMENDED); - break; - case CORRECTED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.CORRECTED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ObservationStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(Enumerations.ObservationStatus.REGISTERED); + break; + case PRELIMINARY: + tgt.setValue(Enumerations.ObservationStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(Enumerations.ObservationStatus.FINAL); + break; + case AMENDED: + tgt.setValue(Enumerations.ObservationStatus.AMENDED); + break; + case CORRECTED: + tgt.setValue(Enumerations.ObservationStatus.CORRECTED); + break; + case CANCELLED: + tgt.setValue(Enumerations.ObservationStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.ObservationStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Enumerations.ObservationStatus.UNKNOWN); + break; + default: + tgt.setValue(Enumerations.ObservationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertRiskAssessmentStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.RiskAssessment.RiskAssessmentStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.dstu3.model.RiskAssessment.RiskAssessmentStatus.REGISTERED); - break; - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.dstu3.model.RiskAssessment.RiskAssessmentStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.dstu3.model.RiskAssessment.RiskAssessmentStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.dstu3.model.RiskAssessment.RiskAssessmentStatus.AMENDED); - break; - case CORRECTED: - tgt.setValue(org.hl7.fhir.dstu3.model.RiskAssessment.RiskAssessmentStatus.CORRECTED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.dstu3.model.RiskAssessment.RiskAssessmentStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.RiskAssessment.RiskAssessmentStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.dstu3.model.RiskAssessment.RiskAssessmentStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.RiskAssessment.RiskAssessmentStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new RiskAssessment.RiskAssessmentStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(RiskAssessment.RiskAssessmentStatus.REGISTERED); + break; + case PRELIMINARY: + tgt.setValue(RiskAssessment.RiskAssessmentStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(RiskAssessment.RiskAssessmentStatus.FINAL); + break; + case AMENDED: + tgt.setValue(RiskAssessment.RiskAssessmentStatus.AMENDED); + break; + case CORRECTED: + tgt.setValue(RiskAssessment.RiskAssessmentStatus.CORRECTED); + break; + case CANCELLED: + tgt.setValue(RiskAssessment.RiskAssessmentStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(RiskAssessment.RiskAssessmentStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(RiskAssessment.RiskAssessmentStatus.UNKNOWN); + break; + default: + tgt.setValue(RiskAssessment.RiskAssessmentStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/SearchParameter30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/SearchParameter30_50.java index e3d48ff7be..a914b9b85f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/SearchParameter30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/SearchParameter30_50.java @@ -13,177 +13,195 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.MarkDown30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Uri30_50; +import org.hl7.fhir.dstu3.model.SearchParameter; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; import org.hl7.fhir.r5.model.Enumerations.VersionIndependentResourceTypesAll; import org.hl7.fhir.r5.model.Enumerations.VersionIndependentResourceTypesAllEnumFactory; public class SearchParameter30_50 { static public org.hl7.fhir.r5.model.Enumeration convertSearchComparator(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.SearchComparatorEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case EQ: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchComparator.EQ); - break; - case NE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchComparator.NE); - break; - case GT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchComparator.GT); - break; - case LT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchComparator.LT); - break; - case GE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchComparator.GE); - break; - case LE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchComparator.LE); - break; - case SA: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchComparator.SA); - break; - case EB: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchComparator.EB); - break; - case AP: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchComparator.AP); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchComparator.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.SearchComparatorEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQ: + tgt.setValue(Enumerations.SearchComparator.EQ); + break; + case NE: + tgt.setValue(Enumerations.SearchComparator.NE); + break; + case GT: + tgt.setValue(Enumerations.SearchComparator.GT); + break; + case LT: + tgt.setValue(Enumerations.SearchComparator.LT); + break; + case GE: + tgt.setValue(Enumerations.SearchComparator.GE); + break; + case LE: + tgt.setValue(Enumerations.SearchComparator.LE); + break; + case SA: + tgt.setValue(Enumerations.SearchComparator.SA); + break; + case EB: + tgt.setValue(Enumerations.SearchComparator.EB); + break; + case AP: + tgt.setValue(Enumerations.SearchComparator.AP); + break; + default: + tgt.setValue(Enumerations.SearchComparator.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertSearchComparator(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.SearchParameter.SearchComparatorEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case EQ: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchComparator.EQ); - break; - case NE: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchComparator.NE); - break; - case GT: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchComparator.GT); - break; - case LT: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchComparator.LT); - break; - case GE: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchComparator.GE); - break; - case LE: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchComparator.LE); - break; - case SA: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchComparator.SA); - break; - case EB: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchComparator.EB); - break; - case AP: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchComparator.AP); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchComparator.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new SearchParameter.SearchComparatorEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQ: + tgt.setValue(SearchParameter.SearchComparator.EQ); + break; + case NE: + tgt.setValue(SearchParameter.SearchComparator.NE); + break; + case GT: + tgt.setValue(SearchParameter.SearchComparator.GT); + break; + case LT: + tgt.setValue(SearchParameter.SearchComparator.LT); + break; + case GE: + tgt.setValue(SearchParameter.SearchComparator.GE); + break; + case LE: + tgt.setValue(SearchParameter.SearchComparator.LE); + break; + case SA: + tgt.setValue(SearchParameter.SearchComparator.SA); + break; + case EB: + tgt.setValue(SearchParameter.SearchComparator.EB); + break; + case AP: + tgt.setValue(SearchParameter.SearchComparator.AP); + break; + default: + tgt.setValue(SearchParameter.SearchComparator.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertSearchModifierCode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.SearchModifierCodeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case MISSING: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.MISSING); - break; - case EXACT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.EXACT); - break; - case CONTAINS: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.CONTAINS); - break; - case NOT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.NOT); - break; - case TEXT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.TEXT); - break; - case IN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.NOTIN); - break; - case BELOW: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.BELOW); - break; - case ABOVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.ABOVE); - break; - case TYPE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.TYPE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.SearchModifierCodeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MISSING: + tgt.setValue(Enumerations.SearchModifierCode.MISSING); + break; + case EXACT: + tgt.setValue(Enumerations.SearchModifierCode.EXACT); + break; + case CONTAINS: + tgt.setValue(Enumerations.SearchModifierCode.CONTAINS); + break; + case NOT: + tgt.setValue(Enumerations.SearchModifierCode.NOT); + break; + case TEXT: + tgt.setValue(Enumerations.SearchModifierCode.TEXT); + break; + case IN: + tgt.setValue(Enumerations.SearchModifierCode.IN); + break; + case NOTIN: + tgt.setValue(Enumerations.SearchModifierCode.NOTIN); + break; + case BELOW: + tgt.setValue(Enumerations.SearchModifierCode.BELOW); + break; + case ABOVE: + tgt.setValue(Enumerations.SearchModifierCode.ABOVE); + break; + case TYPE: + tgt.setValue(Enumerations.SearchModifierCode.TYPE); + break; + default: + tgt.setValue(Enumerations.SearchModifierCode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertSearchModifierCode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.SearchParameter.SearchModifierCodeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case MISSING: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchModifierCode.MISSING); - break; - case EXACT: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchModifierCode.EXACT); - break; - case CONTAINS: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchModifierCode.CONTAINS); - break; - case NOT: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchModifierCode.NOT); - break; - case TEXT: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchModifierCode.TEXT); - break; - case IN: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchModifierCode.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchModifierCode.NOTIN); - break; - case BELOW: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchModifierCode.BELOW); - break; - case ABOVE: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchModifierCode.ABOVE); - break; - case TYPE: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchModifierCode.TYPE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.SearchModifierCode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new SearchParameter.SearchModifierCodeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MISSING: + tgt.setValue(SearchParameter.SearchModifierCode.MISSING); + break; + case EXACT: + tgt.setValue(SearchParameter.SearchModifierCode.EXACT); + break; + case CONTAINS: + tgt.setValue(SearchParameter.SearchModifierCode.CONTAINS); + break; + case NOT: + tgt.setValue(SearchParameter.SearchModifierCode.NOT); + break; + case TEXT: + tgt.setValue(SearchParameter.SearchModifierCode.TEXT); + break; + case IN: + tgt.setValue(SearchParameter.SearchModifierCode.IN); + break; + case NOTIN: + tgt.setValue(SearchParameter.SearchModifierCode.NOTIN); + break; + case BELOW: + tgt.setValue(SearchParameter.SearchModifierCode.BELOW); + break; + case ABOVE: + tgt.setValue(SearchParameter.SearchModifierCode.ABOVE); + break; + case TYPE: + tgt.setValue(SearchParameter.SearchModifierCode.TYPE); + break; + default: + tgt.setValue(SearchParameter.SearchModifierCode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.SearchParameter convertSearchParameter(org.hl7.fhir.dstu3.model.SearchParameter src) throws FHIRException { @@ -321,52 +339,60 @@ public static org.hl7.fhir.dstu3.model.SearchParameter.SearchParameterComponentC } static public org.hl7.fhir.r5.model.Enumeration convertXPathUsageType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeTypeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case NORMAL: - tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.NORMAL); - break; - case PHONETIC: - tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.PHONETIC); - break; - case NEARBY: - tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.OTHER); - break; - case DISTANCE: - tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.OTHER); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeTypeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NORMAL: + tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.NORMAL); + break; + case PHONETIC: + tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.PHONETIC); + break; + case NEARBY: + tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.OTHER); + break; + case DISTANCE: + tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.OTHER); + break; + case OTHER: + tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.OTHER); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertXPathUsageType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageTypeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case NORMAL: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageType.NORMAL); - break; - case PHONETIC: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageType.PHONETIC); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageType.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.SearchParameter.XPathUsageType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new SearchParameter.XPathUsageTypeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NORMAL: + tgt.setValue(SearchParameter.XPathUsageType.NORMAL); + break; + case PHONETIC: + tgt.setValue(SearchParameter.XPathUsageType.PHONETIC); + break; + case OTHER: + tgt.setValue(SearchParameter.XPathUsageType.OTHER); + break; + default: + tgt.setValue(SearchParameter.XPathUsageType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Slot30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Slot30_50.java index 7756a2e961..58fe156785 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Slot30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Slot30_50.java @@ -7,6 +7,8 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Boolean30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Instant30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.Slot; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; @@ -74,58 +76,66 @@ public static org.hl7.fhir.dstu3.model.Slot convertSlot(org.hl7.fhir.r5.model.Sl } static public org.hl7.fhir.dstu3.model.Enumeration convertSlotStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Slot.SlotStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case BUSY: - tgt.setValue(org.hl7.fhir.dstu3.model.Slot.SlotStatus.BUSY); - break; - case FREE: - tgt.setValue(org.hl7.fhir.dstu3.model.Slot.SlotStatus.FREE); - break; - case BUSYUNAVAILABLE: - tgt.setValue(org.hl7.fhir.dstu3.model.Slot.SlotStatus.BUSYUNAVAILABLE); - break; - case BUSYTENTATIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Slot.SlotStatus.BUSYTENTATIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Slot.SlotStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Slot.SlotStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Slot.SlotStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case BUSY: + tgt.setValue(Slot.SlotStatus.BUSY); + break; + case FREE: + tgt.setValue(Slot.SlotStatus.FREE); + break; + case BUSYUNAVAILABLE: + tgt.setValue(Slot.SlotStatus.BUSYUNAVAILABLE); + break; + case BUSYTENTATIVE: + tgt.setValue(Slot.SlotStatus.BUSYTENTATIVE); + break; + case ENTEREDINERROR: + tgt.setValue(Slot.SlotStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Slot.SlotStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertSlotStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Slot.SlotStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case BUSY: - tgt.setValue(org.hl7.fhir.r5.model.Slot.SlotStatus.BUSY); - break; - case FREE: - tgt.setValue(org.hl7.fhir.r5.model.Slot.SlotStatus.FREE); - break; - case BUSYUNAVAILABLE: - tgt.setValue(org.hl7.fhir.r5.model.Slot.SlotStatus.BUSYUNAVAILABLE); - break; - case BUSYTENTATIVE: - tgt.setValue(org.hl7.fhir.r5.model.Slot.SlotStatus.BUSYTENTATIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Slot.SlotStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Slot.SlotStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Slot.SlotStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case BUSY: + tgt.setValue(org.hl7.fhir.r5.model.Slot.SlotStatus.BUSY); + break; + case FREE: + tgt.setValue(org.hl7.fhir.r5.model.Slot.SlotStatus.FREE); + break; + case BUSYUNAVAILABLE: + tgt.setValue(org.hl7.fhir.r5.model.Slot.SlotStatus.BUSYUNAVAILABLE); + break; + case BUSYTENTATIVE: + tgt.setValue(org.hl7.fhir.r5.model.Slot.SlotStatus.BUSYTENTATIVE); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r5.model.Slot.SlotStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.Slot.SlotStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Specimen30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Specimen30_50.java index 1ecd98fbe8..7e6716d06f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Specimen30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Specimen30_50.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.SimpleQuantity30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.DateTime30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.Specimen; import org.hl7.fhir.exceptions.FHIRException; public class Specimen30_50 { @@ -177,52 +179,60 @@ public static org.hl7.fhir.dstu3.model.Specimen.SpecimenProcessingComponent conv } static public org.hl7.fhir.dstu3.model.Enumeration convertSpecimenStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Specimen.SpecimenStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case AVAILABLE: - tgt.setValue(org.hl7.fhir.dstu3.model.Specimen.SpecimenStatus.AVAILABLE); - break; - case UNAVAILABLE: - tgt.setValue(org.hl7.fhir.dstu3.model.Specimen.SpecimenStatus.UNAVAILABLE); - break; - case UNSATISFACTORY: - tgt.setValue(org.hl7.fhir.dstu3.model.Specimen.SpecimenStatus.UNSATISFACTORY); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Specimen.SpecimenStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Specimen.SpecimenStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Specimen.SpecimenStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case AVAILABLE: + tgt.setValue(Specimen.SpecimenStatus.AVAILABLE); + break; + case UNAVAILABLE: + tgt.setValue(Specimen.SpecimenStatus.UNAVAILABLE); + break; + case UNSATISFACTORY: + tgt.setValue(Specimen.SpecimenStatus.UNSATISFACTORY); + break; + case ENTEREDINERROR: + tgt.setValue(Specimen.SpecimenStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Specimen.SpecimenStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertSpecimenStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Specimen.SpecimenStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case AVAILABLE: - tgt.setValue(org.hl7.fhir.r5.model.Specimen.SpecimenStatus.AVAILABLE); - break; - case UNAVAILABLE: - tgt.setValue(org.hl7.fhir.r5.model.Specimen.SpecimenStatus.UNAVAILABLE); - break; - case UNSATISFACTORY: - tgt.setValue(org.hl7.fhir.r5.model.Specimen.SpecimenStatus.UNSATISFACTORY); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Specimen.SpecimenStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Specimen.SpecimenStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Specimen.SpecimenStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case AVAILABLE: + tgt.setValue(org.hl7.fhir.r5.model.Specimen.SpecimenStatus.AVAILABLE); + break; + case UNAVAILABLE: + tgt.setValue(org.hl7.fhir.r5.model.Specimen.SpecimenStatus.UNAVAILABLE); + break; + case UNSATISFACTORY: + tgt.setValue(org.hl7.fhir.r5.model.Specimen.SpecimenStatus.UNSATISFACTORY); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r5.model.Specimen.SpecimenStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.Specimen.SpecimenStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/StructureDefinition30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/StructureDefinition30_50.java index 675df3c5d7..77afe6d3bb 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/StructureDefinition30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/StructureDefinition30_50.java @@ -14,57 +14,67 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Uri30_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.StructureDefinition; import org.hl7.fhir.utilities.Utilities; public class StructureDefinition30_50 { static public org.hl7.fhir.r5.model.Enumeration convertExtensionContext(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextTypeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case RESOURCE: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextType.ELEMENT); - break; - case DATATYPE: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextType.ELEMENT); - break; - case EXTENSION: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextType.EXTENSION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureDefinition.ExtensionContextTypeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case RESOURCE: + tgt.setValue(StructureDefinition.ExtensionContextType.ELEMENT); + break; + case DATATYPE: + tgt.setValue(StructureDefinition.ExtensionContextType.ELEMENT); + break; + case EXTENSION: + tgt.setValue(StructureDefinition.ExtensionContextType.EXTENSION); + break; + default: + tgt.setValue(StructureDefinition.ExtensionContextType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertExtensionContext(org.hl7.fhir.r5.model.Enumeration src, String expression) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContextEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case FHIRPATH: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContext.RESOURCE); - break; - case ELEMENT: - String tn = expression.contains(".") ? expression.substring(0, expression.indexOf(".")) : expression; - if (isResource300(tn)) { - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContext.RESOURCE); - } else { - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContext.DATATYPE); - } - break; - case EXTENSION: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContext.EXTENSION); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContext.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContextEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FHIRPATH: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContext.RESOURCE); + break; + case ELEMENT: + String tn = expression.contains(".") ? expression.substring(0, expression.indexOf(".")) : expression; + if (isResource300(tn)) { + tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContext.RESOURCE); + } else { + tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContext.DATATYPE); + } + break; + case EXTENSION: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContext.EXTENSION); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContext.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.StructureDefinition convertStructureDefinition(org.hl7.fhir.dstu3.model.StructureDefinition src) throws FHIRException { @@ -221,53 +231,61 @@ public static org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionDi } static public org.hl7.fhir.dstu3.model.Enumeration convertStructureDefinitionKind(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKindEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PRIMITIVETYPE: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKind.PRIMITIVETYPE); - break; - case COMPLEXTYPE: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKind.COMPLEXTYPE); - break; - case RESOURCE: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKind.RESOURCE); - break; - case LOGICAL: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKind.LOGICAL); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKindEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRIMITIVETYPE: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKind.PRIMITIVETYPE); + break; + case COMPLEXTYPE: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKind.COMPLEXTYPE); + break; + case RESOURCE: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKind.RESOURCE); + break; + case LOGICAL: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKind.LOGICAL); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertStructureDefinitionKind(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKindEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PRIMITIVETYPE: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind.PRIMITIVETYPE); - break; - case COMPLEXTYPE: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind.COMPLEXTYPE); - break; - case RESOURCE: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind.RESOURCE); - break; - case LOGICAL: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind.LOGICAL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureDefinition.StructureDefinitionKindEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRIMITIVETYPE: + tgt.setValue(StructureDefinition.StructureDefinitionKind.PRIMITIVETYPE); + break; + case COMPLEXTYPE: + tgt.setValue(StructureDefinition.StructureDefinitionKind.COMPLEXTYPE); + break; + case RESOURCE: + tgt.setValue(StructureDefinition.StructureDefinitionKind.RESOURCE); + break; + case LOGICAL: + tgt.setValue(StructureDefinition.StructureDefinitionKind.LOGICAL); + break; + default: + tgt.setValue(StructureDefinition.StructureDefinitionKind.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionMappingComponent convertStructureDefinitionMappingComponent(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionMappingComponent src) throws FHIRException { @@ -323,41 +341,49 @@ public static org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionSnaps } static public org.hl7.fhir.r5.model.Enumeration convertTypeDerivationRule(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRuleEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case SPECIALIZATION: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule.SPECIALIZATION); - break; - case CONSTRAINT: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule.CONSTRAINT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureDefinition.TypeDerivationRuleEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SPECIALIZATION: + tgt.setValue(StructureDefinition.TypeDerivationRule.SPECIALIZATION); + break; + case CONSTRAINT: + tgt.setValue(StructureDefinition.TypeDerivationRule.CONSTRAINT); + break; + default: + tgt.setValue(StructureDefinition.TypeDerivationRule.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertTypeDerivationRule(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureDefinition.TypeDerivationRuleEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case SPECIALIZATION: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.TypeDerivationRule.SPECIALIZATION); - break; - case CONSTRAINT: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.TypeDerivationRule.CONSTRAINT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.TypeDerivationRule.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureDefinition.TypeDerivationRuleEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SPECIALIZATION: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.TypeDerivationRule.SPECIALIZATION); + break; + case CONSTRAINT: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.TypeDerivationRule.CONSTRAINT); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.TypeDerivationRule.NULL); + break; + } + } + return tgt; } static public boolean isResource300(String tn) { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/StructureMap30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/StructureMap30_50.java index c829b1d5e0..221333a4ed 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/StructureMap30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/StructureMap30_50.java @@ -15,7 +15,9 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Uri30_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; import org.hl7.fhir.r5.model.StringType; +import org.hl7.fhir.r5.model.StructureMap; import org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetParameterComponent; public class StructureMap30_50 { @@ -367,189 +369,221 @@ public static org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetPara } static public org.hl7.fhir.r5.model.Enumeration convertStructureMapGroupTypeMode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureMap.StructureMapGroupTypeModeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case NONE: - return null; - case TYPES: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapGroupTypeMode.TYPES); - break; - case TYPEANDTYPES: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapGroupTypeMode.TYPEANDTYPES); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapGroupTypeMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureMap.StructureMapGroupTypeModeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NONE: + return null; + case TYPES: + tgt.setValue(StructureMap.StructureMapGroupTypeMode.TYPES); + break; + case TYPEANDTYPES: + tgt.setValue(StructureMap.StructureMapGroupTypeMode.TYPEANDTYPES); + break; + default: + tgt.setValue(StructureMap.StructureMapGroupTypeMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertStructureMapGroupTypeMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupTypeModeEnumFactory()); - if (src == null || src.isEmpty()) { - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupTypeMode.NONE); + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupTypeModeEnumFactory()); + if (src == null || src.isEmpty()) { + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupTypeMode.NONE); + return tgt; + } + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case TYPES: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupTypeMode.TYPES); + break; + case TYPEANDTYPES: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupTypeMode.TYPEANDTYPES); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupTypeMode.NULL); + break; + } + } return tgt; - } - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case TYPES: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupTypeMode.TYPES); - break; - case TYPEANDTYPES: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupTypeMode.TYPEANDTYPES); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupTypeMode.NULL); - break; - } - return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertStructureMapInputMode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureMap.StructureMapInputModeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case SOURCE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapInputMode.SOURCE); - break; - case TARGET: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapInputMode.TARGET); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapInputMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureMap.StructureMapInputModeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SOURCE: + tgt.setValue(StructureMap.StructureMapInputMode.SOURCE); + break; + case TARGET: + tgt.setValue(StructureMap.StructureMapInputMode.TARGET); + break; + default: + tgt.setValue(StructureMap.StructureMapInputMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertStructureMapInputMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureMap.StructureMapInputModeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case SOURCE: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapInputMode.SOURCE); - break; - case TARGET: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapInputMode.TARGET); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapInputMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureMap.StructureMapInputModeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SOURCE: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapInputMode.SOURCE); + break; + case TARGET: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapInputMode.TARGET); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapInputMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertStructureMapModelMode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureMap.StructureMapModelModeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case SOURCE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapModelMode.SOURCE); - break; - case QUERIED: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapModelMode.QUERIED); - break; - case TARGET: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapModelMode.TARGET); - break; - case PRODUCED: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapModelMode.PRODUCED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapModelMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureMap.StructureMapModelModeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SOURCE: + tgt.setValue(StructureMap.StructureMapModelMode.SOURCE); + break; + case QUERIED: + tgt.setValue(StructureMap.StructureMapModelMode.QUERIED); + break; + case TARGET: + tgt.setValue(StructureMap.StructureMapModelMode.TARGET); + break; + case PRODUCED: + tgt.setValue(StructureMap.StructureMapModelMode.PRODUCED); + break; + default: + tgt.setValue(StructureMap.StructureMapModelMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertStructureMapModelMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureMap.StructureMapModelModeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case SOURCE: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapModelMode.SOURCE); - break; - case QUERIED: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapModelMode.QUERIED); - break; - case TARGET: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapModelMode.TARGET); - break; - case PRODUCED: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapModelMode.PRODUCED); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapModelMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureMap.StructureMapModelModeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SOURCE: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapModelMode.SOURCE); + break; + case QUERIED: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapModelMode.QUERIED); + break; + case TARGET: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapModelMode.TARGET); + break; + case PRODUCED: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapModelMode.PRODUCED); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapModelMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertStructureMapSourceListMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureMap.StructureMapSourceListModeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case FIRST: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapSourceListMode.FIRST); - break; - case NOTFIRST: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapSourceListMode.NOTFIRST); - break; - case LAST: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapSourceListMode.LAST); - break; - case NOTLAST: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapSourceListMode.NOTLAST); - break; - case ONLYONE: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapSourceListMode.ONLYONE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapSourceListMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureMap.StructureMapSourceListModeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FIRST: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapSourceListMode.FIRST); + break; + case NOTFIRST: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapSourceListMode.NOTFIRST); + break; + case LAST: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapSourceListMode.LAST); + break; + case NOTLAST: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapSourceListMode.NOTLAST); + break; + case ONLYONE: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapSourceListMode.ONLYONE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapSourceListMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertStructureMapSourceListMode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListModeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case FIRST: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListMode.FIRST); - break; - case NOTFIRST: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListMode.NOTFIRST); - break; - case LAST: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListMode.LAST); - break; - case NOTLAST: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListMode.NOTLAST); - break; - case ONLYONE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListMode.ONLYONE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureMap.StructureMapSourceListModeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FIRST: + tgt.setValue(StructureMap.StructureMapSourceListMode.FIRST); + break; + case NOTFIRST: + tgt.setValue(StructureMap.StructureMapSourceListMode.NOTFIRST); + break; + case LAST: + tgt.setValue(StructureMap.StructureMapSourceListMode.LAST); + break; + case NOTLAST: + tgt.setValue(StructureMap.StructureMapSourceListMode.NOTLAST); + break; + case ONLYONE: + tgt.setValue(StructureMap.StructureMapSourceListMode.ONLYONE); + break; + default: + tgt.setValue(StructureMap.StructureMapSourceListMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.StructureMap.StructureMapStructureComponent convertStructureMapStructureComponent(org.hl7.fhir.r5.model.StructureMap.StructureMapStructureComponent src) throws FHIRException { @@ -585,180 +619,196 @@ public static org.hl7.fhir.r5.model.StructureMap.StructureMapStructureComponent } static public org.hl7.fhir.r5.model.Enumeration convertStructureMapTargetListMode(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListModeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case FIRST: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListMode.FIRST); - break; - case SHARE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListMode.SHARE); - break; - case LAST: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListMode.LAST); - break; - case COLLATE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListMode.SINGLE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureMap.StructureMapTargetListModeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FIRST: + tgt.setValue(StructureMap.StructureMapTargetListMode.FIRST); + break; + case SHARE: + tgt.setValue(StructureMap.StructureMapTargetListMode.SHARE); + break; + case LAST: + tgt.setValue(StructureMap.StructureMapTargetListMode.LAST); + break; + case COLLATE: + tgt.setValue(StructureMap.StructureMapTargetListMode.SINGLE); + break; + default: + tgt.setValue(StructureMap.StructureMapTargetListMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertStructureMapTargetListMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureMap.StructureMapTargetListModeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case FIRST: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTargetListMode.FIRST); - break; - case SHARE: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTargetListMode.SHARE); - break; - case LAST: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTargetListMode.LAST); - break; - case SINGLE: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTargetListMode.COLLATE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTargetListMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureMap.StructureMapTargetListModeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FIRST: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTargetListMode.FIRST); + break; + case SHARE: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTargetListMode.SHARE); + break; + case LAST: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTargetListMode.LAST); + break; + case SINGLE: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTargetListMode.COLLATE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTargetListMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertStructureMapTransform(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransformEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case CREATE: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.CREATE); - break; - case COPY: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.COPY); - break; - case TRUNCATE: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.TRUNCATE); - break; - case ESCAPE: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.ESCAPE); - break; - case CAST: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.CAST); - break; - case APPEND: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.APPEND); - break; - case TRANSLATE: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.TRANSLATE); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.REFERENCE); - break; - case DATEOP: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.DATEOP); - break; - case UUID: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.UUID); - break; - case POINTER: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.POINTER); - break; - case EVALUATE: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.EVALUATE); - break; - case CC: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.CC); - break; - case C: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.C); - break; - case QTY: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.QTY); - break; - case ID: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.ID); - break; - case CP: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.CP); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransformEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CREATE: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.CREATE); + break; + case COPY: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.COPY); + break; + case TRUNCATE: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.TRUNCATE); + break; + case ESCAPE: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.ESCAPE); + break; + case CAST: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.CAST); + break; + case APPEND: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.APPEND); + break; + case TRANSLATE: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.TRANSLATE); + break; + case REFERENCE: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.REFERENCE); + break; + case DATEOP: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.DATEOP); + break; + case UUID: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.UUID); + break; + case POINTER: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.POINTER); + break; + case EVALUATE: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.EVALUATE); + break; + case CC: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.CC); + break; + case C: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.C); + break; + case QTY: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.QTY); + break; + case ID: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.ID); + break; + case CP: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.CP); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertStructureMapTransform(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureMap.StructureMapTransformEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case CREATE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.CREATE); - break; - case COPY: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.COPY); - break; - case TRUNCATE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.TRUNCATE); - break; - case ESCAPE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.ESCAPE); - break; - case CAST: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.CAST); - break; - case APPEND: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.APPEND); - break; - case TRANSLATE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.TRANSLATE); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.REFERENCE); - break; - case DATEOP: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.DATEOP); - break; - case UUID: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.UUID); - break; - case POINTER: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.POINTER); - break; - case EVALUATE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.EVALUATE); - break; - case CC: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.CC); - break; - case C: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.C); - break; - case QTY: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.QTY); - break; - case ID: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.ID); - break; - case CP: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.CP); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureMap.StructureMapTransformEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CREATE: + tgt.setValue(StructureMap.StructureMapTransform.CREATE); + break; + case COPY: + tgt.setValue(StructureMap.StructureMapTransform.COPY); + break; + case TRUNCATE: + tgt.setValue(StructureMap.StructureMapTransform.TRUNCATE); + break; + case ESCAPE: + tgt.setValue(StructureMap.StructureMapTransform.ESCAPE); + break; + case CAST: + tgt.setValue(StructureMap.StructureMapTransform.CAST); + break; + case APPEND: + tgt.setValue(StructureMap.StructureMapTransform.APPEND); + break; + case TRANSLATE: + tgt.setValue(StructureMap.StructureMapTransform.TRANSLATE); + break; + case REFERENCE: + tgt.setValue(StructureMap.StructureMapTransform.REFERENCE); + break; + case DATEOP: + tgt.setValue(StructureMap.StructureMapTransform.DATEOP); + break; + case UUID: + tgt.setValue(StructureMap.StructureMapTransform.UUID); + break; + case POINTER: + tgt.setValue(StructureMap.StructureMapTransform.POINTER); + break; + case EVALUATE: + tgt.setValue(StructureMap.StructureMapTransform.EVALUATE); + break; + case CC: + tgt.setValue(StructureMap.StructureMapTransform.CC); + break; + case C: + tgt.setValue(StructureMap.StructureMapTransform.C); + break; + case QTY: + tgt.setValue(StructureMap.StructureMapTransform.QTY); + break; + case ID: + tgt.setValue(StructureMap.StructureMapTransform.ID); + break; + case CP: + tgt.setValue(StructureMap.StructureMapTransform.CP); + break; + default: + tgt.setValue(StructureMap.StructureMapTransform.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Substance30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Substance30_50.java index bd4976317f..99876b8c60 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Substance30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Substance30_50.java @@ -8,52 +8,62 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.DateTime30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; import org.hl7.fhir.r5.model.Identifier; +import org.hl7.fhir.r5.model.Substance; public class Substance30_50 { static public org.hl7.fhir.r5.model.Enumeration convertFHIRSubstanceStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Substance.FHIRSubstanceStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Substance.FHIRSubstanceStatus.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Substance.FHIRSubstanceStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Substance.FHIRSubstanceStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Substance.FHIRSubstanceStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Substance.FHIRSubstanceStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Substance.FHIRSubstanceStatus.ACTIVE); + break; + case INACTIVE: + tgt.setValue(Substance.FHIRSubstanceStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(Substance.FHIRSubstanceStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Substance.FHIRSubstanceStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertFHIRSubstanceStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Substance.FHIRSubstanceStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Substance.FHIRSubstanceStatus.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.dstu3.model.Substance.FHIRSubstanceStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.Substance.FHIRSubstanceStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.Substance.FHIRSubstanceStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Substance.FHIRSubstanceStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.dstu3.model.Substance.FHIRSubstanceStatus.ACTIVE); + break; + case INACTIVE: + tgt.setValue(org.hl7.fhir.dstu3.model.Substance.FHIRSubstanceStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu3.model.Substance.FHIRSubstanceStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.Substance.FHIRSubstanceStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Substance convertSubstance(org.hl7.fhir.dstu3.model.Substance src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/SupplyDelivery30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/SupplyDelivery30_50.java index 9681889bfb..a9f8653afa 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/SupplyDelivery30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/SupplyDelivery30_50.java @@ -5,6 +5,8 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.CodeableConcept30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.Identifier30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.SimpleQuantity30_50; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.SupplyDelivery; import org.hl7.fhir.exceptions.FHIRException; public class SupplyDelivery30_50 { @@ -64,53 +66,61 @@ public static org.hl7.fhir.dstu3.model.SupplyDelivery convertSupplyDelivery(org. } static public org.hl7.fhir.dstu3.model.Enumeration convertSupplyDeliveryStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.SupplyDelivery.SupplyDeliveryStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu3.model.SupplyDelivery.SupplyDeliveryStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.SupplyDelivery.SupplyDeliveryStatus.COMPLETED); - break; - case ABANDONED: - tgt.setValue(org.hl7.fhir.dstu3.model.SupplyDelivery.SupplyDeliveryStatus.ABANDONED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.SupplyDelivery.SupplyDeliveryStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.SupplyDelivery.SupplyDeliveryStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new SupplyDelivery.SupplyDeliveryStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(SupplyDelivery.SupplyDeliveryStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(SupplyDelivery.SupplyDeliveryStatus.COMPLETED); + break; + case ABANDONED: + tgt.setValue(SupplyDelivery.SupplyDeliveryStatus.ABANDONED); + break; + case ENTEREDINERROR: + tgt.setValue(SupplyDelivery.SupplyDeliveryStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(SupplyDelivery.SupplyDeliveryStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertSupplyDeliveryStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus.COMPLETED); - break; - case ABANDONED: - tgt.setValue(org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus.ABANDONED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus.COMPLETED); + break; + case ABANDONED: + tgt.setValue(org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus.ABANDONED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliverySuppliedItemComponent convertSupplyDeliverySuppliedItemComponent(org.hl7.fhir.dstu3.model.SupplyDelivery.SupplyDeliverySuppliedItemComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/TestReport30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/TestReport30_50.java index 45848a56d7..4b183cd4e2 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/TestReport30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/TestReport30_50.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Uri30_50; import org.hl7.fhir.dstu3.model.Reference; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.TestReport; public class TestReport30_50 { @@ -105,91 +107,107 @@ public static org.hl7.fhir.r5.model.TestReport.TestReportParticipantComponent co } static public org.hl7.fhir.r5.model.Enumeration convertTestReportParticipantType(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TestReport.TestReportParticipantTypeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case TESTENGINE: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportParticipantType.TESTENGINE); - break; - case CLIENT: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportParticipantType.CLIENT); - break; - case SERVER: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportParticipantType.SERVER); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportParticipantType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new TestReport.TestReportParticipantTypeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case TESTENGINE: + tgt.setValue(TestReport.TestReportParticipantType.TESTENGINE); + break; + case CLIENT: + tgt.setValue(TestReport.TestReportParticipantType.CLIENT); + break; + case SERVER: + tgt.setValue(TestReport.TestReportParticipantType.SERVER); + break; + default: + tgt.setValue(TestReport.TestReportParticipantType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertTestReportParticipantType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantTypeEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case TESTENGINE: - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantType.TESTENGINE); - break; - case CLIENT: - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantType.CLIENT); - break; - case SERVER: - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantType.SERVER); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantTypeEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case TESTENGINE: + tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantType.TESTENGINE); + break; + case CLIENT: + tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantType.CLIENT); + break; + case SERVER: + tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantType.SERVER); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertTestReportResult(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TestReport.TestReportResultEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PASS: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportResult.PASS); - break; - case FAIL: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportResult.FAIL); - break; - case PENDING: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportResult.PENDING); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportResult.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new TestReport.TestReportResultEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PASS: + tgt.setValue(TestReport.TestReportResult.PASS); + break; + case FAIL: + tgt.setValue(TestReport.TestReportResult.FAIL); + break; + case PENDING: + tgt.setValue(TestReport.TestReportResult.PENDING); + break; + default: + tgt.setValue(TestReport.TestReportResult.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertTestReportResult(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestReport.TestReportResultEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case PASS: - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportResult.PASS); - break; - case FAIL: - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportResult.FAIL); - break; - case PENDING: - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportResult.PENDING); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportResult.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestReport.TestReportResultEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PASS: + tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportResult.PASS); + break; + case FAIL: + tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportResult.FAIL); + break; + case PENDING: + tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportResult.PENDING); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportResult.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.TestReport.TestReportSetupComponent convertTestReportSetupComponent(org.hl7.fhir.dstu3.model.TestReport.TestReportSetupComponent src) throws FHIRException { @@ -213,59 +231,67 @@ public static org.hl7.fhir.dstu3.model.TestReport.TestReportSetupComponent conve } static public org.hl7.fhir.r5.model.Enumeration convertTestReportStatus(org.hl7.fhir.dstu3.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TestReport.TestReportStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportStatus.COMPLETED); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportStatus.INPROGRESS); - break; - case WAITING: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportStatus.WAITING); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportStatus.STOPPED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new TestReport.TestReportStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case COMPLETED: + tgt.setValue(TestReport.TestReportStatus.COMPLETED); + break; + case INPROGRESS: + tgt.setValue(TestReport.TestReportStatus.INPROGRESS); + break; + case WAITING: + tgt.setValue(TestReport.TestReportStatus.WAITING); + break; + case STOPPED: + tgt.setValue(TestReport.TestReportStatus.STOPPED); + break; + case ENTEREDINERROR: + tgt.setValue(TestReport.TestReportStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(TestReport.TestReportStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.dstu3.model.Enumeration convertTestReportStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestReport.TestReportStatusEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case COMPLETED: - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportStatus.COMPLETED); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportStatus.INPROGRESS); - break; - case WAITING: - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportStatus.WAITING); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportStatus.STOPPED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestReport.TestReportStatusEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case COMPLETED: + tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportStatus.COMPLETED); + break; + case INPROGRESS: + tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportStatus.INPROGRESS); + break; + case WAITING: + tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportStatus.WAITING); + break; + case STOPPED: + tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportStatus.STOPPED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.dstu3.model.TestReport.TestReportTeardownComponent convertTestReportTeardownComponent(org.hl7.fhir.r5.model.TestReport.TestReportTeardownComponent src) throws FHIRException { @@ -359,29 +385,29 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TestReport.TestReportActionResultEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportActionResult.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case PASS: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportActionResult.PASS); - break; - case SKIP: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportActionResult.SKIP); - break; - case FAIL: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportActionResult.FAIL); - break; - case WARNING: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportActionResult.WARNING); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportActionResult.ERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportActionResult.NULL); - break; - } - } + tgt.setValue(TestReport.TestReportActionResult.PASS); + break; + case SKIP: + tgt.setValue(TestReport.TestReportActionResult.SKIP); + break; + case FAIL: + tgt.setValue(TestReport.TestReportActionResult.FAIL); + break; + case WARNING: + tgt.setValue(TestReport.TestReportActionResult.WARNING); + break; + case ERROR: + tgt.setValue(TestReport.TestReportActionResult.ERROR); + break; + default: + tgt.setValue(TestReport.TestReportActionResult.NULL); + break; + } +} return tgt; } @@ -390,29 +416,29 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestReport.TestReportActionResultEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportActionResult.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case PASS: - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportActionResult.PASS); - break; - case SKIP: - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportActionResult.SKIP); - break; - case FAIL: - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportActionResult.FAIL); - break; - case WARNING: - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportActionResult.WARNING); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportActionResult.ERROR); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportActionResult.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportActionResult.PASS); + break; + case SKIP: + tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportActionResult.SKIP); + break; + case FAIL: + tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportActionResult.FAIL); + break; + case WARNING: + tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportActionResult.WARNING); + break; + case ERROR: + tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportActionResult.ERROR); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportActionResult.NULL); + break; + } +} return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/TestScript30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/TestScript30_50.java index feee704901..2194ecac36 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/TestScript30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/TestScript30_50.java @@ -16,6 +16,7 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Uri30_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CanonicalType; +import org.hl7.fhir.r5.model.TestScript; public class TestScript30_50 { @@ -596,20 +597,20 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TestScript.AssertionDirectionTypeEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionDirectionType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case RESPONSE: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionDirectionType.RESPONSE); - break; - case REQUEST: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionDirectionType.REQUEST); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionDirectionType.NULL); - break; - } - } + tgt.setValue(TestScript.AssertionDirectionType.RESPONSE); + break; + case REQUEST: + tgt.setValue(TestScript.AssertionDirectionType.REQUEST); + break; + default: + tgt.setValue(TestScript.AssertionDirectionType.NULL); + break; + } +} return tgt; } @@ -618,20 +619,20 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionTypeEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case RESPONSE: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType.RESPONSE); - break; - case REQUEST: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType.REQUEST); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType.RESPONSE); + break; + case REQUEST: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType.REQUEST); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType.NULL); + break; + } +} return tgt; } @@ -640,47 +641,47 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TestScript.AssertionOperatorTypeEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case EQUALS: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.EQUALS); - break; - case NOTEQUALS: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NOTEQUALS); - break; - case IN: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NOTIN); - break; - case GREATERTHAN: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.GREATERTHAN); - break; - case LESSTHAN: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.LESSTHAN); - break; - case EMPTY: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.EMPTY); - break; - case NOTEMPTY: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NOTEMPTY); - break; - case CONTAINS: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.CONTAINS); - break; - case NOTCONTAINS: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NOTCONTAINS); - break; - case EVAL: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.EVAL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NULL); - break; - } - } + tgt.setValue(TestScript.AssertionOperatorType.EQUALS); + break; + case NOTEQUALS: + tgt.setValue(TestScript.AssertionOperatorType.NOTEQUALS); + break; + case IN: + tgt.setValue(TestScript.AssertionOperatorType.IN); + break; + case NOTIN: + tgt.setValue(TestScript.AssertionOperatorType.NOTIN); + break; + case GREATERTHAN: + tgt.setValue(TestScript.AssertionOperatorType.GREATERTHAN); + break; + case LESSTHAN: + tgt.setValue(TestScript.AssertionOperatorType.LESSTHAN); + break; + case EMPTY: + tgt.setValue(TestScript.AssertionOperatorType.EMPTY); + break; + case NOTEMPTY: + tgt.setValue(TestScript.AssertionOperatorType.NOTEMPTY); + break; + case CONTAINS: + tgt.setValue(TestScript.AssertionOperatorType.CONTAINS); + break; + case NOTCONTAINS: + tgt.setValue(TestScript.AssertionOperatorType.NOTCONTAINS); + break; + case EVAL: + tgt.setValue(TestScript.AssertionOperatorType.EVAL); + break; + default: + tgt.setValue(TestScript.AssertionOperatorType.NULL); + break; + } +} return tgt; } @@ -689,47 +690,47 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorTypeEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case EQUALS: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.EQUALS); - break; - case NOTEQUALS: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTEQUALS); - break; - case IN: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTIN); - break; - case GREATERTHAN: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.GREATERTHAN); - break; - case LESSTHAN: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.LESSTHAN); - break; - case EMPTY: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.EMPTY); - break; - case NOTEMPTY: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTEMPTY); - break; - case CONTAINS: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.CONTAINS); - break; - case NOTCONTAINS: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTCONTAINS); - break; - case EVAL: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.EVAL); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.EQUALS); + break; + case NOTEQUALS: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTEQUALS); + break; + case IN: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.IN); + break; + case NOTIN: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTIN); + break; + case GREATERTHAN: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.GREATERTHAN); + break; + case LESSTHAN: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.LESSTHAN); + break; + case EMPTY: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.EMPTY); + break; + case NOTEMPTY: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTEMPTY); + break; + case CONTAINS: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.CONTAINS); + break; + case NOTCONTAINS: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTCONTAINS); + break; + case EVAL: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.EVAL); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NULL); + break; + } +} return tgt; } @@ -738,32 +739,32 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCodeEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case DELETE: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.DELETE); - break; - case GET: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.GET); - break; - case OPTIONS: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.OPTIONS); - break; - case PATCH: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.PATCH); - break; - case POST: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.POST); - break; - case PUT: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.PUT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.NULL); - break; - } - } + tgt.setValue(TestScript.TestScriptRequestMethodCode.DELETE); + break; + case GET: + tgt.setValue(TestScript.TestScriptRequestMethodCode.GET); + break; + case OPTIONS: + tgt.setValue(TestScript.TestScriptRequestMethodCode.OPTIONS); + break; + case PATCH: + tgt.setValue(TestScript.TestScriptRequestMethodCode.PATCH); + break; + case POST: + tgt.setValue(TestScript.TestScriptRequestMethodCode.POST); + break; + case PUT: + tgt.setValue(TestScript.TestScriptRequestMethodCode.PUT); + break; + default: + tgt.setValue(TestScript.TestScriptRequestMethodCode.NULL); + break; + } +} return tgt; } @@ -772,32 +773,32 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCodeEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case DELETE: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.DELETE); - break; - case GET: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.GET); - break; - case OPTIONS: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.OPTIONS); - break; - case PATCH: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.PATCH); - break; - case POST: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.POST); - break; - case PUT: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.PUT); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.DELETE); + break; + case GET: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.GET); + break; + case OPTIONS: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.OPTIONS); + break; + case PATCH: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.PATCH); + break; + case POST: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.POST); + break; + case PUT: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.PUT); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.NULL); + break; + } +} return tgt; } @@ -806,50 +807,50 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TestScript.AssertionResponseTypesEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case OKAY: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.OKAY); - break; - case CREATED: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.CREATED); - break; - case NOCONTENT: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.NOCONTENT); - break; - case NOTMODIFIED: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.NOTMODIFIED); - break; - case BAD: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.BADREQUEST); - break; - case FORBIDDEN: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.FORBIDDEN); - break; - case NOTFOUND: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.NOTFOUND); - break; - case METHODNOTALLOWED: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.METHODNOTALLOWED); - break; - case CONFLICT: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.CONFLICT); - break; - case GONE: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.GONE); - break; - case PRECONDITIONFAILED: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.PRECONDITIONFAILED); - break; - case UNPROCESSABLE: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.UNPROCESSABLECONTENT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.NULL); - break; - } - } + tgt.setValue(TestScript.AssertionResponseTypes.OKAY); + break; + case CREATED: + tgt.setValue(TestScript.AssertionResponseTypes.CREATED); + break; + case NOCONTENT: + tgt.setValue(TestScript.AssertionResponseTypes.NOCONTENT); + break; + case NOTMODIFIED: + tgt.setValue(TestScript.AssertionResponseTypes.NOTMODIFIED); + break; + case BAD: + tgt.setValue(TestScript.AssertionResponseTypes.BADREQUEST); + break; + case FORBIDDEN: + tgt.setValue(TestScript.AssertionResponseTypes.FORBIDDEN); + break; + case NOTFOUND: + tgt.setValue(TestScript.AssertionResponseTypes.NOTFOUND); + break; + case METHODNOTALLOWED: + tgt.setValue(TestScript.AssertionResponseTypes.METHODNOTALLOWED); + break; + case CONFLICT: + tgt.setValue(TestScript.AssertionResponseTypes.CONFLICT); + break; + case GONE: + tgt.setValue(TestScript.AssertionResponseTypes.GONE); + break; + case PRECONDITIONFAILED: + tgt.setValue(TestScript.AssertionResponseTypes.PRECONDITIONFAILED); + break; + case UNPROCESSABLE: + tgt.setValue(TestScript.AssertionResponseTypes.UNPROCESSABLECONTENT); + break; + default: + tgt.setValue(TestScript.AssertionResponseTypes.NULL); + break; + } +} return tgt; } @@ -858,50 +859,50 @@ static public org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypesEnumFactory()); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case OKAY: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.OKAY); - break; - case CREATED: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.CREATED); - break; - case NOCONTENT: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NOCONTENT); - break; - case NOTMODIFIED: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NOTMODIFIED); - break; - case BADREQUEST: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.BAD); - break; - case FORBIDDEN: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.FORBIDDEN); - break; - case NOTFOUND: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NOTFOUND); - break; - case METHODNOTALLOWED: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.METHODNOTALLOWED); - break; - case CONFLICT: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.CONFLICT); - break; - case GONE: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.GONE); - break; - case PRECONDITIONFAILED: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.PRECONDITIONFAILED); - break; - case UNPROCESSABLECONTENT: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.UNPROCESSABLE); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.OKAY); + break; + case CREATED: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.CREATED); + break; + case NOCONTENT: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NOCONTENT); + break; + case NOTMODIFIED: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NOTMODIFIED); + break; + case BADREQUEST: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.BAD); + break; + case FORBIDDEN: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.FORBIDDEN); + break; + case NOTFOUND: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NOTFOUND); + break; + case METHODNOTALLOWED: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.METHODNOTALLOWED); + break; + case CONFLICT: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.CONFLICT); + break; + case GONE: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.GONE); + break; + case PRECONDITIONFAILED: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.PRECONDITIONFAILED); + break; + case UNPROCESSABLECONTENT: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.UNPROCESSABLE); + break; + default: + tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NULL); + break; + } +} return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/ValueSet30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/ValueSet30_50.java index 19b42ae82a..0d858399ed 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/ValueSet30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/ValueSet30_50.java @@ -14,6 +14,8 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.MarkDown30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Uri30_50; +import org.hl7.fhir.dstu3.model.Enumeration; +import org.hl7.fhir.dstu3.model.ValueSet; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.BooleanType; @@ -143,43 +145,47 @@ public static org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent convertCo } static public org.hl7.fhir.dstu3.model.Enumeration convertFilterOperator2(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.dstu3.model.Enumeration tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ValueSet.FilterOperatorEnumFactory()); - ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); - switch (src.getValue()) { - case EQUAL: - tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.EQUAL); - break; - case ISA: - tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.ISA); - break; - case DESCENDENTOF: - tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.DESCENDENTOF); - break; - case ISNOTA: - tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.ISNOTA); - break; - case REGEX: - tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.REGEX); - break; - case IN: - tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.NOTIN); - break; - case GENERALIZES: - tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.GENERALIZES); - break; - case EXISTS: - tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.EXISTS); - break; - default: - tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ValueSet.FilterOperatorEnumFactory()); + ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUAL: + tgt.setValue(ValueSet.FilterOperator.EQUAL); + break; + case ISA: + tgt.setValue(ValueSet.FilterOperator.ISA); + break; + case DESCENDENTOF: + tgt.setValue(ValueSet.FilterOperator.DESCENDENTOF); + break; + case ISNOTA: + tgt.setValue(ValueSet.FilterOperator.ISNOTA); + break; + case REGEX: + tgt.setValue(ValueSet.FilterOperator.REGEX); + break; + case IN: + tgt.setValue(ValueSet.FilterOperator.IN); + break; + case NOTIN: + tgt.setValue(ValueSet.FilterOperator.NOTIN); + break; + case GENERALIZES: + tgt.setValue(ValueSet.FilterOperator.GENERALIZES); + break; + case EXISTS: + tgt.setValue(ValueSet.FilterOperator.EXISTS); + break; + default: + tgt.setValue(ValueSet.FilterOperator.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.ValueSet convertValueSet(org.hl7.fhir.dstu3.model.ValueSet src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/general40_50/Address40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/general40_50/Address40_50.java index 63b1754441..de73f4b71a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/general40_50/Address40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/general40_50/Address40_50.java @@ -3,6 +3,7 @@ import org.hl7.fhir.convertors.context.ConversionContext40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Address; public class Address40_50 { public static org.hl7.fhir.r5.model.Address convertAddress(org.hl7.fhir.r4.model.Address src) throws FHIRException { @@ -44,29 +45,29 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Address.AddressUseEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HOME: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressUse.HOME); - break; - case WORK: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressUse.WORK); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressUse.OLD); - break; - case BILLING: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressUse.BILLING); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressUse.NULL); - break; - } - } + tgt.setValue(Address.AddressUse.HOME); + break; + case WORK: + tgt.setValue(Address.AddressUse.WORK); + break; + case TEMP: + tgt.setValue(Address.AddressUse.TEMP); + break; + case OLD: + tgt.setValue(Address.AddressUse.OLD); + break; + case BILLING: + tgt.setValue(Address.AddressUse.BILLING); + break; + default: + tgt.setValue(Address.AddressUse.NULL); + break; + } +} return tgt; } @@ -75,29 +76,29 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Address.AddressUseEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HOME: - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressUse.HOME); - break; - case WORK: - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressUse.WORK); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressUse.OLD); - break; - case BILLING: - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressUse.BILLING); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4.model.Address.AddressUse.HOME); + break; + case WORK: + tgt.setValue(org.hl7.fhir.r4.model.Address.AddressUse.WORK); + break; + case TEMP: + tgt.setValue(org.hl7.fhir.r4.model.Address.AddressUse.TEMP); + break; + case OLD: + tgt.setValue(org.hl7.fhir.r4.model.Address.AddressUse.OLD); + break; + case BILLING: + tgt.setValue(org.hl7.fhir.r4.model.Address.AddressUse.BILLING); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Address.AddressUse.NULL); + break; + } +} return tgt; } @@ -106,23 +107,23 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Address.AddressTypeEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case POSTAL: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressType.POSTAL); - break; - case PHYSICAL: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressType.PHYSICAL); - break; - case BOTH: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressType.BOTH); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressType.NULL); - break; - } - } + tgt.setValue(Address.AddressType.POSTAL); + break; + case PHYSICAL: + tgt.setValue(Address.AddressType.PHYSICAL); + break; + case BOTH: + tgt.setValue(Address.AddressType.BOTH); + break; + default: + tgt.setValue(Address.AddressType.NULL); + break; + } +} return tgt; } @@ -131,23 +132,23 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Address.AddressTypeEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case POSTAL: - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressType.POSTAL); - break; - case PHYSICAL: - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressType.PHYSICAL); - break; - case BOTH: - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressType.BOTH); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Address.AddressType.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4.model.Address.AddressType.POSTAL); + break; + case PHYSICAL: + tgt.setValue(org.hl7.fhir.r4.model.Address.AddressType.PHYSICAL); + break; + case BOTH: + tgt.setValue(org.hl7.fhir.r4.model.Address.AddressType.BOTH); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Address.AddressType.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/general40_50/ContactPoint40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/general40_50/ContactPoint40_50.java index ab170c8cd2..3f6a6a8b75 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/general40_50/ContactPoint40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/general40_50/ContactPoint40_50.java @@ -4,6 +4,7 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.PositiveInt40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.ContactPoint; public class ContactPoint40_50 { public static org.hl7.fhir.r5.model.ContactPoint convertContactPoint(org.hl7.fhir.r4.model.ContactPoint src) throws FHIRException { @@ -35,35 +36,35 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ContactPoint.ContactPointSystemEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case PHONE: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.PHONE); - break; - case FAX: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.FAX); - break; - case EMAIL: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.EMAIL); - break; - case PAGER: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.PAGER); - break; - case URL: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.URL); - break; - case SMS: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.SMS); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.NULL); - break; - } - } + tgt.setValue(ContactPoint.ContactPointSystem.PHONE); + break; + case FAX: + tgt.setValue(ContactPoint.ContactPointSystem.FAX); + break; + case EMAIL: + tgt.setValue(ContactPoint.ContactPointSystem.EMAIL); + break; + case PAGER: + tgt.setValue(ContactPoint.ContactPointSystem.PAGER); + break; + case URL: + tgt.setValue(ContactPoint.ContactPointSystem.URL); + break; + case SMS: + tgt.setValue(ContactPoint.ContactPointSystem.SMS); + break; + case OTHER: + tgt.setValue(ContactPoint.ContactPointSystem.OTHER); + break; + default: + tgt.setValue(ContactPoint.ContactPointSystem.NULL); + break; + } +} return tgt; } @@ -72,35 +73,35 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ContactPoint.ContactPointSystemEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case PHONE: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem.PHONE); - break; - case FAX: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem.FAX); - break; - case EMAIL: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem.EMAIL); - break; - case PAGER: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem.PAGER); - break; - case URL: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem.URL); - break; - case SMS: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem.SMS); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem.PHONE); + break; + case FAX: + tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem.FAX); + break; + case EMAIL: + tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem.EMAIL); + break; + case PAGER: + tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem.PAGER); + break; + case URL: + tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem.URL); + break; + case SMS: + tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem.SMS); + break; + case OTHER: + tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem.OTHER); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem.NULL); + break; + } +} return tgt; } @@ -109,29 +110,29 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ContactPoint.ContactPointUseEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HOME: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.HOME); - break; - case WORK: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.WORK); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.OLD); - break; - case MOBILE: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.MOBILE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.NULL); - break; - } - } + tgt.setValue(ContactPoint.ContactPointUse.HOME); + break; + case WORK: + tgt.setValue(ContactPoint.ContactPointUse.WORK); + break; + case TEMP: + tgt.setValue(ContactPoint.ContactPointUse.TEMP); + break; + case OLD: + tgt.setValue(ContactPoint.ContactPointUse.OLD); + break; + case MOBILE: + tgt.setValue(ContactPoint.ContactPointUse.MOBILE); + break; + default: + tgt.setValue(ContactPoint.ContactPointUse.NULL); + break; + } +} return tgt; } @@ -140,29 +141,29 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ContactPoint.ContactPointUseEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HOME: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointUse.HOME); - break; - case WORK: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointUse.WORK); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointUse.OLD); - break; - case MOBILE: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointUse.MOBILE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointUse.HOME); + break; + case WORK: + tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointUse.WORK); + break; + case TEMP: + tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointUse.TEMP); + break; + case OLD: + tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointUse.OLD); + break; + case MOBILE: + tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointUse.MOBILE); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.ContactPoint.ContactPointUse.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/general40_50/HumanName40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/general40_50/HumanName40_50.java index 07e9979769..67b219fb7b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/general40_50/HumanName40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/general40_50/HumanName40_50.java @@ -3,6 +3,7 @@ import org.hl7.fhir.convertors.context.ConversionContext40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.HumanName; public class HumanName40_50 { public static org.hl7.fhir.r5.model.HumanName convertHumanName(org.hl7.fhir.r4.model.HumanName src) throws FHIRException { @@ -38,35 +39,35 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.HumanName.NameUseEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case USUAL: - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.USUAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.OFFICIAL); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.TEMP); - break; - case NICKNAME: - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.NICKNAME); - break; - case ANONYMOUS: - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.ANONYMOUS); - break; - case OLD: - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.OLD); - break; - case MAIDEN: - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.MAIDEN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.NULL); - break; - } - } + tgt.setValue(HumanName.NameUse.USUAL); + break; + case OFFICIAL: + tgt.setValue(HumanName.NameUse.OFFICIAL); + break; + case TEMP: + tgt.setValue(HumanName.NameUse.TEMP); + break; + case NICKNAME: + tgt.setValue(HumanName.NameUse.NICKNAME); + break; + case ANONYMOUS: + tgt.setValue(HumanName.NameUse.ANONYMOUS); + break; + case OLD: + tgt.setValue(HumanName.NameUse.OLD); + break; + case MAIDEN: + tgt.setValue(HumanName.NameUse.MAIDEN); + break; + default: + tgt.setValue(HumanName.NameUse.NULL); + break; + } +} return tgt; } @@ -75,35 +76,35 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.HumanName.NameUseEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case USUAL: - tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.USUAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.OFFICIAL); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.TEMP); - break; - case NICKNAME: - tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.NICKNAME); - break; - case ANONYMOUS: - tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.ANONYMOUS); - break; - case OLD: - tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.OLD); - break; - case MAIDEN: - tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.MAIDEN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.USUAL); + break; + case OFFICIAL: + tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.OFFICIAL); + break; + case TEMP: + tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.TEMP); + break; + case NICKNAME: + tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.NICKNAME); + break; + case ANONYMOUS: + tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.ANONYMOUS); + break; + case OLD: + tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.OLD); + break; + case MAIDEN: + tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.MAIDEN); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.HumanName.NameUse.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/general40_50/Identifier40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/general40_50/Identifier40_50.java index 110c1354c8..7ad6351598 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/general40_50/Identifier40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/general40_50/Identifier40_50.java @@ -5,6 +5,7 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Uri40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Identifier; public class Identifier40_50 { public static org.hl7.fhir.r5.model.Identifier convertIdentifier(org.hl7.fhir.r4.model.Identifier src) throws FHIRException { @@ -38,29 +39,29 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Identifier.IdentifierUseEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Identifier.IdentifierUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case USUAL: - tgt.setValue(org.hl7.fhir.r5.model.Identifier.IdentifierUse.USUAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.r5.model.Identifier.IdentifierUse.OFFICIAL); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.r5.model.Identifier.IdentifierUse.TEMP); - break; - case SECONDARY: - tgt.setValue(org.hl7.fhir.r5.model.Identifier.IdentifierUse.SECONDARY); - break; - case OLD: - tgt.setValue(org.hl7.fhir.r5.model.Identifier.IdentifierUse.OLD); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Identifier.IdentifierUse.NULL); - break; - } - } + tgt.setValue(Identifier.IdentifierUse.USUAL); + break; + case OFFICIAL: + tgt.setValue(Identifier.IdentifierUse.OFFICIAL); + break; + case TEMP: + tgt.setValue(Identifier.IdentifierUse.TEMP); + break; + case SECONDARY: + tgt.setValue(Identifier.IdentifierUse.SECONDARY); + break; + case OLD: + tgt.setValue(Identifier.IdentifierUse.OLD); + break; + default: + tgt.setValue(Identifier.IdentifierUse.NULL); + break; + } +} return tgt; } @@ -69,29 +70,29 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Identifier.IdentifierUseEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Identifier.IdentifierUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case USUAL: - tgt.setValue(org.hl7.fhir.r4.model.Identifier.IdentifierUse.USUAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.r4.model.Identifier.IdentifierUse.OFFICIAL); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.r4.model.Identifier.IdentifierUse.TEMP); - break; - case SECONDARY: - tgt.setValue(org.hl7.fhir.r4.model.Identifier.IdentifierUse.SECONDARY); - break; - case OLD: - tgt.setValue(org.hl7.fhir.r4.model.Identifier.IdentifierUse.OLD); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Identifier.IdentifierUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4.model.Identifier.IdentifierUse.USUAL); + break; + case OFFICIAL: + tgt.setValue(org.hl7.fhir.r4.model.Identifier.IdentifierUse.OFFICIAL); + break; + case TEMP: + tgt.setValue(org.hl7.fhir.r4.model.Identifier.IdentifierUse.TEMP); + break; + case SECONDARY: + tgt.setValue(org.hl7.fhir.r4.model.Identifier.IdentifierUse.SECONDARY); + break; + case OLD: + tgt.setValue(org.hl7.fhir.r4.model.Identifier.IdentifierUse.OLD); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Identifier.IdentifierUse.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/general40_50/Quantity40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/general40_50/Quantity40_50.java index 6b673f8616..5f46a499d9 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/general40_50/Quantity40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/general40_50/Quantity40_50.java @@ -6,6 +6,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Uri40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Quantity; +import org.hl7.fhir.r5.model.Enumerations; public class Quantity40_50 { public static org.hl7.fhir.r5.model.Quantity convertQuantity(org.hl7.fhir.r4.model.Quantity src) throws FHIRException { @@ -37,26 +39,26 @@ public static org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.QuantityComparatorEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.QuantityComparator.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case LESS_THAN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.QuantityComparator.LESS_THAN); - break; - case LESS_OR_EQUAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.QuantityComparator.LESS_OR_EQUAL); - break; - case GREATER_OR_EQUAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.QuantityComparator.GREATER_OR_EQUAL); - break; - case GREATER_THAN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.QuantityComparator.GREATER_THAN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.QuantityComparator.NULL); - break; - } - } + tgt.setValue(Enumerations.QuantityComparator.LESS_THAN); + break; + case LESS_OR_EQUAL: + tgt.setValue(Enumerations.QuantityComparator.LESS_OR_EQUAL); + break; + case GREATER_OR_EQUAL: + tgt.setValue(Enumerations.QuantityComparator.GREATER_OR_EQUAL); + break; + case GREATER_THAN: + tgt.setValue(Enumerations.QuantityComparator.GREATER_THAN); + break; + default: + tgt.setValue(Enumerations.QuantityComparator.NULL); + break; + } +} return tgt; } @@ -65,26 +67,26 @@ public static org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Quantity.QuantityComparatorEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Quantity.QuantityComparator.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case LESS_THAN: - tgt.setValue(org.hl7.fhir.r4.model.Quantity.QuantityComparator.LESS_THAN); - break; - case LESS_OR_EQUAL: - tgt.setValue(org.hl7.fhir.r4.model.Quantity.QuantityComparator.LESS_OR_EQUAL); - break; - case GREATER_OR_EQUAL: - tgt.setValue(org.hl7.fhir.r4.model.Quantity.QuantityComparator.GREATER_OR_EQUAL); - break; - case GREATER_THAN: - tgt.setValue(org.hl7.fhir.r4.model.Quantity.QuantityComparator.GREATER_THAN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Quantity.QuantityComparator.NULL); - break; - } - } + tgt.setValue(Quantity.QuantityComparator.LESS_THAN); + break; + case LESS_OR_EQUAL: + tgt.setValue(Quantity.QuantityComparator.LESS_OR_EQUAL); + break; + case GREATER_OR_EQUAL: + tgt.setValue(Quantity.QuantityComparator.GREATER_OR_EQUAL); + break; + case GREATER_THAN: + tgt.setValue(Quantity.QuantityComparator.GREATER_THAN); + break; + default: + tgt.setValue(Quantity.QuantityComparator.NULL); + break; + } +} return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/general40_50/Timing40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/general40_50/Timing40_50.java index f48c9b22a8..460d3c839a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/general40_50/Timing40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/general40_50/Timing40_50.java @@ -10,6 +10,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Time40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.UnsignedInt40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumerations; +import org.hl7.fhir.r5.model.Timing; public class Timing40_50 { public static org.hl7.fhir.r4.model.Timing convertTiming(org.hl7.fhir.r5.model.Timing src) throws FHIRException { @@ -87,35 +89,35 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Timing.UnitsOfTimeEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case S: - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.S); - break; - case MIN: - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.MIN); - break; - case H: - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.H); - break; - case D: - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.D); - break; - case WK: - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.WK); - break; - case MO: - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.MO); - break; - case A: - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.A); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.NULL); - break; - } - } + tgt.setValue(Timing.UnitsOfTime.S); + break; + case MIN: + tgt.setValue(Timing.UnitsOfTime.MIN); + break; + case H: + tgt.setValue(Timing.UnitsOfTime.H); + break; + case D: + tgt.setValue(Timing.UnitsOfTime.D); + break; + case WK: + tgt.setValue(Timing.UnitsOfTime.WK); + break; + case MO: + tgt.setValue(Timing.UnitsOfTime.MO); + break; + case A: + tgt.setValue(Timing.UnitsOfTime.A); + break; + default: + tgt.setValue(Timing.UnitsOfTime.NULL); + break; + } +} return tgt; } @@ -124,35 +126,35 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Timing.UnitsOfTimeEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case S: - tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.S); - break; - case MIN: - tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.MIN); - break; - case H: - tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.H); - break; - case D: - tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.D); - break; - case WK: - tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.WK); - break; - case MO: - tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.MO); - break; - case A: - tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.A); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.S); + break; + case MIN: + tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.MIN); + break; + case H: + tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.H); + break; + case D: + tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.D); + break; + case WK: + tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.WK); + break; + case MO: + tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.MO); + break; + case A: + tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.A); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Timing.UnitsOfTime.NULL); + break; + } +} return tgt; } @@ -161,35 +163,35 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.DaysOfWeekEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case MON: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.MON); - break; - case TUE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.TUE); - break; - case WED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.WED); - break; - case THU: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.THU); - break; - case FRI: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.FRI); - break; - case SAT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.SAT); - break; - case SUN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.SUN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.NULL); - break; - } - } + tgt.setValue(Enumerations.DaysOfWeek.MON); + break; + case TUE: + tgt.setValue(Enumerations.DaysOfWeek.TUE); + break; + case WED: + tgt.setValue(Enumerations.DaysOfWeek.WED); + break; + case THU: + tgt.setValue(Enumerations.DaysOfWeek.THU); + break; + case FRI: + tgt.setValue(Enumerations.DaysOfWeek.FRI); + break; + case SAT: + tgt.setValue(Enumerations.DaysOfWeek.SAT); + break; + case SUN: + tgt.setValue(Enumerations.DaysOfWeek.SUN); + break; + default: + tgt.setValue(Enumerations.DaysOfWeek.NULL); + break; + } +} return tgt; } @@ -198,35 +200,35 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Timing.DayOfWeekEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Timing.DayOfWeek.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case MON: - tgt.setValue(org.hl7.fhir.r4.model.Timing.DayOfWeek.MON); - break; - case TUE: - tgt.setValue(org.hl7.fhir.r4.model.Timing.DayOfWeek.TUE); - break; - case WED: - tgt.setValue(org.hl7.fhir.r4.model.Timing.DayOfWeek.WED); - break; - case THU: - tgt.setValue(org.hl7.fhir.r4.model.Timing.DayOfWeek.THU); - break; - case FRI: - tgt.setValue(org.hl7.fhir.r4.model.Timing.DayOfWeek.FRI); - break; - case SAT: - tgt.setValue(org.hl7.fhir.r4.model.Timing.DayOfWeek.SAT); - break; - case SUN: - tgt.setValue(org.hl7.fhir.r4.model.Timing.DayOfWeek.SUN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Timing.DayOfWeek.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4.model.Timing.DayOfWeek.MON); + break; + case TUE: + tgt.setValue(org.hl7.fhir.r4.model.Timing.DayOfWeek.TUE); + break; + case WED: + tgt.setValue(org.hl7.fhir.r4.model.Timing.DayOfWeek.WED); + break; + case THU: + tgt.setValue(org.hl7.fhir.r4.model.Timing.DayOfWeek.THU); + break; + case FRI: + tgt.setValue(org.hl7.fhir.r4.model.Timing.DayOfWeek.FRI); + break; + case SAT: + tgt.setValue(org.hl7.fhir.r4.model.Timing.DayOfWeek.SAT); + break; + case SUN: + tgt.setValue(org.hl7.fhir.r4.model.Timing.DayOfWeek.SUN); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Timing.DayOfWeek.NULL); + break; + } +} return tgt; } @@ -235,92 +237,92 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Timing.EventTimingEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case MORN: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.MORN); - break; - case MORN_EARLY: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.MORN_EARLY); - break; - case MORN_LATE: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.MORN_LATE); - break; - case NOON: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.NOON); - break; - case AFT: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.AFT); - break; - case AFT_EARLY: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.AFT_EARLY); - break; - case AFT_LATE: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.AFT_LATE); - break; - case EVE: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.EVE); - break; - case EVE_EARLY: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.EVE_EARLY); - break; - case EVE_LATE: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.EVE_LATE); - break; - case NIGHT: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.NIGHT); - break; - case PHS: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.PHS); - break; - case HS: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.HS); - break; - case WAKE: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.WAKE); - break; - case C: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.C); - break; - case CM: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.CM); - break; - case CD: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.CD); - break; - case CV: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.CV); - break; - case AC: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.AC); - break; - case ACM: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.ACM); - break; - case ACD: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.ACD); - break; - case ACV: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.ACV); - break; - case PC: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.PC); - break; - case PCM: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.PCM); - break; - case PCD: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.PCD); - break; - case PCV: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.PCV); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.NULL); - break; - } - } + tgt.setValue(Timing.EventTiming.MORN); + break; + case MORN_EARLY: + tgt.setValue(Timing.EventTiming.MORN_EARLY); + break; + case MORN_LATE: + tgt.setValue(Timing.EventTiming.MORN_LATE); + break; + case NOON: + tgt.setValue(Timing.EventTiming.NOON); + break; + case AFT: + tgt.setValue(Timing.EventTiming.AFT); + break; + case AFT_EARLY: + tgt.setValue(Timing.EventTiming.AFT_EARLY); + break; + case AFT_LATE: + tgt.setValue(Timing.EventTiming.AFT_LATE); + break; + case EVE: + tgt.setValue(Timing.EventTiming.EVE); + break; + case EVE_EARLY: + tgt.setValue(Timing.EventTiming.EVE_EARLY); + break; + case EVE_LATE: + tgt.setValue(Timing.EventTiming.EVE_LATE); + break; + case NIGHT: + tgt.setValue(Timing.EventTiming.NIGHT); + break; + case PHS: + tgt.setValue(Timing.EventTiming.PHS); + break; + case HS: + tgt.setValue(Timing.EventTiming.HS); + break; + case WAKE: + tgt.setValue(Timing.EventTiming.WAKE); + break; + case C: + tgt.setValue(Timing.EventTiming.C); + break; + case CM: + tgt.setValue(Timing.EventTiming.CM); + break; + case CD: + tgt.setValue(Timing.EventTiming.CD); + break; + case CV: + tgt.setValue(Timing.EventTiming.CV); + break; + case AC: + tgt.setValue(Timing.EventTiming.AC); + break; + case ACM: + tgt.setValue(Timing.EventTiming.ACM); + break; + case ACD: + tgt.setValue(Timing.EventTiming.ACD); + break; + case ACV: + tgt.setValue(Timing.EventTiming.ACV); + break; + case PC: + tgt.setValue(Timing.EventTiming.PC); + break; + case PCM: + tgt.setValue(Timing.EventTiming.PCM); + break; + case PCD: + tgt.setValue(Timing.EventTiming.PCD); + break; + case PCV: + tgt.setValue(Timing.EventTiming.PCV); + break; + default: + tgt.setValue(Timing.EventTiming.NULL); + break; + } +} return tgt; } @@ -329,92 +331,92 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Timing.EventTimingEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case MORN: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.MORN); - break; - case MORN_EARLY: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.MORN_EARLY); - break; - case MORN_LATE: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.MORN_LATE); - break; - case NOON: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.NOON); - break; - case AFT: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.AFT); - break; - case AFT_EARLY: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.AFT_EARLY); - break; - case AFT_LATE: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.AFT_LATE); - break; - case EVE: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.EVE); - break; - case EVE_EARLY: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.EVE_EARLY); - break; - case EVE_LATE: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.EVE_LATE); - break; - case NIGHT: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.NIGHT); - break; - case PHS: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.PHS); - break; - case HS: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.HS); - break; - case WAKE: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.WAKE); - break; - case C: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.C); - break; - case CM: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.CM); - break; - case CD: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.CD); - break; - case CV: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.CV); - break; - case AC: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.AC); - break; - case ACM: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.ACM); - break; - case ACD: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.ACD); - break; - case ACV: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.ACV); - break; - case PC: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.PC); - break; - case PCM: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.PCM); - break; - case PCD: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.PCD); - break; - case PCV: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.PCV); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.MORN); + break; + case MORN_EARLY: + tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.MORN_EARLY); + break; + case MORN_LATE: + tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.MORN_LATE); + break; + case NOON: + tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.NOON); + break; + case AFT: + tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.AFT); + break; + case AFT_EARLY: + tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.AFT_EARLY); + break; + case AFT_LATE: + tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.AFT_LATE); + break; + case EVE: + tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.EVE); + break; + case EVE_EARLY: + tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.EVE_EARLY); + break; + case EVE_LATE: + tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.EVE_LATE); + break; + case NIGHT: + tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.NIGHT); + break; + case PHS: + tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.PHS); + break; + case HS: + tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.HS); + break; + case WAKE: + tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.WAKE); + break; + case C: + tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.C); + break; + case CM: + tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.CM); + break; + case CD: + tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.CD); + break; + case CV: + tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.CV); + break; + case AC: + tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.AC); + break; + case ACM: + tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.ACM); + break; + case ACD: + tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.ACD); + break; + case ACV: + tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.ACV); + break; + case PC: + tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.PC); + break; + case PCM: + tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.PCM); + break; + case PCD: + tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.PCD); + break; + case PCV: + tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.PCV); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Timing.EventTiming.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/metadata40_50/Contributor40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/metadata40_50/Contributor40_50.java index 62caeaa7fd..bf44c00ea1 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/metadata40_50/Contributor40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/metadata40_50/Contributor40_50.java @@ -3,6 +3,7 @@ import org.hl7.fhir.convertors.context.ConversionContext40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Contributor; public class Contributor40_50 { public static org.hl7.fhir.r5.model.Contributor convertContributor(org.hl7.fhir.r4.model.Contributor src) throws FHIRException { @@ -32,26 +33,26 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Contributor.ContributorTypeEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Contributor.ContributorType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case AUTHOR: - tgt.setValue(org.hl7.fhir.r5.model.Contributor.ContributorType.AUTHOR); - break; - case EDITOR: - tgt.setValue(org.hl7.fhir.r5.model.Contributor.ContributorType.EDITOR); - break; - case REVIEWER: - tgt.setValue(org.hl7.fhir.r5.model.Contributor.ContributorType.REVIEWER); - break; - case ENDORSER: - tgt.setValue(org.hl7.fhir.r5.model.Contributor.ContributorType.ENDORSER); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Contributor.ContributorType.NULL); - break; - } - } + tgt.setValue(Contributor.ContributorType.AUTHOR); + break; + case EDITOR: + tgt.setValue(Contributor.ContributorType.EDITOR); + break; + case REVIEWER: + tgt.setValue(Contributor.ContributorType.REVIEWER); + break; + case ENDORSER: + tgt.setValue(Contributor.ContributorType.ENDORSER); + break; + default: + tgt.setValue(Contributor.ContributorType.NULL); + break; + } +} return tgt; } @@ -60,26 +61,26 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Contributor.ContributorTypeEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Contributor.ContributorType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case AUTHOR: - tgt.setValue(org.hl7.fhir.r4.model.Contributor.ContributorType.AUTHOR); - break; - case EDITOR: - tgt.setValue(org.hl7.fhir.r4.model.Contributor.ContributorType.EDITOR); - break; - case REVIEWER: - tgt.setValue(org.hl7.fhir.r4.model.Contributor.ContributorType.REVIEWER); - break; - case ENDORSER: - tgt.setValue(org.hl7.fhir.r4.model.Contributor.ContributorType.ENDORSER); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Contributor.ContributorType.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4.model.Contributor.ContributorType.AUTHOR); + break; + case EDITOR: + tgt.setValue(org.hl7.fhir.r4.model.Contributor.ContributorType.EDITOR); + break; + case REVIEWER: + tgt.setValue(org.hl7.fhir.r4.model.Contributor.ContributorType.REVIEWER); + break; + case ENDORSER: + tgt.setValue(org.hl7.fhir.r4.model.Contributor.ContributorType.ENDORSER); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Contributor.ContributorType.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/metadata40_50/DataRequirement40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/metadata40_50/DataRequirement40_50.java index f13dd92e22..71a9fb56e5 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/metadata40_50/DataRequirement40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/metadata40_50/DataRequirement40_50.java @@ -7,6 +7,7 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.PositiveInt40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.DataRequirement; public class DataRequirement40_50 { public static org.hl7.fhir.r5.model.DataRequirement convertDataRequirement(org.hl7.fhir.r4.model.DataRequirement src) throws FHIRException { @@ -122,20 +123,20 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DataRequirement.SortDirectionEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.DataRequirement.SortDirection.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case ASCENDING: - tgt.setValue(org.hl7.fhir.r5.model.DataRequirement.SortDirection.ASCENDING); - break; - case DESCENDING: - tgt.setValue(org.hl7.fhir.r5.model.DataRequirement.SortDirection.DESCENDING); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.DataRequirement.SortDirection.NULL); - break; - } - } + tgt.setValue(DataRequirement.SortDirection.ASCENDING); + break; + case DESCENDING: + tgt.setValue(DataRequirement.SortDirection.DESCENDING); + break; + default: + tgt.setValue(DataRequirement.SortDirection.NULL); + break; + } +} return tgt; } @@ -144,20 +145,20 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.DataRequirement.SortDirectionEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.DataRequirement.SortDirection.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case ASCENDING: - tgt.setValue(org.hl7.fhir.r4.model.DataRequirement.SortDirection.ASCENDING); - break; - case DESCENDING: - tgt.setValue(org.hl7.fhir.r4.model.DataRequirement.SortDirection.DESCENDING); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.DataRequirement.SortDirection.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4.model.DataRequirement.SortDirection.ASCENDING); + break; + case DESCENDING: + tgt.setValue(org.hl7.fhir.r4.model.DataRequirement.SortDirection.DESCENDING); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.DataRequirement.SortDirection.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/metadata40_50/ParameterDefinition40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/metadata40_50/ParameterDefinition40_50.java index 8838e3021f..81ab2cc646 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/metadata40_50/ParameterDefinition40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/metadata40_50/ParameterDefinition40_50.java @@ -7,6 +7,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Integer40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.ParameterDefinition; +import org.hl7.fhir.r5.model.Enumerations; public class ParameterDefinition40_50 { public static org.hl7.fhir.r5.model.ParameterDefinition convertParameterDefinition(org.hl7.fhir.r4.model.ParameterDefinition src) throws FHIRException { @@ -46,20 +48,20 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.OperationParameterUseEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.OperationParameterUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case IN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.OperationParameterUse.IN); - break; - case OUT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.OperationParameterUse.OUT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.OperationParameterUse.NULL); - break; - } - } + tgt.setValue(Enumerations.OperationParameterUse.IN); + break; + case OUT: + tgt.setValue(Enumerations.OperationParameterUse.OUT); + break; + default: + tgt.setValue(Enumerations.OperationParameterUse.NULL); + break; + } +} return tgt; } @@ -68,20 +70,20 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ParameterDefinition.ParameterUseEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.ParameterDefinition.ParameterUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case IN: - tgt.setValue(org.hl7.fhir.r4.model.ParameterDefinition.ParameterUse.IN); - break; - case OUT: - tgt.setValue(org.hl7.fhir.r4.model.ParameterDefinition.ParameterUse.OUT); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ParameterDefinition.ParameterUse.NULL); - break; - } - } + tgt.setValue(ParameterDefinition.ParameterUse.IN); + break; + case OUT: + tgt.setValue(ParameterDefinition.ParameterUse.OUT); + break; + default: + tgt.setValue(ParameterDefinition.ParameterUse.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/metadata40_50/RelatedArtifact40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/metadata40_50/RelatedArtifact40_50.java index 0ffcb64a4c..15d041fb65 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/metadata40_50/RelatedArtifact40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/metadata40_50/RelatedArtifact40_50.java @@ -7,6 +7,7 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Url40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.RelatedArtifact; public class RelatedArtifact40_50 { public static org.hl7.fhir.r5.model.RelatedArtifact convertRelatedArtifact(org.hl7.fhir.r4.model.RelatedArtifact src) throws FHIRException { @@ -42,38 +43,38 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactTypeEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case DOCUMENTATION: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.DOCUMENTATION); - break; - case JUSTIFICATION: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.JUSTIFICATION); - break; - case CITATION: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.CITATION); - break; - case PREDECESSOR: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.PREDECESSOR); - break; - case SUCCESSOR: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.SUCCESSOR); - break; - case DERIVEDFROM: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.DERIVEDFROM); - break; - case DEPENDSON: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.DEPENDSON); - break; - case COMPOSEDOF: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.COMPOSEDOF); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.NULL); - break; - } - } + tgt.setValue(RelatedArtifact.RelatedArtifactType.DOCUMENTATION); + break; + case JUSTIFICATION: + tgt.setValue(RelatedArtifact.RelatedArtifactType.JUSTIFICATION); + break; + case CITATION: + tgt.setValue(RelatedArtifact.RelatedArtifactType.CITATION); + break; + case PREDECESSOR: + tgt.setValue(RelatedArtifact.RelatedArtifactType.PREDECESSOR); + break; + case SUCCESSOR: + tgt.setValue(RelatedArtifact.RelatedArtifactType.SUCCESSOR); + break; + case DERIVEDFROM: + tgt.setValue(RelatedArtifact.RelatedArtifactType.DERIVEDFROM); + break; + case DEPENDSON: + tgt.setValue(RelatedArtifact.RelatedArtifactType.DEPENDSON); + break; + case COMPOSEDOF: + tgt.setValue(RelatedArtifact.RelatedArtifactType.COMPOSEDOF); + break; + default: + tgt.setValue(RelatedArtifact.RelatedArtifactType.NULL); + break; + } +} return tgt; } @@ -82,38 +83,38 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.RelatedArtifact.RelatedArtifactTypeEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.RelatedArtifact.RelatedArtifactType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case DOCUMENTATION: - tgt.setValue(org.hl7.fhir.r4.model.RelatedArtifact.RelatedArtifactType.DOCUMENTATION); - break; - case JUSTIFICATION: - tgt.setValue(org.hl7.fhir.r4.model.RelatedArtifact.RelatedArtifactType.JUSTIFICATION); - break; - case CITATION: - tgt.setValue(org.hl7.fhir.r4.model.RelatedArtifact.RelatedArtifactType.CITATION); - break; - case PREDECESSOR: - tgt.setValue(org.hl7.fhir.r4.model.RelatedArtifact.RelatedArtifactType.PREDECESSOR); - break; - case SUCCESSOR: - tgt.setValue(org.hl7.fhir.r4.model.RelatedArtifact.RelatedArtifactType.SUCCESSOR); - break; - case DERIVEDFROM: - tgt.setValue(org.hl7.fhir.r4.model.RelatedArtifact.RelatedArtifactType.DERIVEDFROM); - break; - case DEPENDSON: - tgt.setValue(org.hl7.fhir.r4.model.RelatedArtifact.RelatedArtifactType.DEPENDSON); - break; - case COMPOSEDOF: - tgt.setValue(org.hl7.fhir.r4.model.RelatedArtifact.RelatedArtifactType.COMPOSEDOF); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.RelatedArtifact.RelatedArtifactType.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4.model.RelatedArtifact.RelatedArtifactType.DOCUMENTATION); + break; + case JUSTIFICATION: + tgt.setValue(org.hl7.fhir.r4.model.RelatedArtifact.RelatedArtifactType.JUSTIFICATION); + break; + case CITATION: + tgt.setValue(org.hl7.fhir.r4.model.RelatedArtifact.RelatedArtifactType.CITATION); + break; + case PREDECESSOR: + tgt.setValue(org.hl7.fhir.r4.model.RelatedArtifact.RelatedArtifactType.PREDECESSOR); + break; + case SUCCESSOR: + tgt.setValue(org.hl7.fhir.r4.model.RelatedArtifact.RelatedArtifactType.SUCCESSOR); + break; + case DERIVEDFROM: + tgt.setValue(org.hl7.fhir.r4.model.RelatedArtifact.RelatedArtifactType.DERIVEDFROM); + break; + case DEPENDSON: + tgt.setValue(org.hl7.fhir.r4.model.RelatedArtifact.RelatedArtifactType.DEPENDSON); + break; + case COMPOSEDOF: + tgt.setValue(org.hl7.fhir.r4.model.RelatedArtifact.RelatedArtifactType.COMPOSEDOF); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.RelatedArtifact.RelatedArtifactType.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/metadata40_50/TriggerDefinition40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/metadata40_50/TriggerDefinition40_50.java index 656f90c44d..2d257d908a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/metadata40_50/TriggerDefinition40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/metadata40_50/TriggerDefinition40_50.java @@ -3,6 +3,7 @@ import org.hl7.fhir.convertors.context.ConversionContext40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.TriggerDefinition; public class TriggerDefinition40_50 { public static org.hl7.fhir.r5.model.TriggerDefinition convertTriggerDefinition(org.hl7.fhir.r4.model.TriggerDefinition src) throws FHIRException { @@ -38,38 +39,38 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TriggerDefinition.TriggerTypeEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.TriggerDefinition.TriggerType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case NAMEDEVENT: - tgt.setValue(org.hl7.fhir.r5.model.TriggerDefinition.TriggerType.NAMEDEVENT); - break; - case PERIODIC: - tgt.setValue(org.hl7.fhir.r5.model.TriggerDefinition.TriggerType.PERIODIC); - break; - case DATACHANGED: - tgt.setValue(org.hl7.fhir.r5.model.TriggerDefinition.TriggerType.DATACHANGED); - break; - case DATAADDED: - tgt.setValue(org.hl7.fhir.r5.model.TriggerDefinition.TriggerType.DATAADDED); - break; - case DATAMODIFIED: - tgt.setValue(org.hl7.fhir.r5.model.TriggerDefinition.TriggerType.DATAMODIFIED); - break; - case DATAREMOVED: - tgt.setValue(org.hl7.fhir.r5.model.TriggerDefinition.TriggerType.DATAREMOVED); - break; - case DATAACCESSED: - tgt.setValue(org.hl7.fhir.r5.model.TriggerDefinition.TriggerType.DATAACCESSED); - break; - case DATAACCESSENDED: - tgt.setValue(org.hl7.fhir.r5.model.TriggerDefinition.TriggerType.DATAACCESSENDED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.TriggerDefinition.TriggerType.NULL); - break; - } - } + tgt.setValue(TriggerDefinition.TriggerType.NAMEDEVENT); + break; + case PERIODIC: + tgt.setValue(TriggerDefinition.TriggerType.PERIODIC); + break; + case DATACHANGED: + tgt.setValue(TriggerDefinition.TriggerType.DATACHANGED); + break; + case DATAADDED: + tgt.setValue(TriggerDefinition.TriggerType.DATAADDED); + break; + case DATAMODIFIED: + tgt.setValue(TriggerDefinition.TriggerType.DATAMODIFIED); + break; + case DATAREMOVED: + tgt.setValue(TriggerDefinition.TriggerType.DATAREMOVED); + break; + case DATAACCESSED: + tgt.setValue(TriggerDefinition.TriggerType.DATAACCESSED); + break; + case DATAACCESSENDED: + tgt.setValue(TriggerDefinition.TriggerType.DATAACCESSENDED); + break; + default: + tgt.setValue(TriggerDefinition.TriggerType.NULL); + break; + } +} return tgt; } @@ -78,38 +79,38 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TriggerDefinition.TriggerTypeEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.TriggerDefinition.TriggerType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case NAMEDEVENT: - tgt.setValue(org.hl7.fhir.r4.model.TriggerDefinition.TriggerType.NAMEDEVENT); - break; - case PERIODIC: - tgt.setValue(org.hl7.fhir.r4.model.TriggerDefinition.TriggerType.PERIODIC); - break; - case DATACHANGED: - tgt.setValue(org.hl7.fhir.r4.model.TriggerDefinition.TriggerType.DATACHANGED); - break; - case DATAADDED: - tgt.setValue(org.hl7.fhir.r4.model.TriggerDefinition.TriggerType.DATAADDED); - break; - case DATAMODIFIED: - tgt.setValue(org.hl7.fhir.r4.model.TriggerDefinition.TriggerType.DATAMODIFIED); - break; - case DATAREMOVED: - tgt.setValue(org.hl7.fhir.r4.model.TriggerDefinition.TriggerType.DATAREMOVED); - break; - case DATAACCESSED: - tgt.setValue(org.hl7.fhir.r4.model.TriggerDefinition.TriggerType.DATAACCESSED); - break; - case DATAACCESSENDED: - tgt.setValue(org.hl7.fhir.r4.model.TriggerDefinition.TriggerType.DATAACCESSENDED); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.TriggerDefinition.TriggerType.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4.model.TriggerDefinition.TriggerType.NAMEDEVENT); + break; + case PERIODIC: + tgt.setValue(org.hl7.fhir.r4.model.TriggerDefinition.TriggerType.PERIODIC); + break; + case DATACHANGED: + tgt.setValue(org.hl7.fhir.r4.model.TriggerDefinition.TriggerType.DATACHANGED); + break; + case DATAADDED: + tgt.setValue(org.hl7.fhir.r4.model.TriggerDefinition.TriggerType.DATAADDED); + break; + case DATAMODIFIED: + tgt.setValue(org.hl7.fhir.r4.model.TriggerDefinition.TriggerType.DATAMODIFIED); + break; + case DATAREMOVED: + tgt.setValue(org.hl7.fhir.r4.model.TriggerDefinition.TriggerType.DATAREMOVED); + break; + case DATAACCESSED: + tgt.setValue(org.hl7.fhir.r4.model.TriggerDefinition.TriggerType.DATAACCESSED); + break; + case DATAACCESSENDED: + tgt.setValue(org.hl7.fhir.r4.model.TriggerDefinition.TriggerType.DATAACCESSENDED); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.TriggerDefinition.TriggerType.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/special40_50/ElementDefinition40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/special40_50/ElementDefinition40_50.java index 8eb57d5540..552f6196b0 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/special40_50/ElementDefinition40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/special40_50/ElementDefinition40_50.java @@ -23,6 +23,7 @@ import org.hl7.fhir.r4.model.MarkdownType; import org.hl7.fhir.r4.model.StringType; import org.hl7.fhir.r5.model.CodeType; +import org.hl7.fhir.r5.model.ElementDefinition; import org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionBindingAdditionalComponent; import org.hl7.fhir.r5.model.UsageContext; import org.hl7.fhir.r5.utils.ToolingExtensions; @@ -159,29 +160,29 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentationEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case XMLATTR: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.XMLATTR); - break; - case XMLTEXT: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.XMLTEXT); - break; - case TYPEATTR: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.TYPEATTR); - break; - case CDATEXT: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.CDATEXT); - break; - case XHTML: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.XHTML); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.NULL); - break; - } - } + tgt.setValue(ElementDefinition.PropertyRepresentation.XMLATTR); + break; + case XMLTEXT: + tgt.setValue(ElementDefinition.PropertyRepresentation.XMLTEXT); + break; + case TYPEATTR: + tgt.setValue(ElementDefinition.PropertyRepresentation.TYPEATTR); + break; + case CDATEXT: + tgt.setValue(ElementDefinition.PropertyRepresentation.CDATEXT); + break; + case XHTML: + tgt.setValue(ElementDefinition.PropertyRepresentation.XHTML); + break; + default: + tgt.setValue(ElementDefinition.PropertyRepresentation.NULL); + break; + } +} return tgt; } @@ -190,29 +191,29 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ElementDefinition.PropertyRepresentationEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.PropertyRepresentation.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case XMLATTR: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.PropertyRepresentation.XMLATTR); - break; - case XMLTEXT: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.PropertyRepresentation.XMLTEXT); - break; - case TYPEATTR: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.PropertyRepresentation.TYPEATTR); - break; - case CDATEXT: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.PropertyRepresentation.CDATEXT); - break; - case XHTML: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.PropertyRepresentation.XHTML); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.PropertyRepresentation.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.PropertyRepresentation.XMLATTR); + break; + case XMLTEXT: + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.PropertyRepresentation.XMLTEXT); + break; + case TYPEATTR: + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.PropertyRepresentation.TYPEATTR); + break; + case CDATEXT: + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.PropertyRepresentation.CDATEXT); + break; + case XHTML: + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.PropertyRepresentation.XHTML); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.PropertyRepresentation.NULL); + break; + } +} return tgt; } @@ -245,23 +246,23 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ElementDefinition.SlicingRulesEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.SlicingRules.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CLOSED: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.SlicingRules.CLOSED); - break; - case OPEN: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.SlicingRules.OPEN); - break; - case OPENATEND: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.SlicingRules.OPENATEND); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.SlicingRules.NULL); - break; - } - } + tgt.setValue(ElementDefinition.SlicingRules.CLOSED); + break; + case OPEN: + tgt.setValue(ElementDefinition.SlicingRules.OPEN); + break; + case OPENATEND: + tgt.setValue(ElementDefinition.SlicingRules.OPENATEND); + break; + default: + tgt.setValue(ElementDefinition.SlicingRules.NULL); + break; + } +} return tgt; } @@ -270,23 +271,23 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ElementDefinition.SlicingRulesEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.SlicingRules.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CLOSED: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.SlicingRules.CLOSED); - break; - case OPEN: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.SlicingRules.OPEN); - break; - case OPENATEND: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.SlicingRules.OPENATEND); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.SlicingRules.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.SlicingRules.CLOSED); + break; + case OPEN: + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.SlicingRules.OPEN); + break; + case OPENATEND: + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.SlicingRules.OPENATEND); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.SlicingRules.NULL); + break; + } +} return tgt; } @@ -313,29 +314,29 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ElementDefinition.DiscriminatorTypeEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.DiscriminatorType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case VALUE: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.DiscriminatorType.VALUE); - break; - case EXISTS: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.DiscriminatorType.EXISTS); - break; - case PATTERN: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.DiscriminatorType.PATTERN); - break; - case TYPE: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.DiscriminatorType.TYPE); - break; - case PROFILE: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.DiscriminatorType.PROFILE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.DiscriminatorType.NULL); - break; - } - } + tgt.setValue(ElementDefinition.DiscriminatorType.VALUE); + break; + case EXISTS: + tgt.setValue(ElementDefinition.DiscriminatorType.EXISTS); + break; + case PATTERN: + tgt.setValue(ElementDefinition.DiscriminatorType.PATTERN); + break; + case TYPE: + tgt.setValue(ElementDefinition.DiscriminatorType.TYPE); + break; + case PROFILE: + tgt.setValue(ElementDefinition.DiscriminatorType.PROFILE); + break; + default: + tgt.setValue(ElementDefinition.DiscriminatorType.NULL); + break; + } +} return tgt; } @@ -344,29 +345,29 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ElementDefinition.DiscriminatorTypeEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.DiscriminatorType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case VALUE: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.DiscriminatorType.VALUE); - break; - case EXISTS: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.DiscriminatorType.EXISTS); - break; - case PATTERN: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.DiscriminatorType.PATTERN); - break; - case TYPE: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.DiscriminatorType.TYPE); - break; - case PROFILE: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.DiscriminatorType.PROFILE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.DiscriminatorType.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.DiscriminatorType.VALUE); + break; + case EXISTS: + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.DiscriminatorType.EXISTS); + break; + case PATTERN: + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.DiscriminatorType.PATTERN); + break; + case TYPE: + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.DiscriminatorType.TYPE); + break; + case PROFILE: + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.DiscriminatorType.PROFILE); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.DiscriminatorType.NULL); + break; + } +} return tgt; } @@ -423,23 +424,23 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ElementDefinition.AggregationModeEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.AggregationMode.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CONTAINED: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.AggregationMode.CONTAINED); - break; - case REFERENCED: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.AggregationMode.REFERENCED); - break; - case BUNDLED: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.AggregationMode.BUNDLED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.AggregationMode.NULL); - break; - } - } + tgt.setValue(ElementDefinition.AggregationMode.CONTAINED); + break; + case REFERENCED: + tgt.setValue(ElementDefinition.AggregationMode.REFERENCED); + break; + case BUNDLED: + tgt.setValue(ElementDefinition.AggregationMode.BUNDLED); + break; + default: + tgt.setValue(ElementDefinition.AggregationMode.NULL); + break; + } +} return tgt; } @@ -448,23 +449,23 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ElementDefinition.AggregationModeEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.AggregationMode.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CONTAINED: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.AggregationMode.CONTAINED); - break; - case REFERENCED: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.AggregationMode.REFERENCED); - break; - case BUNDLED: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.AggregationMode.BUNDLED); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.AggregationMode.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.AggregationMode.CONTAINED); + break; + case REFERENCED: + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.AggregationMode.REFERENCED); + break; + case BUNDLED: + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.AggregationMode.BUNDLED); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.AggregationMode.NULL); + break; + } +} return tgt; } @@ -473,23 +474,23 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ElementDefinition.ReferenceVersionRulesEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ReferenceVersionRules.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case EITHER: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ReferenceVersionRules.EITHER); - break; - case INDEPENDENT: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ReferenceVersionRules.INDEPENDENT); - break; - case SPECIFIC: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ReferenceVersionRules.SPECIFIC); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ReferenceVersionRules.NULL); - break; - } - } + tgt.setValue(ElementDefinition.ReferenceVersionRules.EITHER); + break; + case INDEPENDENT: + tgt.setValue(ElementDefinition.ReferenceVersionRules.INDEPENDENT); + break; + case SPECIFIC: + tgt.setValue(ElementDefinition.ReferenceVersionRules.SPECIFIC); + break; + default: + tgt.setValue(ElementDefinition.ReferenceVersionRules.NULL); + break; + } +} return tgt; } @@ -498,23 +499,23 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ElementDefinition.ReferenceVersionRulesEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.ReferenceVersionRules.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case EITHER: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.ReferenceVersionRules.EITHER); - break; - case INDEPENDENT: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.ReferenceVersionRules.INDEPENDENT); - break; - case SPECIFIC: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.ReferenceVersionRules.SPECIFIC); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.ReferenceVersionRules.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.ReferenceVersionRules.EITHER); + break; + case INDEPENDENT: + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.ReferenceVersionRules.INDEPENDENT); + break; + case SPECIFIC: + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.ReferenceVersionRules.SPECIFIC); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.ReferenceVersionRules.NULL); + break; + } +} return tgt; } @@ -575,20 +576,20 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ElementDefinition.ConstraintSeverityEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ConstraintSeverity.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case ERROR: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ConstraintSeverity.ERROR); - break; - case WARNING: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ConstraintSeverity.WARNING); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ConstraintSeverity.NULL); - break; - } - } + tgt.setValue(ElementDefinition.ConstraintSeverity.ERROR); + break; + case WARNING: + tgt.setValue(ElementDefinition.ConstraintSeverity.WARNING); + break; + default: + tgt.setValue(ElementDefinition.ConstraintSeverity.NULL); + break; + } +} return tgt; } @@ -597,20 +598,20 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ElementDefinition.ConstraintSeverityEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.ConstraintSeverity.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case ERROR: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.ConstraintSeverity.ERROR); - break; - case WARNING: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.ConstraintSeverity.WARNING); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.ConstraintSeverity.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.ConstraintSeverity.ERROR); + break; + case WARNING: + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.ConstraintSeverity.WARNING); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.ElementDefinition.ConstraintSeverity.NULL); + break; + } +} return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/special40_50/Narrative40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/special40_50/Narrative40_50.java index 60dee4749e..65d85e7315 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/special40_50/Narrative40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/special40_50/Narrative40_50.java @@ -2,6 +2,7 @@ import org.hl7.fhir.convertors.context.ConversionContext40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Narrative; public class Narrative40_50 { public static org.hl7.fhir.r5.model.Narrative convertNarrative(org.hl7.fhir.r4.model.Narrative src) throws FHIRException { @@ -27,26 +28,26 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Narrative.NarrativeStatusEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Narrative.NarrativeStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case GENERATED: - tgt.setValue(org.hl7.fhir.r5.model.Narrative.NarrativeStatus.GENERATED); - break; - case EXTENSIONS: - tgt.setValue(org.hl7.fhir.r5.model.Narrative.NarrativeStatus.EXTENSIONS); - break; - case ADDITIONAL: - tgt.setValue(org.hl7.fhir.r5.model.Narrative.NarrativeStatus.ADDITIONAL); - break; - case EMPTY: - tgt.setValue(org.hl7.fhir.r5.model.Narrative.NarrativeStatus.EMPTY); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Narrative.NarrativeStatus.NULL); - break; - } - } + tgt.setValue(Narrative.NarrativeStatus.GENERATED); + break; + case EXTENSIONS: + tgt.setValue(Narrative.NarrativeStatus.EXTENSIONS); + break; + case ADDITIONAL: + tgt.setValue(Narrative.NarrativeStatus.ADDITIONAL); + break; + case EMPTY: + tgt.setValue(Narrative.NarrativeStatus.EMPTY); + break; + default: + tgt.setValue(Narrative.NarrativeStatus.NULL); + break; + } +} return tgt; } @@ -55,26 +56,26 @@ static public org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Narrative.NarrativeStatusEnumFactory()); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4.model.Narrative.NarrativeStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case GENERATED: - tgt.setValue(org.hl7.fhir.r4.model.Narrative.NarrativeStatus.GENERATED); - break; - case EXTENSIONS: - tgt.setValue(org.hl7.fhir.r4.model.Narrative.NarrativeStatus.EXTENSIONS); - break; - case ADDITIONAL: - tgt.setValue(org.hl7.fhir.r4.model.Narrative.NarrativeStatus.ADDITIONAL); - break; - case EMPTY: - tgt.setValue(org.hl7.fhir.r4.model.Narrative.NarrativeStatus.EMPTY); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Narrative.NarrativeStatus.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4.model.Narrative.NarrativeStatus.GENERATED); + break; + case EXTENSIONS: + tgt.setValue(org.hl7.fhir.r4.model.Narrative.NarrativeStatus.EXTENSIONS); + break; + case ADDITIONAL: + tgt.setValue(org.hl7.fhir.r4.model.Narrative.NarrativeStatus.ADDITIONAL); + break; + case EMPTY: + tgt.setValue(org.hl7.fhir.r4.model.Narrative.NarrativeStatus.EMPTY); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Narrative.NarrativeStatus.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Account40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Account40_50.java index 1047efca38..db451dc59b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Account40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Account40_50.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Account; +import org.hl7.fhir.r5.model.Enumeration; /* Copyright (c) 2011+, HL7, Inc. @@ -100,59 +102,67 @@ public static org.hl7.fhir.r4.model.Account convertAccount(org.hl7.fhir.r5.model } static public org.hl7.fhir.r5.model.Enumeration convertAccountStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Account.AccountStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Account.AccountStatus.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Account.AccountStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Account.AccountStatus.ENTEREDINERROR); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r5.model.Account.AccountStatus.ONHOLD); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.Account.AccountStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Account.AccountStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Account.AccountStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Account.AccountStatus.ACTIVE); + break; + case INACTIVE: + tgt.setValue(Account.AccountStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(Account.AccountStatus.ENTEREDINERROR); + break; + case ONHOLD: + tgt.setValue(Account.AccountStatus.ONHOLD); + break; + case UNKNOWN: + tgt.setValue(Account.AccountStatus.UNKNOWN); + break; + default: + tgt.setValue(Account.AccountStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertAccountStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Account.AccountStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Account.AccountStatus.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Account.AccountStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Account.AccountStatus.ENTEREDINERROR); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r4.model.Account.AccountStatus.ONHOLD); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.Account.AccountStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Account.AccountStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Account.AccountStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4.model.Account.AccountStatus.ACTIVE); + break; + case INACTIVE: + tgt.setValue(org.hl7.fhir.r4.model.Account.AccountStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.Account.AccountStatus.ENTEREDINERROR); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.r4.model.Account.AccountStatus.ONHOLD); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4.model.Account.AccountStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Account.AccountStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Account.CoverageComponent convertCoverageComponent(org.hl7.fhir.r4.model.Account.CoverageComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ActivityDefinition40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ActivityDefinition40_50.java index 2c2c128bfd..0adb3231f4 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ActivityDefinition40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ActivityDefinition40_50.java @@ -20,8 +20,7 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Dosage40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.r5.model.CodeType; -import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.*; /* Copyright (c) 2011+, HL7, Inc. @@ -253,59 +252,63 @@ public static org.hl7.fhir.r4.model.ActivityDefinition convertActivityDefinition } static public org.hl7.fhir.r5.model.Enumeration convertActivityDefinitionKind(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypesEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case APPOINTMENT: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.APPOINTMENT); - break; - case APPOINTMENTRESPONSE: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.APPOINTMENTRESPONSE); - break; - case CAREPLAN: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.CAREPLAN); - break; - case CLAIM: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.CLAIM); - break; - case COMMUNICATIONREQUEST: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.COMMUNICATIONREQUEST); - break; - case DEVICEREQUEST: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.DEVICEREQUEST); - break; - case ENROLLMENTREQUEST: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.ENROLLMENTREQUEST); - break; - case IMMUNIZATIONRECOMMENDATION: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.IMMUNIZATIONRECOMMENDATION); - break; - case MEDICATIONREQUEST: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.MEDICATIONREQUEST); - break; - case NUTRITIONORDER: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.NUTRITIONORDER); - break; - case SERVICEREQUEST: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.SERVICEREQUEST); - break; - case SUPPLYREQUEST: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.SUPPLYREQUEST); - break; - case TASK: - tgt.setValue(null); - tgt.addExtension(VersionConvertorConstants.EXT_ACTUAL_RESOURCE_NAME, new CodeType("Task")); - break; - case VISIONPRESCRIPTION: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.VISIONPRESCRIPTION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ActivityDefinition.RequestResourceTypesEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case APPOINTMENT: + tgt.setValue(ActivityDefinition.RequestResourceTypes.APPOINTMENT); + break; + case APPOINTMENTRESPONSE: + tgt.setValue(ActivityDefinition.RequestResourceTypes.APPOINTMENTRESPONSE); + break; + case CAREPLAN: + tgt.setValue(ActivityDefinition.RequestResourceTypes.CAREPLAN); + break; + case CLAIM: + tgt.setValue(ActivityDefinition.RequestResourceTypes.CLAIM); + break; + case COMMUNICATIONREQUEST: + tgt.setValue(ActivityDefinition.RequestResourceTypes.COMMUNICATIONREQUEST); + break; + case DEVICEREQUEST: + tgt.setValue(ActivityDefinition.RequestResourceTypes.DEVICEREQUEST); + break; + case ENROLLMENTREQUEST: + tgt.setValue(ActivityDefinition.RequestResourceTypes.ENROLLMENTREQUEST); + break; + case IMMUNIZATIONRECOMMENDATION: + tgt.setValue(ActivityDefinition.RequestResourceTypes.IMMUNIZATIONRECOMMENDATION); + break; + case MEDICATIONREQUEST: + tgt.setValue(ActivityDefinition.RequestResourceTypes.MEDICATIONREQUEST); + break; + case NUTRITIONORDER: + tgt.setValue(ActivityDefinition.RequestResourceTypes.NUTRITIONORDER); + break; + case SERVICEREQUEST: + tgt.setValue(ActivityDefinition.RequestResourceTypes.SERVICEREQUEST); + break; + case SUPPLYREQUEST: + tgt.setValue(ActivityDefinition.RequestResourceTypes.SUPPLYREQUEST); + break; + case TASK: + tgt.setValue(null); + tgt.addExtension(VersionConvertorConstants.EXT_ACTUAL_RESOURCE_NAME, new CodeType("Task")); + break; + case VISIONPRESCRIPTION: + tgt.setValue(ActivityDefinition.RequestResourceTypes.VISIONPRESCRIPTION); + break; + default: + tgt.setValue(ActivityDefinition.RequestResourceTypes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertActivityDefinitionKind(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { @@ -316,182 +319,202 @@ static public org.hl7.fhir.r4.model.Enumeration convertRequestIntent(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestIntentEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.PROPOSAL); - break; - case PLAN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.PLAN); - break; - case DIRECTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.DIRECTIVE); - break; - case ORDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORDER); - break; - case ORIGINALORDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORIGINALORDER); - break; - case REFLEXORDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.REFLEXORDER); - break; - case FILLERORDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.FILLERORDER); - break; - case INSTANCEORDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.INSTANCEORDER); - break; - case OPTION: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.OPTION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.RequestIntentEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSAL: + tgt.setValue(Enumerations.RequestIntent.PROPOSAL); + break; + case PLAN: + tgt.setValue(Enumerations.RequestIntent.PLAN); + break; + case DIRECTIVE: + tgt.setValue(Enumerations.RequestIntent.DIRECTIVE); + break; + case ORDER: + tgt.setValue(Enumerations.RequestIntent.ORDER); + break; + case ORIGINALORDER: + tgt.setValue(Enumerations.RequestIntent.ORIGINALORDER); + break; + case REFLEXORDER: + tgt.setValue(Enumerations.RequestIntent.REFLEXORDER); + break; + case FILLERORDER: + tgt.setValue(Enumerations.RequestIntent.FILLERORDER); + break; + case INSTANCEORDER: + tgt.setValue(Enumerations.RequestIntent.INSTANCEORDER); + break; + case OPTION: + tgt.setValue(Enumerations.RequestIntent.OPTION); + break; + default: + tgt.setValue(Enumerations.RequestIntent.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertRequestIntent(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ActivityDefinition.RequestIntentEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSAL: - tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.PROPOSAL); - break; - case PLAN: - tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.PLAN); - break; - case DIRECTIVE: - tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.DIRECTIVE); - break; - case ORDER: - tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.ORDER); - break; - case ORIGINALORDER: - tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.ORIGINALORDER); - break; - case REFLEXORDER: - tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.REFLEXORDER); - break; - case FILLERORDER: - tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.FILLERORDER); - break; - case INSTANCEORDER: - tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.INSTANCEORDER); - break; - case OPTION: - tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.OPTION); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ActivityDefinition.RequestIntentEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSAL: + tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.PROPOSAL); + break; + case PLAN: + tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.PLAN); + break; + case DIRECTIVE: + tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.DIRECTIVE); + break; + case ORDER: + tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.ORDER); + break; + case ORIGINALORDER: + tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.ORIGINALORDER); + break; + case REFLEXORDER: + tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.REFLEXORDER); + break; + case FILLERORDER: + tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.FILLERORDER); + break; + case INSTANCEORDER: + tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.INSTANCEORDER); + break; + case OPTION: + tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.OPTION); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertRequestPriority(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestPriorityEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP); - break; - case STAT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.RequestPriorityEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(Enumerations.RequestPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(Enumerations.RequestPriority.URGENT); + break; + case ASAP: + tgt.setValue(Enumerations.RequestPriority.ASAP); + break; + case STAT: + tgt.setValue(Enumerations.RequestPriority.STAT); + break; + default: + tgt.setValue(Enumerations.RequestPriority.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertRequestPriority(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ActivityDefinition.RequestPriorityEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.RequestPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.RequestPriority.URGENT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.RequestPriority.ASAP); - break; - case STAT: - tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.RequestPriority.STAT); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.RequestPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ActivityDefinition.RequestPriorityEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.RequestPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.RequestPriority.URGENT); + break; + case ASAP: + tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.RequestPriority.ASAP); + break; + case STAT: + tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.RequestPriority.STAT); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.RequestPriority.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionParticipantComponent convertActivityDefinitionParticipantComponent(org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionParticipantComponent src) throws FHIRException { @@ -519,53 +542,61 @@ public static org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionPartici } static public org.hl7.fhir.r5.model.Enumeration convertActivityParticipantType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ActionParticipantTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PATIENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.PATIENT); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.PRACTITIONER); - break; - case RELATEDPERSON: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.RELATEDPERSON); - break; - case DEVICE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.DEVICE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ActionParticipantTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PATIENT: + tgt.setValue(Enumerations.ActionParticipantType.PATIENT); + break; + case PRACTITIONER: + tgt.setValue(Enumerations.ActionParticipantType.PRACTITIONER); + break; + case RELATEDPERSON: + tgt.setValue(Enumerations.ActionParticipantType.RELATEDPERSON); + break; + case DEVICE: + tgt.setValue(Enumerations.ActionParticipantType.DEVICE); + break; + default: + tgt.setValue(Enumerations.ActionParticipantType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertActivityParticipantType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ActivityDefinition.ActivityParticipantTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PATIENT: - tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.ActivityParticipantType.PATIENT); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.ActivityParticipantType.PRACTITIONER); - break; - case RELATEDPERSON: - tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.ActivityParticipantType.RELATEDPERSON); - break; - case DEVICE: - tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.ActivityParticipantType.DEVICE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.ActivityParticipantType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ActivityDefinition.ActivityParticipantTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PATIENT: + tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.ActivityParticipantType.PATIENT); + break; + case PRACTITIONER: + tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.ActivityParticipantType.PRACTITIONER); + break; + case RELATEDPERSON: + tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.ActivityParticipantType.RELATEDPERSON); + break; + case DEVICE: + tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.ActivityParticipantType.DEVICE); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.ActivityDefinition.ActivityParticipantType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent convertActivityDefinitionDynamicValueComponent(org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/AllergyIntolerance40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/AllergyIntolerance40_50.java index 9660558399..d6e291840e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/AllergyIntolerance40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/AllergyIntolerance40_50.java @@ -10,10 +10,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.*; import org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceParticipantComponent; -import org.hl7.fhir.r5.model.CodeableConcept; -import org.hl7.fhir.r5.model.CodeableReference; -import org.hl7.fhir.r5.model.Coding; /* Copyright (c) 2011+, HL7, Inc. @@ -133,21 +131,25 @@ public static org.hl7.fhir.r4.model.AllergyIntolerance convertAllergyIntolerance } static public org.hl7.fhir.r5.model.CodeableConcept convertAllergyIntoleranceType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.CodeableConcept tgt = new org.hl7.fhir.r5.model.CodeableConcept(); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ALLERGY: - tgt.addCoding("http://hl7.org/fhir/allergy-intolerance-type", "allergy", "Allergy"); - break; - case INTOLERANCE: - tgt.addCoding("http://hl7.org/fhir/allergy-intolerance-type", "intolerance", "Intolerance"); - break; - default: - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + CodeableConcept tgt = new CodeableConcept(); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + // Add nothing + } else { + switch (src.getValue()) { + case ALLERGY: + tgt.addCoding("http://hl7.org/fhir/allergy-intolerance-type", "allergy", "Allergy"); + break; + case INTOLERANCE: + tgt.addCoding("http://hl7.org/fhir/allergy-intolerance-type", "intolerance", "Intolerance"); + break; + default: + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertAllergyIntoleranceType(org.hl7.fhir.r5.model.CodeableConcept src) throws FHIRException { @@ -164,97 +166,113 @@ static public org.hl7.fhir.r4.model.Enumeration convertAllergyIntoleranceCategory(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategoryEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case FOOD: - tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory.FOOD); - break; - case MEDICATION: - tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory.MEDICATION); - break; - case ENVIRONMENT: - tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory.ENVIRONMENT); - break; - case BIOLOGIC: - tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory.BIOLOGIC); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new AllergyIntolerance.AllergyIntoleranceCategoryEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FOOD: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceCategory.FOOD); + break; + case MEDICATION: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceCategory.MEDICATION); + break; + case ENVIRONMENT: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceCategory.ENVIRONMENT); + break; + case BIOLOGIC: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceCategory.BIOLOGIC); + break; + default: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceCategory.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertAllergyIntoleranceCategory(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategoryEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case FOOD: - tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory.FOOD); - break; - case MEDICATION: - tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory.MEDICATION); - break; - case ENVIRONMENT: - tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory.ENVIRONMENT); - break; - case BIOLOGIC: - tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory.BIOLOGIC); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategoryEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FOOD: + tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory.FOOD); + break; + case MEDICATION: + tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory.MEDICATION); + break; + case ENVIRONMENT: + tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory.ENVIRONMENT); + break; + case BIOLOGIC: + tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory.BIOLOGIC); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertAllergyIntoleranceCriticality(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticalityEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case LOW: - tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality.LOW); - break; - case HIGH: - tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality.HIGH); - break; - case UNABLETOASSESS: - tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality.UNABLETOASSESS); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new AllergyIntolerance.AllergyIntoleranceCriticalityEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case LOW: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceCriticality.LOW); + break; + case HIGH: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceCriticality.HIGH); + break; + case UNABLETOASSESS: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceCriticality.UNABLETOASSESS); + break; + default: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceCriticality.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertAllergyIntoleranceCriticality(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticalityEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case LOW: - tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticality.LOW); - break; - case HIGH: - tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticality.HIGH); - break; - case UNABLETOASSESS: - tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticality.UNABLETOASSESS); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticality.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticalityEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case LOW: + tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticality.LOW); + break; + case HIGH: + tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticality.HIGH); + break; + case UNABLETOASSESS: + tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticality.UNABLETOASSESS); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticality.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceReactionComponent convertAllergyIntoleranceReactionComponent(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceReactionComponent src) throws FHIRException { @@ -300,46 +318,54 @@ public static org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceReactio } static public org.hl7.fhir.r5.model.Enumeration convertAllergyIntoleranceSeverity(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverityEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case MILD: - tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity.MILD); - break; - case MODERATE: - tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity.MODERATE); - break; - case SEVERE: - tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity.SEVERE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new AllergyIntolerance.AllergyIntoleranceSeverityEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MILD: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceSeverity.MILD); + break; + case MODERATE: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceSeverity.MODERATE); + break; + case SEVERE: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceSeverity.SEVERE); + break; + default: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceSeverity.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertAllergyIntoleranceSeverity(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverityEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case MILD: - tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverity.MILD); - break; - case MODERATE: - tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverity.MODERATE); - break; - case SEVERE: - tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverity.SEVERE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverity.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverityEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MILD: + tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverity.MILD); + break; + case MODERATE: + tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverity.MODERATE); + break; + case SEVERE: + tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverity.SEVERE); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverity.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Appointment40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Appointment40_50.java index b30180df3b..bdfa568057 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Appointment40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Appointment40_50.java @@ -12,8 +12,7 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4.model.UnsignedIntType; -import org.hl7.fhir.r5.model.CodeableConcept; -import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.*; /* Copyright (c) 2011+, HL7, Inc. @@ -170,89 +169,97 @@ public static int convertAppointmentPriorityFromR5(org.hl7.fhir.r5.model.Codeabl } static public org.hl7.fhir.r5.model.Enumeration convertAppointmentStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Appointment.AppointmentStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSED: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.PROPOSED); - break; - case PENDING: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.PENDING); - break; - case BOOKED: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.BOOKED); - break; - case ARRIVED: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.ARRIVED); - break; - case FULFILLED: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.FULFILLED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.CANCELLED); - break; - case NOSHOW: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.NOSHOW); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.ENTEREDINERROR); - break; - case CHECKEDIN: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.CHECKEDIN); - break; - case WAITLIST: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.WAITLIST); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Appointment.AppointmentStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSED: + tgt.setValue(Appointment.AppointmentStatus.PROPOSED); + break; + case PENDING: + tgt.setValue(Appointment.AppointmentStatus.PENDING); + break; + case BOOKED: + tgt.setValue(Appointment.AppointmentStatus.BOOKED); + break; + case ARRIVED: + tgt.setValue(Appointment.AppointmentStatus.ARRIVED); + break; + case FULFILLED: + tgt.setValue(Appointment.AppointmentStatus.FULFILLED); + break; + case CANCELLED: + tgt.setValue(Appointment.AppointmentStatus.CANCELLED); + break; + case NOSHOW: + tgt.setValue(Appointment.AppointmentStatus.NOSHOW); + break; + case ENTEREDINERROR: + tgt.setValue(Appointment.AppointmentStatus.ENTEREDINERROR); + break; + case CHECKEDIN: + tgt.setValue(Appointment.AppointmentStatus.CHECKEDIN); + break; + case WAITLIST: + tgt.setValue(Appointment.AppointmentStatus.WAITLIST); + break; + default: + tgt.setValue(Appointment.AppointmentStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertAppointmentStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Appointment.AppointmentStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSED: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.PROPOSED); - break; - case PENDING: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.PENDING); - break; - case BOOKED: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.BOOKED); - break; - case ARRIVED: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.ARRIVED); - break; - case FULFILLED: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.FULFILLED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.CANCELLED); - break; - case NOSHOW: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.NOSHOW); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.ENTEREDINERROR); - break; - case CHECKEDIN: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.CHECKEDIN); - break; - case WAITLIST: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.WAITLIST); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Appointment.AppointmentStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSED: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.PROPOSED); + break; + case PENDING: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.PENDING); + break; + case BOOKED: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.BOOKED); + break; + case ARRIVED: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.ARRIVED); + break; + case FULFILLED: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.FULFILLED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.CANCELLED); + break; + case NOSHOW: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.NOSHOW); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.ENTEREDINERROR); + break; + case CHECKEDIN: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.CHECKEDIN); + break; + case WAITLIST: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.WAITLIST); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.AppointmentStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Appointment.AppointmentParticipantComponent convertAppointmentParticipantComponent(org.hl7.fhir.r4.model.Appointment.AppointmentParticipantComponent src) throws FHIRException { @@ -292,24 +299,28 @@ public static org.hl7.fhir.r4.model.Appointment.AppointmentParticipantComponent } static public org.hl7.fhir.r5.model.BooleanType convertParticipantRequired(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.BooleanType tgt = new org.hl7.fhir.r5.model.BooleanType(); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case REQUIRED: - tgt.setValue(true); - break; - case OPTIONAL: - tgt.setValue(false); - break; - case INFORMATIONONLY: - tgt.setValue(false); - break; - default: - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + BooleanType tgt = new BooleanType(); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REQUIRED: + tgt.setValue(true); + break; + case OPTIONAL: + tgt.setValue(false); + break; + case INFORMATIONONLY: + tgt.setValue(false); + break; + default: + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertParticipantRequired(org.hl7.fhir.r5.model.BooleanType src) throws FHIRException { @@ -326,52 +337,60 @@ static public org.hl7.fhir.r4.model.Enumeration convertParticipationStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Appointment.ParticipationStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACCEPTED: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.ParticipationStatus.ACCEPTED); - break; - case DECLINED: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.ParticipationStatus.DECLINED); - break; - case TENTATIVE: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.ParticipationStatus.TENTATIVE); - break; - case NEEDSACTION: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.ParticipationStatus.NEEDSACTION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.ParticipationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Appointment.ParticipationStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACCEPTED: + tgt.setValue(Appointment.ParticipationStatus.ACCEPTED); + break; + case DECLINED: + tgt.setValue(Appointment.ParticipationStatus.DECLINED); + break; + case TENTATIVE: + tgt.setValue(Appointment.ParticipationStatus.TENTATIVE); + break; + case NEEDSACTION: + tgt.setValue(Appointment.ParticipationStatus.NEEDSACTION); + break; + default: + tgt.setValue(Appointment.ParticipationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertParticipationStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Appointment.ParticipationStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACCEPTED: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipationStatus.ACCEPTED); - break; - case DECLINED: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipationStatus.DECLINED); - break; - case TENTATIVE: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipationStatus.TENTATIVE); - break; - case NEEDSACTION: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipationStatus.NEEDSACTION); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Appointment.ParticipationStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACCEPTED: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipationStatus.ACCEPTED); + break; + case DECLINED: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipationStatus.DECLINED); + break; + case TENTATIVE: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipationStatus.TENTATIVE); + break; + case NEEDSACTION: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipationStatus.NEEDSACTION); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipationStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/AppointmentResponse40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/AppointmentResponse40_50.java index 86501a5cb2..d9d6212256 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/AppointmentResponse40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/AppointmentResponse40_50.java @@ -7,6 +7,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.AppointmentResponse; +import org.hl7.fhir.r5.model.Enumeration; /* Copyright (c) 2011+, HL7, Inc. @@ -88,52 +90,60 @@ public static org.hl7.fhir.r4.model.AppointmentResponse convertAppointmentRespon } static public org.hl7.fhir.r5.model.Enumeration convertParticipantStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.AppointmentResponse.AppointmentResponseStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACCEPTED: - tgt.setValue(org.hl7.fhir.r5.model.AppointmentResponse.AppointmentResponseStatus.ACCEPTED); - break; - case DECLINED: - tgt.setValue(org.hl7.fhir.r5.model.AppointmentResponse.AppointmentResponseStatus.DECLINED); - break; - case TENTATIVE: - tgt.setValue(org.hl7.fhir.r5.model.AppointmentResponse.AppointmentResponseStatus.TENTATIVE); - break; - case NEEDSACTION: - tgt.setValue(org.hl7.fhir.r5.model.AppointmentResponse.AppointmentResponseStatus.NEEDSACTION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.AppointmentResponse.AppointmentResponseStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new AppointmentResponse.AppointmentResponseStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACCEPTED: + tgt.setValue(AppointmentResponse.AppointmentResponseStatus.ACCEPTED); + break; + case DECLINED: + tgt.setValue(AppointmentResponse.AppointmentResponseStatus.DECLINED); + break; + case TENTATIVE: + tgt.setValue(AppointmentResponse.AppointmentResponseStatus.TENTATIVE); + break; + case NEEDSACTION: + tgt.setValue(AppointmentResponse.AppointmentResponseStatus.NEEDSACTION); + break; + default: + tgt.setValue(AppointmentResponse.AppointmentResponseStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertParticipantStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACCEPTED: - tgt.setValue(org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.ACCEPTED); - break; - case DECLINED: - tgt.setValue(org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.DECLINED); - break; - case TENTATIVE: - tgt.setValue(org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.TENTATIVE); - break; - case NEEDSACTION: - tgt.setValue(org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.NEEDSACTION); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACCEPTED: + tgt.setValue(org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.ACCEPTED); + break; + case DECLINED: + tgt.setValue(org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.DECLINED); + break; + case TENTATIVE: + tgt.setValue(org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.TENTATIVE); + break; + case NEEDSACTION: + tgt.setValue(org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.NEEDSACTION); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/AuditEvent40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/AuditEvent40_50.java index f8f6f776c2..718ad966be 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/AuditEvent40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/AuditEvent40_50.java @@ -11,7 +11,9 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Uri40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.AuditEvent; import org.hl7.fhir.r5.model.CodeableConcept; +import org.hl7.fhir.r5.model.Enumeration; /* Copyright (c) 2011+, HL7, Inc. @@ -104,59 +106,67 @@ public static org.hl7.fhir.r4.model.AuditEvent convertAuditEvent(org.hl7.fhir.r5 } static public org.hl7.fhir.r5.model.Enumeration convertAuditEventAction(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.AuditEvent.AuditEventActionEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case C: - tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.C); - break; - case R: - tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.R); - break; - case U: - tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.U); - break; - case D: - tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.D); - break; - case E: - tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.E); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new AuditEvent.AuditEventActionEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case C: + tgt.setValue(AuditEvent.AuditEventAction.C); + break; + case R: + tgt.setValue(AuditEvent.AuditEventAction.R); + break; + case U: + tgt.setValue(AuditEvent.AuditEventAction.U); + break; + case D: + tgt.setValue(AuditEvent.AuditEventAction.D); + break; + case E: + tgt.setValue(AuditEvent.AuditEventAction.E); + break; + default: + tgt.setValue(AuditEvent.AuditEventAction.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertAuditEventAction(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.AuditEvent.AuditEventActionEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case C: - tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.C); - break; - case R: - tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.R); - break; - case U: - tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.U); - break; - case D: - tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.D); - break; - case E: - tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.E); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.AuditEvent.AuditEventActionEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case C: + tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.C); + break; + case R: + tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.R); + break; + case U: + tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.U); + break; + case D: + tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.D); + break; + case E: + tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.E); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.NULL); + break; + } + } + return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Bundle40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Bundle40_50.java index 40c59be660..024021bd5a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Bundle40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Bundle40_50.java @@ -9,7 +9,9 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.UnsignedInt40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Uri40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Bundle; import org.hl7.fhir.r5.model.Bundle.LinkRelationTypes; +import org.hl7.fhir.r5.model.Enumeration; /* Copyright (c) 2011+, HL7, Inc. @@ -85,83 +87,91 @@ public static org.hl7.fhir.r4.model.Bundle convertBundle(org.hl7.fhir.r5.model.B } static public org.hl7.fhir.r5.model.Enumeration convertBundleType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Bundle.BundleTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case DOCUMENT: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.DOCUMENT); - break; - case MESSAGE: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.MESSAGE); - break; - case TRANSACTION: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.TRANSACTION); - break; - case TRANSACTIONRESPONSE: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.TRANSACTIONRESPONSE); - break; - case BATCH: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.BATCH); - break; - case BATCHRESPONSE: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.BATCHRESPONSE); - break; - case HISTORY: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.HISTORY); - break; - case SEARCHSET: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.SEARCHSET); - break; - case COLLECTION: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.COLLECTION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Bundle.BundleTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DOCUMENT: + tgt.setValue(Bundle.BundleType.DOCUMENT); + break; + case MESSAGE: + tgt.setValue(Bundle.BundleType.MESSAGE); + break; + case TRANSACTION: + tgt.setValue(Bundle.BundleType.TRANSACTION); + break; + case TRANSACTIONRESPONSE: + tgt.setValue(Bundle.BundleType.TRANSACTIONRESPONSE); + break; + case BATCH: + tgt.setValue(Bundle.BundleType.BATCH); + break; + case BATCHRESPONSE: + tgt.setValue(Bundle.BundleType.BATCHRESPONSE); + break; + case HISTORY: + tgt.setValue(Bundle.BundleType.HISTORY); + break; + case SEARCHSET: + tgt.setValue(Bundle.BundleType.SEARCHSET); + break; + case COLLECTION: + tgt.setValue(Bundle.BundleType.COLLECTION); + break; + default: + tgt.setValue(Bundle.BundleType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertBundleType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Bundle.BundleTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case DOCUMENT: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.DOCUMENT); - break; - case MESSAGE: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.MESSAGE); - break; - case TRANSACTION: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.TRANSACTION); - break; - case TRANSACTIONRESPONSE: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.TRANSACTIONRESPONSE); - break; - case BATCH: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.BATCH); - break; - case BATCHRESPONSE: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.BATCHRESPONSE); - break; - case HISTORY: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.HISTORY); - break; - case SEARCHSET: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.SEARCHSET); - break; - case COLLECTION: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.COLLECTION); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Bundle.BundleTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DOCUMENT: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.DOCUMENT); + break; + case MESSAGE: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.MESSAGE); + break; + case TRANSACTION: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.TRANSACTION); + break; + case TRANSACTIONRESPONSE: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.TRANSACTIONRESPONSE); + break; + case BATCH: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.BATCH); + break; + case BATCHRESPONSE: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.BATCHRESPONSE); + break; + case HISTORY: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.HISTORY); + break; + case SEARCHSET: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.SEARCHSET); + break; + case COLLECTION: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.COLLECTION); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Bundle.BundleLinkComponent convertBundleLinkComponent(org.hl7.fhir.r4.model.Bundle.BundleLinkComponent src) throws FHIRException { @@ -251,47 +261,55 @@ public static org.hl7.fhir.r4.model.Bundle.BundleEntrySearchComponent convertBun } static public org.hl7.fhir.r5.model.Enumeration convertSearchEntryMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Bundle.SearchEntryModeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case MATCH: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.SearchEntryMode.MATCH); - break; - case INCLUDE: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.SearchEntryMode.INCLUDE); - break; - case OUTCOME: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.SearchEntryMode.OUTCOME); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.SearchEntryMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Bundle.SearchEntryModeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MATCH: + tgt.setValue(Bundle.SearchEntryMode.MATCH); + break; + case INCLUDE: + tgt.setValue(Bundle.SearchEntryMode.INCLUDE); + break; + case OUTCOME: + tgt.setValue(Bundle.SearchEntryMode.OUTCOME); + break; + default: + tgt.setValue(Bundle.SearchEntryMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertSearchEntryMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Bundle.SearchEntryModeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case MATCH: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.SearchEntryMode.MATCH); - break; - case INCLUDE: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.SearchEntryMode.INCLUDE); - break; - case OUTCOME: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.SearchEntryMode.OUTCOME); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.SearchEntryMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Bundle.SearchEntryModeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MATCH: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.SearchEntryMode.MATCH); + break; + case INCLUDE: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.SearchEntryMode.INCLUDE); + break; + case OUTCOME: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.SearchEntryMode.OUTCOME); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.SearchEntryMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Bundle.BundleEntryRequestComponent convertBundleEntryRequestComponent(org.hl7.fhir.r4.model.Bundle.BundleEntryRequestComponent src) throws FHIRException { @@ -335,65 +353,73 @@ public static org.hl7.fhir.r4.model.Bundle.BundleEntryRequestComponent convertBu } static public org.hl7.fhir.r5.model.Enumeration convertHTTPVerb(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Bundle.HTTPVerbEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case GET: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.GET); - break; - case HEAD: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.HEAD); - break; - case POST: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.POST); - break; - case PUT: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.PUT); - break; - case DELETE: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.DELETE); - break; - case PATCH: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.PATCH); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Bundle.HTTPVerbEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case GET: + tgt.setValue(Bundle.HTTPVerb.GET); + break; + case HEAD: + tgt.setValue(Bundle.HTTPVerb.HEAD); + break; + case POST: + tgt.setValue(Bundle.HTTPVerb.POST); + break; + case PUT: + tgt.setValue(Bundle.HTTPVerb.PUT); + break; + case DELETE: + tgt.setValue(Bundle.HTTPVerb.DELETE); + break; + case PATCH: + tgt.setValue(Bundle.HTTPVerb.PATCH); + break; + default: + tgt.setValue(Bundle.HTTPVerb.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertHTTPVerb(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Bundle.HTTPVerbEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case GET: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.GET); - break; - case HEAD: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.HEAD); - break; - case POST: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.POST); - break; - case PUT: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.PUT); - break; - case DELETE: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.DELETE); - break; - case PATCH: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.PATCH); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Bundle.HTTPVerbEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case GET: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.GET); + break; + case HEAD: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.HEAD); + break; + case POST: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.POST); + break; + case PUT: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.PUT); + break; + case DELETE: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.DELETE); + break; + case PATCH: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.PATCH); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Bundle.BundleEntryResponseComponent convertBundleEntryResponseComponent(org.hl7.fhir.r4.model.Bundle.BundleEntryResponseComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/CapabilityStatement40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/CapabilityStatement40_50.java index 3480bfa190..3d5a78a6b3 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/CapabilityStatement40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/CapabilityStatement40_50.java @@ -18,6 +18,9 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Url40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.CapabilityStatement; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -167,47 +170,55 @@ public static org.hl7.fhir.r4.model.CapabilityStatement convertCapabilityStateme } static public org.hl7.fhir.r5.model.Enumeration convertCapabilityStatementKind(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKindEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.INSTANCE); - break; - case CAPABILITY: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.CAPABILITY); - break; - case REQUIREMENTS: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.REQUIREMENTS); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.CapabilityStatementKindEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(Enumerations.CapabilityStatementKind.INSTANCE); + break; + case CAPABILITY: + tgt.setValue(Enumerations.CapabilityStatementKind.CAPABILITY); + break; + case REQUIREMENTS: + tgt.setValue(Enumerations.CapabilityStatementKind.REQUIREMENTS); + break; + default: + tgt.setValue(Enumerations.CapabilityStatementKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertCapabilityStatementKind(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKindEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind.INSTANCE); - break; - case CAPABILITY: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind.CAPABILITY); - break; - case REQUIREMENTS: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind.REQUIREMENTS); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new CapabilityStatement.CapabilityStatementKindEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(CapabilityStatement.CapabilityStatementKind.INSTANCE); + break; + case CAPABILITY: + tgt.setValue(CapabilityStatement.CapabilityStatementKind.CAPABILITY); + break; + case REQUIREMENTS: + tgt.setValue(CapabilityStatement.CapabilityStatementKind.REQUIREMENTS); + break; + default: + tgt.setValue(CapabilityStatement.CapabilityStatementKind.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementSoftwareComponent convertCapabilityStatementSoftwareComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementSoftwareComponent src) throws FHIRException { @@ -315,41 +326,49 @@ public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestC } static public org.hl7.fhir.r5.model.Enumeration convertRestfulCapabilityMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.RestfulCapabilityModeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case CLIENT: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.RestfulCapabilityMode.CLIENT); - break; - case SERVER: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.RestfulCapabilityMode.SERVER); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.RestfulCapabilityMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.RestfulCapabilityModeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CLIENT: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.RestfulCapabilityMode.CLIENT); + break; + case SERVER: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.RestfulCapabilityMode.SERVER); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.RestfulCapabilityMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertRestfulCapabilityMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityModeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case CLIENT: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityMode.CLIENT); - break; - case SERVER: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityMode.SERVER); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new CapabilityStatement.RestfulCapabilityModeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CLIENT: + tgt.setValue(CapabilityStatement.RestfulCapabilityMode.CLIENT); + break; + case SERVER: + tgt.setValue(CapabilityStatement.RestfulCapabilityMode.SERVER); + break; + default: + tgt.setValue(CapabilityStatement.RestfulCapabilityMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestSecurityComponent convertCapabilityStatementRestSecurityComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestSecurityComponent src) throws FHIRException { @@ -467,197 +486,229 @@ public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestR } static public org.hl7.fhir.r5.model.Enumeration convertResourceVersionPolicy(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicyEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case NOVERSION: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy.NOVERSION); - break; - case VERSIONED: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy.VERSIONED); - break; - case VERSIONEDUPDATE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy.VERSIONEDUPDATE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicyEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOVERSION: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy.NOVERSION); + break; + case VERSIONED: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy.VERSIONED); + break; + case VERSIONEDUPDATE: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy.VERSIONEDUPDATE); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertResourceVersionPolicy(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicyEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case NOVERSION: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy.NOVERSION); - break; - case VERSIONED: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy.VERSIONED); - break; - case VERSIONEDUPDATE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy.VERSIONEDUPDATE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new CapabilityStatement.ResourceVersionPolicyEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOVERSION: + tgt.setValue(CapabilityStatement.ResourceVersionPolicy.NOVERSION); + break; + case VERSIONED: + tgt.setValue(CapabilityStatement.ResourceVersionPolicy.VERSIONED); + break; + case VERSIONEDUPDATE: + tgt.setValue(CapabilityStatement.ResourceVersionPolicy.VERSIONEDUPDATE); + break; + default: + tgt.setValue(CapabilityStatement.ResourceVersionPolicy.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertConditionalReadStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus.NOTSUPPORTED); - break; - case MODIFIEDSINCE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus.MODIFIEDSINCE); - break; - case NOTMATCH: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus.NOTMATCH); - break; - case FULLSUPPORT: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus.FULLSUPPORT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTSUPPORTED: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus.NOTSUPPORTED); + break; + case MODIFIEDSINCE: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus.MODIFIEDSINCE); + break; + case NOTMATCH: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus.NOTMATCH); + break; + case FULLSUPPORT: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus.FULLSUPPORT); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertConditionalReadStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus.NOTSUPPORTED); - break; - case MODIFIEDSINCE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus.MODIFIEDSINCE); - break; - case NOTMATCH: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus.NOTMATCH); - break; - case FULLSUPPORT: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus.FULLSUPPORT); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new CapabilityStatement.ConditionalReadStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTSUPPORTED: + tgt.setValue(CapabilityStatement.ConditionalReadStatus.NOTSUPPORTED); + break; + case MODIFIEDSINCE: + tgt.setValue(CapabilityStatement.ConditionalReadStatus.MODIFIEDSINCE); + break; + case NOTMATCH: + tgt.setValue(CapabilityStatement.ConditionalReadStatus.NOTMATCH); + break; + case FULLSUPPORT: + tgt.setValue(CapabilityStatement.ConditionalReadStatus.FULLSUPPORT); + break; + default: + tgt.setValue(CapabilityStatement.ConditionalReadStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertConditionalDeleteStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus.NOTSUPPORTED); - break; - case SINGLE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus.SINGLE); - break; - case MULTIPLE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus.MULTIPLE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTSUPPORTED: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus.NOTSUPPORTED); + break; + case SINGLE: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus.SINGLE); + break; + case MULTIPLE: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus.MULTIPLE); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertConditionalDeleteStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus.NOTSUPPORTED); - break; - case SINGLE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus.SINGLE); - break; - case MULTIPLE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus.MULTIPLE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new CapabilityStatement.ConditionalDeleteStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTSUPPORTED: + tgt.setValue(CapabilityStatement.ConditionalDeleteStatus.NOTSUPPORTED); + break; + case SINGLE: + tgt.setValue(CapabilityStatement.ConditionalDeleteStatus.SINGLE); + break; + case MULTIPLE: + tgt.setValue(CapabilityStatement.ConditionalDeleteStatus.MULTIPLE); + break; + default: + tgt.setValue(CapabilityStatement.ConditionalDeleteStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertReferenceHandlingPolicy(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicyEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case LITERAL: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.LITERAL); - break; - case LOGICAL: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.LOGICAL); - break; - case RESOLVES: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.RESOLVES); - break; - case ENFORCED: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.ENFORCED); - break; - case LOCAL: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.LOCAL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicyEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case LITERAL: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.LITERAL); + break; + case LOGICAL: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.LOGICAL); + break; + case RESOLVES: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.RESOLVES); + break; + case ENFORCED: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.ENFORCED); + break; + case LOCAL: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.LOCAL); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertReferenceHandlingPolicy(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicyEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case LITERAL: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.LITERAL); - break; - case LOGICAL: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.LOGICAL); - break; - case RESOLVES: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.RESOLVES); - break; - case ENFORCED: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.ENFORCED); - break; - case LOCAL: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.LOCAL); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new CapabilityStatement.ReferenceHandlingPolicyEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case LITERAL: + tgt.setValue(CapabilityStatement.ReferenceHandlingPolicy.LITERAL); + break; + case LOGICAL: + tgt.setValue(CapabilityStatement.ReferenceHandlingPolicy.LOGICAL); + break; + case RESOLVES: + tgt.setValue(CapabilityStatement.ReferenceHandlingPolicy.RESOLVES); + break; + case ENFORCED: + tgt.setValue(CapabilityStatement.ReferenceHandlingPolicy.ENFORCED); + break; + case LOCAL: + tgt.setValue(CapabilityStatement.ReferenceHandlingPolicy.LOCAL); + break; + default: + tgt.setValue(CapabilityStatement.ReferenceHandlingPolicy.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.CapabilityStatement.ResourceInteractionComponent convertResourceInteractionComponent(org.hl7.fhir.r4.model.CapabilityStatement.ResourceInteractionComponent src) throws FHIRException { @@ -685,83 +736,91 @@ public static org.hl7.fhir.r4.model.CapabilityStatement.ResourceInteractionCompo } static public org.hl7.fhir.r5.model.Enumeration convertTypeRestfulInteraction(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteractionEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case READ: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.READ); - break; - case VREAD: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.VREAD); - break; - case UPDATE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.UPDATE); - break; - case PATCH: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.PATCH); - break; - case DELETE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.DELETE); - break; - case HISTORYINSTANCE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.HISTORYINSTANCE); - break; - case HISTORYTYPE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.HISTORYTYPE); - break; - case CREATE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.CREATE); - break; - case SEARCHTYPE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.SEARCHTYPE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteractionEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case READ: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.READ); + break; + case VREAD: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.VREAD); + break; + case UPDATE: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.UPDATE); + break; + case PATCH: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.PATCH); + break; + case DELETE: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.DELETE); + break; + case HISTORYINSTANCE: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.HISTORYINSTANCE); + break; + case HISTORYTYPE: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.HISTORYTYPE); + break; + case CREATE: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.CREATE); + break; + case SEARCHTYPE: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.SEARCHTYPE); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertTypeRestfulInteraction(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteractionEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case READ: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.READ); - break; - case VREAD: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.VREAD); - break; - case UPDATE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.UPDATE); - break; - case PATCH: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.PATCH); - break; - case DELETE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.DELETE); - break; - case HISTORYINSTANCE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.HISTORYINSTANCE); - break; - case HISTORYTYPE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.HISTORYTYPE); - break; - case CREATE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.CREATE); - break; - case SEARCHTYPE: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.SEARCHTYPE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new CapabilityStatement.TypeRestfulInteractionEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case READ: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.READ); + break; + case VREAD: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.VREAD); + break; + case UPDATE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.UPDATE); + break; + case PATCH: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.PATCH); + break; + case DELETE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.DELETE); + break; + case HISTORYINSTANCE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.HISTORYINSTANCE); + break; + case HISTORYTYPE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.HISTORYTYPE); + break; + case CREATE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.CREATE); + break; + case SEARCHTYPE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.SEARCHTYPE); + break; + default: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent convertCapabilityStatementRestResourceSearchParamComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent src) throws FHIRException { @@ -849,53 +908,61 @@ public static org.hl7.fhir.r4.model.CapabilityStatement.SystemInteractionCompone } static public org.hl7.fhir.r5.model.Enumeration convertSystemRestfulInteraction(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteractionEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case TRANSACTION: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.TRANSACTION); - break; - case BATCH: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.BATCH); - break; - case SEARCHSYSTEM: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.SEARCHSYSTEM); - break; - case HISTORYSYSTEM: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.HISTORYSYSTEM); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteractionEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case TRANSACTION: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.TRANSACTION); + break; + case BATCH: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.BATCH); + break; + case SEARCHSYSTEM: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.SEARCHSYSTEM); + break; + case HISTORYSYSTEM: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.HISTORYSYSTEM); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertSystemRestfulInteraction(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteractionEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case TRANSACTION: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.TRANSACTION); - break; - case BATCH: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.BATCH); - break; - case SEARCHSYSTEM: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.SEARCHSYSTEM); - break; - case HISTORYSYSTEM: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.HISTORYSYSTEM); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new CapabilityStatement.SystemRestfulInteractionEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case TRANSACTION: + tgt.setValue(CapabilityStatement.SystemRestfulInteraction.TRANSACTION); + break; + case BATCH: + tgt.setValue(CapabilityStatement.SystemRestfulInteraction.BATCH); + break; + case SEARCHSYSTEM: + tgt.setValue(CapabilityStatement.SystemRestfulInteraction.SEARCHSYSTEM); + break; + case HISTORYSYSTEM: + tgt.setValue(CapabilityStatement.SystemRestfulInteraction.HISTORYSYSTEM); + break; + default: + tgt.setValue(CapabilityStatement.SystemRestfulInteraction.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingComponent convertCapabilityStatementMessagingComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingComponent src) throws FHIRException { @@ -979,41 +1046,49 @@ public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessa } static public org.hl7.fhir.r5.model.Enumeration convertEventCapabilityMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityModeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case SENDER: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityMode.SENDER); - break; - case RECEIVER: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityMode.RECEIVER); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityModeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SENDER: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityMode.SENDER); + break; + case RECEIVER: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityMode.RECEIVER); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertEventCapabilityMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityModeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case SENDER: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityMode.SENDER); - break; - case RECEIVER: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityMode.RECEIVER); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new CapabilityStatement.EventCapabilityModeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SENDER: + tgt.setValue(CapabilityStatement.EventCapabilityMode.SENDER); + break; + case RECEIVER: + tgt.setValue(CapabilityStatement.EventCapabilityMode.RECEIVER); + break; + default: + tgt.setValue(CapabilityStatement.EventCapabilityMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementDocumentComponent convertCapabilityStatementDocumentComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementDocumentComponent src) throws FHIRException { @@ -1045,40 +1120,48 @@ public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementDocum } static public org.hl7.fhir.r5.model.Enumeration convertDocumentMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.DocumentModeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PRODUCER: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.DocumentMode.PRODUCER); - break; - case CONSUMER: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.DocumentMode.CONSUMER); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.DocumentMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.DocumentModeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRODUCER: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.DocumentMode.PRODUCER); + break; + case CONSUMER: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.DocumentMode.CONSUMER); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.DocumentMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertDocumentMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.DocumentModeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PRODUCER: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.DocumentMode.PRODUCER); - break; - case CONSUMER: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.DocumentMode.CONSUMER); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.DocumentMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new CapabilityStatement.DocumentModeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRODUCER: + tgt.setValue(CapabilityStatement.DocumentMode.PRODUCER); + break; + case CONSUMER: + tgt.setValue(CapabilityStatement.DocumentMode.CONSUMER); + break; + default: + tgt.setValue(CapabilityStatement.DocumentMode.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/CarePlan40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/CarePlan40_50.java index b088c57c8b..cdd160a296 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/CarePlan40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/CarePlan40_50.java @@ -11,7 +11,10 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Uri40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.CarePlan; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -142,121 +145,137 @@ public static org.hl7.fhir.r4.model.CarePlan convertCarePlan(org.hl7.fhir.r5.mod } static public org.hl7.fhir.r5.model.Enumeration convertCarePlanStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ONHOLD); - break; - case REVOKED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.REVOKED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.RequestStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(Enumerations.RequestStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(Enumerations.RequestStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(Enumerations.RequestStatus.ONHOLD); + break; + case REVOKED: + tgt.setValue(Enumerations.RequestStatus.REVOKED); + break; + case COMPLETED: + tgt.setValue(Enumerations.RequestStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.RequestStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Enumerations.RequestStatus.UNKNOWN); + break; + default: + tgt.setValue(Enumerations.RequestStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertCarePlanStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CarePlan.CarePlanStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.ONHOLD); - break; - case REVOKED: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.REVOKED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new CarePlan.CarePlanStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(CarePlan.CarePlanStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(CarePlan.CarePlanStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(CarePlan.CarePlanStatus.ONHOLD); + break; + case REVOKED: + tgt.setValue(CarePlan.CarePlanStatus.REVOKED); + break; + case COMPLETED: + tgt.setValue(CarePlan.CarePlanStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(CarePlan.CarePlanStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(CarePlan.CarePlanStatus.UNKNOWN); + break; + default: + tgt.setValue(CarePlan.CarePlanStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertCarePlanIntent(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CarePlan.CarePlanIntentEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSAL: - tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.PROPOSAL); - break; - case PLAN: - tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.PLAN); - break; - case ORDER: - tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.ORDER); - break; - case OPTION: - tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.OPTION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new org.hl7.fhir.r5.model.CarePlan.CarePlanIntentEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSAL: + tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.PROPOSAL); + break; + case PLAN: + tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.PLAN); + break; + case ORDER: + tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.ORDER); + break; + case OPTION: + tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.OPTION); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertCarePlanIntent(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CarePlan.CarePlanIntentEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSAL: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanIntent.PROPOSAL); - break; - case PLAN: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanIntent.PLAN); - break; - case ORDER: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanIntent.ORDER); - break; - case OPTION: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanIntent.OPTION); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CarePlan.CarePlanIntent.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new CarePlan.CarePlanIntentEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSAL: + tgt.setValue(CarePlan.CarePlanIntent.PROPOSAL); + break; + case PLAN: + tgt.setValue(CarePlan.CarePlanIntent.PLAN); + break; + case ORDER: + tgt.setValue(CarePlan.CarePlanIntent.ORDER); + break; + case OPTION: + tgt.setValue(CarePlan.CarePlanIntent.OPTION); + break; + default: + tgt.setValue(CarePlan.CarePlanIntent.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.CarePlan.CarePlanActivityComponent convertCarePlanActivityComponent(org.hl7.fhir.r4.model.CarePlan.CarePlanActivityComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/CareTeam40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/CareTeam40_50.java index aa1f84bd48..d263474699 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/CareTeam40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/CareTeam40_50.java @@ -9,7 +9,9 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.CareTeam; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; /* Copyright (c) 2011+, HL7, Inc. @@ -107,59 +109,67 @@ public static org.hl7.fhir.r4.model.CareTeam convertCareTeam(org.hl7.fhir.r5.mod } static public org.hl7.fhir.r5.model.Enumeration convertCareTeamStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CareTeam.CareTeamStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSED: - tgt.setValue(org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.PROPOSED); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.ACTIVE); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.SUSPENDED); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CareTeam.CareTeamStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSED: + tgt.setValue(CareTeam.CareTeamStatus.PROPOSED); + break; + case ACTIVE: + tgt.setValue(CareTeam.CareTeamStatus.ACTIVE); + break; + case SUSPENDED: + tgt.setValue(CareTeam.CareTeamStatus.SUSPENDED); + break; + case INACTIVE: + tgt.setValue(CareTeam.CareTeamStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(CareTeam.CareTeamStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(CareTeam.CareTeamStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertCareTeamStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CareTeam.CareTeamStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSED: - tgt.setValue(org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.PROPOSED); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.ACTIVE); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.SUSPENDED); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CareTeam.CareTeamStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSED: + tgt.setValue(org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.PROPOSED); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.ACTIVE); + break; + case SUSPENDED: + tgt.setValue(org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.SUSPENDED); + break; + case INACTIVE: + tgt.setValue(org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.CareTeam.CareTeamParticipantComponent convertCareTeamParticipantComponent(org.hl7.fhir.r4.model.CareTeam.CareTeamParticipantComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ChargeItem40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ChargeItem40_50.java index adc424be40..6ccf851098 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ChargeItem40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ChargeItem40_50.java @@ -11,7 +11,9 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Uri40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.ChargeItem; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; /* Copyright (c) 2011+, HL7, Inc. @@ -159,71 +161,79 @@ public static org.hl7.fhir.r4.model.ChargeItem convertChargeItem(org.hl7.fhir.r5 } static public org.hl7.fhir.r5.model.Enumeration convertChargeItemStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.PLANNED); - break; - case BILLABLE: - tgt.setValue(org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.BILLABLE); - break; - case NOTBILLABLE: - tgt.setValue(org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.NOTBILLABLE); - break; - case ABORTED: - tgt.setValue(org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.ABORTED); - break; - case BILLED: - tgt.setValue(org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.BILLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ChargeItem.ChargeItemStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(ChargeItem.ChargeItemStatus.PLANNED); + break; + case BILLABLE: + tgt.setValue(ChargeItem.ChargeItemStatus.BILLABLE); + break; + case NOTBILLABLE: + tgt.setValue(ChargeItem.ChargeItemStatus.NOTBILLABLE); + break; + case ABORTED: + tgt.setValue(ChargeItem.ChargeItemStatus.ABORTED); + break; + case BILLED: + tgt.setValue(ChargeItem.ChargeItemStatus.BILLED); + break; + case ENTEREDINERROR: + tgt.setValue(ChargeItem.ChargeItemStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(ChargeItem.ChargeItemStatus.UNKNOWN); + break; + default: + tgt.setValue(ChargeItem.ChargeItemStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertChargeItemStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus.PLANNED); - break; - case BILLABLE: - tgt.setValue(org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus.BILLABLE); - break; - case NOTBILLABLE: - tgt.setValue(org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus.NOTBILLABLE); - break; - case ABORTED: - tgt.setValue(org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus.ABORTED); - break; - case BILLED: - tgt.setValue(org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus.BILLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus.PLANNED); + break; + case BILLABLE: + tgt.setValue(org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus.BILLABLE); + break; + case NOTBILLABLE: + tgt.setValue(org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus.NOTBILLABLE); + break; + case ABORTED: + tgt.setValue(org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus.ABORTED); + break; + case BILLED: + tgt.setValue(org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus.BILLED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.ChargeItem.ChargeItemPerformerComponent convertChargeItemPerformerComponent(org.hl7.fhir.r4.model.ChargeItem.ChargeItemPerformerComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ChargeItemDefinition40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ChargeItemDefinition40_50.java index b83ab24935..19b65dae43 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ChargeItemDefinition40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ChargeItemDefinition40_50.java @@ -17,6 +17,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Uri40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.ChargeItemDefinition; +import org.hl7.fhir.r5.model.Enumeration; import org.hl7.fhir.r5.model.MonetaryComponent; /* @@ -239,64 +241,72 @@ public static org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPro } static public org.hl7.fhir.r5.model.Enumeration convertChargeItemDefinitionPriceComponentType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.MonetaryComponent.PriceComponentTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case BASE: - tgt.setValue(org.hl7.fhir.r5.model.MonetaryComponent.PriceComponentType.BASE); - break; - case SURCHARGE: - tgt.setValue(org.hl7.fhir.r5.model.MonetaryComponent.PriceComponentType.SURCHARGE); - break; - case DEDUCTION: - tgt.setValue(org.hl7.fhir.r5.model.MonetaryComponent.PriceComponentType.DEDUCTION); - break; - case DISCOUNT: - tgt.setValue(org.hl7.fhir.r5.model.MonetaryComponent.PriceComponentType.DISCOUNT); - break; - case TAX: - tgt.setValue(org.hl7.fhir.r5.model.MonetaryComponent.PriceComponentType.TAX); - break; - case INFORMATIONAL: - tgt.setValue(org.hl7.fhir.r5.model.MonetaryComponent.PriceComponentType.INFORMATIONAL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.MonetaryComponent.PriceComponentType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new MonetaryComponent.PriceComponentTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case BASE: + tgt.setValue(MonetaryComponent.PriceComponentType.BASE); + break; + case SURCHARGE: + tgt.setValue(MonetaryComponent.PriceComponentType.SURCHARGE); + break; + case DEDUCTION: + tgt.setValue(MonetaryComponent.PriceComponentType.DEDUCTION); + break; + case DISCOUNT: + tgt.setValue(MonetaryComponent.PriceComponentType.DISCOUNT); + break; + case TAX: + tgt.setValue(MonetaryComponent.PriceComponentType.TAX); + break; + case INFORMATIONAL: + tgt.setValue(MonetaryComponent.PriceComponentType.INFORMATIONAL); + break; + default: + tgt.setValue(MonetaryComponent.PriceComponentType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertChargeItemDefinitionPriceComponentType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case BASE: - tgt.setValue(org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.BASE); - break; - case SURCHARGE: - tgt.setValue(org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.SURCHARGE); - break; - case DEDUCTION: - tgt.setValue(org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.DEDUCTION); - break; - case DISCOUNT: - tgt.setValue(org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.DISCOUNT); - break; - case TAX: - tgt.setValue(org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.TAX); - break; - case INFORMATIONAL: - tgt.setValue(org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.INFORMATIONAL); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new ChargeItemDefinition.ChargeItemDefinitionPriceComponentTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case BASE: + tgt.setValue(ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.BASE); + break; + case SURCHARGE: + tgt.setValue(ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.SURCHARGE); + break; + case DEDUCTION: + tgt.setValue(ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.DEDUCTION); + break; + case DISCOUNT: + tgt.setValue(ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.DISCOUNT); + break; + case TAX: + tgt.setValue(ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.TAX); + break; + case INFORMATIONAL: + tgt.setValue(ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.INFORMATIONAL); + break; + default: + tgt.setValue(ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Claim40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Claim40_50.java index 9c53800599..d4abb50d2e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Claim40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Claim40_50.java @@ -14,6 +14,9 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Claim; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -169,97 +172,113 @@ public static org.hl7.fhir.r4.model.Claim convertClaim(org.hl7.fhir.r5.model.Cla } static public org.hl7.fhir.r5.model.Enumeration convertClaimStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodesEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.CANCELLED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.FinancialResourceStatusCodesEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.ACTIVE); + break; + case CANCELLED: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.CANCELLED); + break; + case DRAFT: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); + break; + default: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertClaimStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Claim.ClaimStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Claim.ClaimStatus.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.Claim.ClaimStatus.CANCELLED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r4.model.Claim.ClaimStatus.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Claim.ClaimStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Claim.ClaimStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new Claim.ClaimStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Claim.ClaimStatus.ACTIVE); + break; + case CANCELLED: + tgt.setValue(Claim.ClaimStatus.CANCELLED); + break; + case DRAFT: + tgt.setValue(Claim.ClaimStatus.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(Claim.ClaimStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Claim.ClaimStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertUse(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.UseEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case CLAIM: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.Use.CLAIM); - break; - case PREAUTHORIZATION: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.Use.PREAUTHORIZATION); - break; - case PREDETERMINATION: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.Use.PREDETERMINATION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.Use.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.UseEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CLAIM: + tgt.setValue(Enumerations.Use.CLAIM); + break; + case PREAUTHORIZATION: + tgt.setValue(Enumerations.Use.PREAUTHORIZATION); + break; + case PREDETERMINATION: + tgt.setValue(Enumerations.Use.PREDETERMINATION); + break; + default: + tgt.setValue(Enumerations.Use.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertUse(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Claim.UseEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case CLAIM: - tgt.setValue(org.hl7.fhir.r4.model.Claim.Use.CLAIM); - break; - case PREAUTHORIZATION: - tgt.setValue(org.hl7.fhir.r4.model.Claim.Use.PREAUTHORIZATION); - break; - case PREDETERMINATION: - tgt.setValue(org.hl7.fhir.r4.model.Claim.Use.PREDETERMINATION); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Claim.Use.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new Claim.UseEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CLAIM: + tgt.setValue(Claim.Use.CLAIM); + break; + case PREAUTHORIZATION: + tgt.setValue(Claim.Use.PREAUTHORIZATION); + break; + case PREDETERMINATION: + tgt.setValue(Claim.Use.PREDETERMINATION); + break; + default: + tgt.setValue(Claim.Use.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Claim.RelatedClaimComponent convertRelatedClaimComponent(org.hl7.fhir.r4.model.Claim.RelatedClaimComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ClaimResponse40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ClaimResponse40_50.java index 66e1f1af18..62ae6dd01e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ClaimResponse40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ClaimResponse40_50.java @@ -15,6 +15,9 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.ClaimResponse; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -166,147 +169,171 @@ public static org.hl7.fhir.r4.model.ClaimResponse convertClaimResponse(org.hl7.f } static public org.hl7.fhir.r5.model.Enumeration convertClaimResponseStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodesEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.CANCELLED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.FinancialResourceStatusCodesEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.ACTIVE); + break; + case CANCELLED: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.CANCELLED); + break; + case DRAFT: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); + break; + default: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertClaimResponseStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ClaimResponse.ClaimResponseStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.ClaimResponse.ClaimResponseStatus.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.ClaimResponse.ClaimResponseStatus.CANCELLED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r4.model.ClaimResponse.ClaimResponseStatus.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.ClaimResponse.ClaimResponseStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ClaimResponse.ClaimResponseStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new ClaimResponse.ClaimResponseStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(ClaimResponse.ClaimResponseStatus.ACTIVE); + break; + case CANCELLED: + tgt.setValue(ClaimResponse.ClaimResponseStatus.CANCELLED); + break; + case DRAFT: + tgt.setValue(ClaimResponse.ClaimResponseStatus.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(ClaimResponse.ClaimResponseStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(ClaimResponse.ClaimResponseStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertUse(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.UseEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case CLAIM: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.Use.CLAIM); - break; - case PREAUTHORIZATION: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.Use.PREAUTHORIZATION); - break; - case PREDETERMINATION: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.Use.PREDETERMINATION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.Use.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.UseEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CLAIM: + tgt.setValue(Enumerations.Use.CLAIM); + break; + case PREAUTHORIZATION: + tgt.setValue(Enumerations.Use.PREAUTHORIZATION); + break; + case PREDETERMINATION: + tgt.setValue(Enumerations.Use.PREDETERMINATION); + break; + default: + tgt.setValue(Enumerations.Use.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertUse(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ClaimResponse.UseEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case CLAIM: - tgt.setValue(org.hl7.fhir.r4.model.ClaimResponse.Use.CLAIM); - break; - case PREAUTHORIZATION: - tgt.setValue(org.hl7.fhir.r4.model.ClaimResponse.Use.PREAUTHORIZATION); - break; - case PREDETERMINATION: - tgt.setValue(org.hl7.fhir.r4.model.ClaimResponse.Use.PREDETERMINATION); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ClaimResponse.Use.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new ClaimResponse.UseEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CLAIM: + tgt.setValue(ClaimResponse.Use.CLAIM); + break; + case PREAUTHORIZATION: + tgt.setValue(ClaimResponse.Use.PREAUTHORIZATION); + break; + case PREDETERMINATION: + tgt.setValue(ClaimResponse.Use.PREDETERMINATION); + break; + default: + tgt.setValue(ClaimResponse.Use.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertRemittanceOutcome(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodesEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case QUEUED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.QUEUED); - break; - case COMPLETE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.COMPLETE); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.ERROR); - break; - case PARTIAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.PARTIAL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ClaimProcessingCodesEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case QUEUED: + tgt.setValue(Enumerations.ClaimProcessingCodes.QUEUED); + break; + case COMPLETE: + tgt.setValue(Enumerations.ClaimProcessingCodes.COMPLETE); + break; + case ERROR: + tgt.setValue(Enumerations.ClaimProcessingCodes.ERROR); + break; + case PARTIAL: + tgt.setValue(Enumerations.ClaimProcessingCodes.PARTIAL); + break; + default: + tgt.setValue(Enumerations.ClaimProcessingCodes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertRemittanceOutcome(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ClaimResponse.RemittanceOutcomeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case QUEUED: - tgt.setValue(org.hl7.fhir.r4.model.ClaimResponse.RemittanceOutcome.QUEUED); - break; - case COMPLETE: - tgt.setValue(org.hl7.fhir.r4.model.ClaimResponse.RemittanceOutcome.COMPLETE); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.r4.model.ClaimResponse.RemittanceOutcome.ERROR); - break; - case PARTIAL: - tgt.setValue(org.hl7.fhir.r4.model.ClaimResponse.RemittanceOutcome.PARTIAL); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ClaimResponse.RemittanceOutcome.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new ClaimResponse.RemittanceOutcomeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case QUEUED: + tgt.setValue(ClaimResponse.RemittanceOutcome.QUEUED); + break; + case COMPLETE: + tgt.setValue(ClaimResponse.RemittanceOutcome.COMPLETE); + break; + case ERROR: + tgt.setValue(ClaimResponse.RemittanceOutcome.ERROR); + break; + case PARTIAL: + tgt.setValue(ClaimResponse.RemittanceOutcome.PARTIAL); + break; + default: + tgt.setValue(ClaimResponse.RemittanceOutcome.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.ClaimResponse.ItemComponent convertItemComponent(org.hl7.fhir.r4.model.ClaimResponse.ItemComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ClinicalImpression40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ClinicalImpression40_50.java index 9a048eba0f..878c3409cf 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ClinicalImpression40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ClinicalImpression40_50.java @@ -9,6 +9,9 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Uri40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.ClinicalImpression; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -128,47 +131,55 @@ public static org.hl7.fhir.r4.model.ClinicalImpression convertClinicalImpression } static public org.hl7.fhir.r5.model.Enumeration convertClinicalImpressionStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.EventStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.EventStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(Enumerations.EventStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(Enumerations.EventStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.EventStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Enumerations.EventStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertClinicalImpressionStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new ClinicalImpression.ClinicalImpressionStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(ClinicalImpression.ClinicalImpressionStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(ClinicalImpression.ClinicalImpressionStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(ClinicalImpression.ClinicalImpressionStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(ClinicalImpression.ClinicalImpressionStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.ClinicalImpression.ClinicalImpressionFindingComponent convertClinicalImpressionFindingComponent(org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionFindingComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/CodeSystem40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/CodeSystem40_50.java index 9347784ab9..88e203d91c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/CodeSystem40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/CodeSystem40_50.java @@ -17,6 +17,9 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.UnsignedInt40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Uri40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.CodeSystem; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -170,109 +173,125 @@ public static org.hl7.fhir.r4.model.CodeSystem convertCodeSystem(org.hl7.fhir.r5 } static public org.hl7.fhir.r5.model.Enumeration convertCodeSystemHierarchyMeaning(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaningEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case GROUPEDBY: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.GROUPEDBY); - break; - case ISA: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.ISA); - break; - case PARTOF: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.PARTOF); - break; - case CLASSIFIEDWITH: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.CLASSIFIEDWITH); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CodeSystem.CodeSystemHierarchyMeaningEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case GROUPEDBY: + tgt.setValue(CodeSystem.CodeSystemHierarchyMeaning.GROUPEDBY); + break; + case ISA: + tgt.setValue(CodeSystem.CodeSystemHierarchyMeaning.ISA); + break; + case PARTOF: + tgt.setValue(CodeSystem.CodeSystemHierarchyMeaning.PARTOF); + break; + case CLASSIFIEDWITH: + tgt.setValue(CodeSystem.CodeSystemHierarchyMeaning.CLASSIFIEDWITH); + break; + default: + tgt.setValue(CodeSystem.CodeSystemHierarchyMeaning.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertCodeSystemHierarchyMeaning(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaningEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case GROUPEDBY: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.GROUPEDBY); - break; - case ISA: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.ISA); - break; - case PARTOF: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.PARTOF); - break; - case CLASSIFIEDWITH: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.CLASSIFIEDWITH); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaningEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case GROUPEDBY: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.GROUPEDBY); + break; + case ISA: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.ISA); + break; + case PARTOF: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.PARTOF); + break; + case CLASSIFIEDWITH: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.CLASSIFIEDWITH); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertCodeSystemContentMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.CodeSystemContentModeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case NOTPRESENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CodeSystemContentMode.NOTPRESENT); - break; - case EXAMPLE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CodeSystemContentMode.EXAMPLE); - break; - case FRAGMENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CodeSystemContentMode.FRAGMENT); - break; - case COMPLETE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CodeSystemContentMode.COMPLETE); - break; - case SUPPLEMENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CodeSystemContentMode.SUPPLEMENT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CodeSystemContentMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.CodeSystemContentModeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTPRESENT: + tgt.setValue(Enumerations.CodeSystemContentMode.NOTPRESENT); + break; + case EXAMPLE: + tgt.setValue(Enumerations.CodeSystemContentMode.EXAMPLE); + break; + case FRAGMENT: + tgt.setValue(Enumerations.CodeSystemContentMode.FRAGMENT); + break; + case COMPLETE: + tgt.setValue(Enumerations.CodeSystemContentMode.COMPLETE); + break; + case SUPPLEMENT: + tgt.setValue(Enumerations.CodeSystemContentMode.SUPPLEMENT); + break; + default: + tgt.setValue(Enumerations.CodeSystemContentMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertCodeSystemContentMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentModeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case NOTPRESENT: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.NOTPRESENT); - break; - case EXAMPLE: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.EXAMPLE); - break; - case FRAGMENT: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.FRAGMENT); - break; - case COMPLETE: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.COMPLETE); - break; - case SUPPLEMENT: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.SUPPLEMENT); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentModeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTPRESENT: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.NOTPRESENT); + break; + case EXAMPLE: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.EXAMPLE); + break; + case FRAGMENT: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.FRAGMENT); + break; + case COMPLETE: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.COMPLETE); + break; + case SUPPLEMENT: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.SUPPLEMENT); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent convertCodeSystemFilterComponent(org.hl7.fhir.r4.model.CodeSystem.CodeSystemFilterComponent src) throws FHIRException { @@ -310,83 +329,91 @@ public static org.hl7.fhir.r4.model.CodeSystem.CodeSystemFilterComponent convert } static public org.hl7.fhir.r5.model.Enumeration convertFilterOperator(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.FilterOperatorEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case EQUAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.EQUAL); - break; - case ISA: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.ISA); - break; - case DESCENDENTOF: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.DESCENDENTOF); - break; - case ISNOTA: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.ISNOTA); - break; - case REGEX: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.REGEX); - break; - case IN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.NOTIN); - break; - case GENERALIZES: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.GENERALIZES); - break; - case EXISTS: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.EXISTS); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.FilterOperatorEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUAL: + tgt.setValue(Enumerations.FilterOperator.EQUAL); + break; + case ISA: + tgt.setValue(Enumerations.FilterOperator.ISA); + break; + case DESCENDENTOF: + tgt.setValue(Enumerations.FilterOperator.DESCENDENTOF); + break; + case ISNOTA: + tgt.setValue(Enumerations.FilterOperator.ISNOTA); + break; + case REGEX: + tgt.setValue(Enumerations.FilterOperator.REGEX); + break; + case IN: + tgt.setValue(Enumerations.FilterOperator.IN); + break; + case NOTIN: + tgt.setValue(Enumerations.FilterOperator.NOTIN); + break; + case GENERALIZES: + tgt.setValue(Enumerations.FilterOperator.GENERALIZES); + break; + case EXISTS: + tgt.setValue(Enumerations.FilterOperator.EXISTS); + break; + default: + tgt.setValue(Enumerations.FilterOperator.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertFilterOperator(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CodeSystem.FilterOperatorEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case EQUAL: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.EQUAL); - break; - case ISA: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.ISA); - break; - case DESCENDENTOF: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.DESCENDENTOF); - break; - case ISNOTA: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.ISNOTA); - break; - case REGEX: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.REGEX); - break; - case IN: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.NOTIN); - break; - case GENERALIZES: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.GENERALIZES); - break; - case EXISTS: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.EXISTS); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CodeSystem.FilterOperatorEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUAL: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.EQUAL); + break; + case ISA: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.ISA); + break; + case DESCENDENTOF: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.DESCENDENTOF); + break; + case ISNOTA: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.ISNOTA); + break; + case REGEX: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.REGEX); + break; + case IN: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.IN); + break; + case NOTIN: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.NOTIN); + break; + case GENERALIZES: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.GENERALIZES); + break; + case EXISTS: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.EXISTS); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.CodeSystem.PropertyComponent convertPropertyComponent(org.hl7.fhir.r4.model.CodeSystem.PropertyComponent src) throws FHIRException { @@ -422,71 +449,79 @@ public static org.hl7.fhir.r4.model.CodeSystem.PropertyComponent convertProperty } static public org.hl7.fhir.r5.model.Enumeration convertPropertyType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CodeSystem.PropertyTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case CODE: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.CODE); - break; - case CODING: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.CODING); - break; - case STRING: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.STRING); - break; - case INTEGER: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.INTEGER); - break; - case BOOLEAN: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.BOOLEAN); - break; - case DATETIME: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.DATETIME); - break; - case DECIMAL: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.DECIMAL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CodeSystem.PropertyTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CODE: + tgt.setValue(CodeSystem.PropertyType.CODE); + break; + case CODING: + tgt.setValue(CodeSystem.PropertyType.CODING); + break; + case STRING: + tgt.setValue(CodeSystem.PropertyType.STRING); + break; + case INTEGER: + tgt.setValue(CodeSystem.PropertyType.INTEGER); + break; + case BOOLEAN: + tgt.setValue(CodeSystem.PropertyType.BOOLEAN); + break; + case DATETIME: + tgt.setValue(CodeSystem.PropertyType.DATETIME); + break; + case DECIMAL: + tgt.setValue(CodeSystem.PropertyType.DECIMAL); + break; + default: + tgt.setValue(CodeSystem.PropertyType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertPropertyType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CodeSystem.PropertyTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case CODE: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.CODE); - break; - case CODING: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.CODING); - break; - case STRING: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.STRING); - break; - case INTEGER: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.INTEGER); - break; - case BOOLEAN: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.BOOLEAN); - break; - case DATETIME: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.DATETIME); - break; - case DECIMAL: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.DECIMAL); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CodeSystem.PropertyTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CODE: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.CODE); + break; + case CODING: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.CODING); + break; + case STRING: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.STRING); + break; + case INTEGER: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.INTEGER); + break; + case BOOLEAN: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.BOOLEAN); + break; + case DATETIME: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.DATETIME); + break; + case DECIMAL: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.DECIMAL); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent convertConceptDefinitionComponent(org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Communication40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Communication40_50.java index e5eabb92a4..21a2a94eb2 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Communication40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Communication40_50.java @@ -9,9 +9,12 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Uri40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Communication; import org.hl7.fhir.r4.model.StringType; import org.hl7.fhir.r5.model.CodeableConcept; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -145,127 +148,143 @@ public static org.hl7.fhir.r4.model.Communication convertCommunication(org.hl7.f } static public org.hl7.fhir.r5.model.Enumeration convertCommunicationStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.EventStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PREPARATION: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.PREPARATION); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.INPROGRESS); - break; - case NOTDONE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.NOTDONE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.ONHOLD); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.STOPPED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.EventStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PREPARATION: + tgt.setValue(Enumerations.EventStatus.PREPARATION); + break; + case INPROGRESS: + tgt.setValue(Enumerations.EventStatus.INPROGRESS); + break; + case NOTDONE: + tgt.setValue(Enumerations.EventStatus.NOTDONE); + break; + case ONHOLD: + tgt.setValue(Enumerations.EventStatus.ONHOLD); + break; + case STOPPED: + tgt.setValue(Enumerations.EventStatus.STOPPED); + break; + case COMPLETED: + tgt.setValue(Enumerations.EventStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.EventStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Enumerations.EventStatus.UNKNOWN); + break; + default: + tgt.setValue(Enumerations.EventStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertCommunicationStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Communication.CommunicationStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PREPARATION: - tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationStatus.PREPARATION); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationStatus.INPROGRESS); - break; - case NOTDONE: - tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationStatus.NOTDONE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationStatus.ONHOLD); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationStatus.STOPPED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new Communication.CommunicationStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PREPARATION: + tgt.setValue(Communication.CommunicationStatus.PREPARATION); + break; + case INPROGRESS: + tgt.setValue(Communication.CommunicationStatus.INPROGRESS); + break; + case NOTDONE: + tgt.setValue(Communication.CommunicationStatus.NOTDONE); + break; + case ONHOLD: + tgt.setValue(Communication.CommunicationStatus.ONHOLD); + break; + case STOPPED: + tgt.setValue(Communication.CommunicationStatus.STOPPED); + break; + case COMPLETED: + tgt.setValue(Communication.CommunicationStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(Communication.CommunicationStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Communication.CommunicationStatus.UNKNOWN); + break; + default: + tgt.setValue(Communication.CommunicationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertCommunicationPriority(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestPriorityEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP); - break; - case STAT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.RequestPriorityEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(Enumerations.RequestPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(Enumerations.RequestPriority.URGENT); + break; + case ASAP: + tgt.setValue(Enumerations.RequestPriority.ASAP); + break; + case STAT: + tgt.setValue(Enumerations.RequestPriority.STAT); + break; + default: + tgt.setValue(Enumerations.RequestPriority.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertCommunicationPriority(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Communication.CommunicationPriorityEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationPriority.URGENT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationPriority.ASAP); - break; - case STAT: - tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationPriority.STAT); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Communication.CommunicationPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new Communication.CommunicationPriorityEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(Communication.CommunicationPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(Communication.CommunicationPriority.URGENT); + break; + case ASAP: + tgt.setValue(Communication.CommunicationPriority.ASAP); + break; + case STAT: + tgt.setValue(Communication.CommunicationPriority.STAT); + break; + default: + tgt.setValue(Communication.CommunicationPriority.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Communication.CommunicationPayloadComponent convertCommunicationPayloadComponent(org.hl7.fhir.r4.model.Communication.CommunicationPayloadComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/CommunicationRequest40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/CommunicationRequest40_50.java index 25abd68dc9..a33601f02e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/CommunicationRequest40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/CommunicationRequest40_50.java @@ -8,7 +8,10 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.DateTime40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.CommunicationRequest; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -140,121 +143,137 @@ public static org.hl7.fhir.r4.model.CommunicationRequest convertCommunicationReq } static public org.hl7.fhir.r5.model.Enumeration convertCommunicationRequestStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ONHOLD); - break; - case REVOKED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.REVOKED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.RequestStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(Enumerations.RequestStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(Enumerations.RequestStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(Enumerations.RequestStatus.ONHOLD); + break; + case REVOKED: + tgt.setValue(Enumerations.RequestStatus.REVOKED); + break; + case COMPLETED: + tgt.setValue(Enumerations.RequestStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.RequestStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Enumerations.RequestStatus.UNKNOWN); + break; + default: + tgt.setValue(Enumerations.RequestStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertCommunicationRequestStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.ONHOLD); - break; - case REVOKED: - tgt.setValue(org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.REVOKED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new CommunicationRequest.CommunicationRequestStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(CommunicationRequest.CommunicationRequestStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(CommunicationRequest.CommunicationRequestStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(CommunicationRequest.CommunicationRequestStatus.ONHOLD); + break; + case REVOKED: + tgt.setValue(CommunicationRequest.CommunicationRequestStatus.REVOKED); + break; + case COMPLETED: + tgt.setValue(CommunicationRequest.CommunicationRequestStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(CommunicationRequest.CommunicationRequestStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(CommunicationRequest.CommunicationRequestStatus.UNKNOWN); + break; + default: + tgt.setValue(CommunicationRequest.CommunicationRequestStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertCommunicationPriority(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestPriorityEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP); - break; - case STAT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.RequestPriorityEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(Enumerations.RequestPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(Enumerations.RequestPriority.URGENT); + break; + case ASAP: + tgt.setValue(Enumerations.RequestPriority.ASAP); + break; + case STAT: + tgt.setValue(Enumerations.RequestPriority.STAT); + break; + default: + tgt.setValue(Enumerations.RequestPriority.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertCommunicationPriority(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CommunicationRequest.CommunicationPriorityEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.r4.model.CommunicationRequest.CommunicationPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.r4.model.CommunicationRequest.CommunicationPriority.URGENT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.r4.model.CommunicationRequest.CommunicationPriority.ASAP); - break; - case STAT: - tgt.setValue(org.hl7.fhir.r4.model.CommunicationRequest.CommunicationPriority.STAT); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CommunicationRequest.CommunicationPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new CommunicationRequest.CommunicationPriorityEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(CommunicationRequest.CommunicationPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(CommunicationRequest.CommunicationPriority.URGENT); + break; + case ASAP: + tgt.setValue(CommunicationRequest.CommunicationPriority.ASAP); + break; + case STAT: + tgt.setValue(CommunicationRequest.CommunicationPriority.STAT); + break; + default: + tgt.setValue(CommunicationRequest.CommunicationPriority.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.CommunicationRequest.CommunicationRequestPayloadComponent convertCommunicationRequestPayloadComponent(org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestPayloadComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/CompartmentDefinition40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/CompartmentDefinition40_50.java index e56f46be03..76df9eea86 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/CompartmentDefinition40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/CompartmentDefinition40_50.java @@ -10,6 +10,9 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Uri40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.CompartmentDefinition; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -115,59 +118,67 @@ public static org.hl7.fhir.r4.model.CompartmentDefinition convertCompartmentDefi } static public org.hl7.fhir.r5.model.Enumeration convertCompartmentType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.CompartmentTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PATIENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.PATIENT); - break; - case ENCOUNTER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.ENCOUNTER); - break; - case RELATEDPERSON: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.RELATEDPERSON); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.PRACTITIONER); - break; - case DEVICE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.DEVICE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.CompartmentTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PATIENT: + tgt.setValue(Enumerations.CompartmentType.PATIENT); + break; + case ENCOUNTER: + tgt.setValue(Enumerations.CompartmentType.ENCOUNTER); + break; + case RELATEDPERSON: + tgt.setValue(Enumerations.CompartmentType.RELATEDPERSON); + break; + case PRACTITIONER: + tgt.setValue(Enumerations.CompartmentType.PRACTITIONER); + break; + case DEVICE: + tgt.setValue(Enumerations.CompartmentType.DEVICE); + break; + default: + tgt.setValue(Enumerations.CompartmentType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertCompartmentType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PATIENT: - tgt.setValue(org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.PATIENT); - break; - case ENCOUNTER: - tgt.setValue(org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.ENCOUNTER); - break; - case RELATEDPERSON: - tgt.setValue(org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.RELATEDPERSON); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.PRACTITIONER); - break; - case DEVICE: - tgt.setValue(org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.DEVICE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new CompartmentDefinition.CompartmentTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PATIENT: + tgt.setValue(CompartmentDefinition.CompartmentType.PATIENT); + break; + case ENCOUNTER: + tgt.setValue(CompartmentDefinition.CompartmentType.ENCOUNTER); + break; + case RELATEDPERSON: + tgt.setValue(CompartmentDefinition.CompartmentType.RELATEDPERSON); + break; + case PRACTITIONER: + tgt.setValue(CompartmentDefinition.CompartmentType.PRACTITIONER); + break; + case DEVICE: + tgt.setValue(CompartmentDefinition.CompartmentType.DEVICE); + break; + default: + tgt.setValue(CompartmentDefinition.CompartmentType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.CompartmentDefinition.CompartmentDefinitionResourceComponent convertCompartmentDefinitionResourceComponent(org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentDefinitionResourceComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Composition40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Composition40_50.java index 7bf1931a13..bb7c86fdac 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Composition40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Composition40_50.java @@ -9,8 +9,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Narrative40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.r5.model.CodeableReference; -import org.hl7.fhir.r5.model.RelatedArtifact; +import org.hl7.fhir.r4.model.Composition; +import org.hl7.fhir.r5.model.*; /* Copyright (c) 2011+, HL7, Inc. @@ -118,53 +118,61 @@ public static org.hl7.fhir.r4.model.Composition convertComposition(org.hl7.fhir. } static public org.hl7.fhir.r5.model.Enumeration convertCompositionStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.CompositionStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.AMENDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.CompositionStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRELIMINARY: + tgt.setValue(Enumerations.CompositionStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(Enumerations.CompositionStatus.FINAL); + break; + case AMENDED: + tgt.setValue(Enumerations.CompositionStatus.AMENDED); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.CompositionStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Enumerations.CompositionStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertCompositionStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Composition.CompositionStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionStatus.AMENDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new Composition.CompositionStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRELIMINARY: + tgt.setValue(Composition.CompositionStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(Composition.CompositionStatus.FINAL); + break; + case AMENDED: + tgt.setValue(Composition.CompositionStatus.AMENDED); + break; + case ENTEREDINERROR: + tgt.setValue(Composition.CompositionStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Composition.CompositionStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Coding convertDocumentConfidentiality(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { @@ -236,27 +244,31 @@ public static org.hl7.fhir.r4.model.Composition.CompositionAttesterComponent con } static public org.hl7.fhir.r5.model.CodeableConcept convertCompositionAttestationMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.CodeableConcept tgt = new org.hl7.fhir.r5.model.CodeableConcept(); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PERSONAL: - tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("personal"); - break; - case PROFESSIONAL: - tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("professional"); - break; - case LEGAL: - tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("legal"); - break; - case OFFICIAL: - tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("official"); - break; - default: - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + CodeableConcept tgt = new CodeableConcept(); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + // Add nothing + } else { + switch (src.getValue()) { + case PERSONAL: + tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("personal"); + break; + case PROFESSIONAL: + tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("professional"); + break; + case LEGAL: + tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("legal"); + break; + case OFFICIAL: + tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("official"); + break; + default: + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertCompositionAttestationMode(org.hl7.fhir.r5.model.CodeableConcept src) throws FHIRException { @@ -309,53 +321,61 @@ public static org.hl7.fhir.r4.model.Composition.CompositionRelatesToComponent co } static public org.hl7.fhir.r5.model.Enumeration convertDocumentRelationshipType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case REPLACES: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.REPLACES); - break; - case TRANSFORMS: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.TRANSFORMS); - break; - case SIGNS: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.SIGNS); - break; - case APPENDS: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.APPENDS); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new RelatedArtifact.RelatedArtifactTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REPLACES: + tgt.setValue(RelatedArtifact.RelatedArtifactType.REPLACES); + break; + case TRANSFORMS: + tgt.setValue(RelatedArtifact.RelatedArtifactType.TRANSFORMS); + break; + case SIGNS: + tgt.setValue(RelatedArtifact.RelatedArtifactType.SIGNS); + break; + case APPENDS: + tgt.setValue(RelatedArtifact.RelatedArtifactType.APPENDS); + break; + default: + tgt.setValue(RelatedArtifact.RelatedArtifactType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertDocumentRelationshipType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Composition.DocumentRelationshipTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case REPLACES: - tgt.setValue(org.hl7.fhir.r4.model.Composition.DocumentRelationshipType.REPLACES); - break; - case TRANSFORMS: - tgt.setValue(org.hl7.fhir.r4.model.Composition.DocumentRelationshipType.TRANSFORMS); - break; - case SIGNS: - tgt.setValue(org.hl7.fhir.r4.model.Composition.DocumentRelationshipType.SIGNS); - break; - case APPENDS: - tgt.setValue(org.hl7.fhir.r4.model.Composition.DocumentRelationshipType.APPENDS); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Composition.DocumentRelationshipType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new Composition.DocumentRelationshipTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REPLACES: + tgt.setValue(Composition.DocumentRelationshipType.REPLACES); + break; + case TRANSFORMS: + tgt.setValue(Composition.DocumentRelationshipType.TRANSFORMS); + break; + case SIGNS: + tgt.setValue(Composition.DocumentRelationshipType.SIGNS); + break; + case APPENDS: + tgt.setValue(Composition.DocumentRelationshipType.APPENDS); + break; + default: + tgt.setValue(Composition.DocumentRelationshipType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Composition.CompositionEventComponent convertCompositionEventComponent(org.hl7.fhir.r4.model.Composition.CompositionEventComponent src) throws FHIRException { @@ -442,46 +462,54 @@ public static org.hl7.fhir.r4.model.Composition.SectionComponent convertSectionC } static public org.hl7.fhir.r5.model.Enumeration convertSectionMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ListModeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case WORKING: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ListMode.WORKING); - break; - case SNAPSHOT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ListMode.SNAPSHOT); - break; - case CHANGES: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ListMode.CHANGES); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ListMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ListModeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case WORKING: + tgt.setValue(Enumerations.ListMode.WORKING); + break; + case SNAPSHOT: + tgt.setValue(Enumerations.ListMode.SNAPSHOT); + break; + case CHANGES: + tgt.setValue(Enumerations.ListMode.CHANGES); + break; + default: + tgt.setValue(Enumerations.ListMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertSectionMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Composition.SectionModeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case WORKING: - tgt.setValue(org.hl7.fhir.r4.model.Composition.SectionMode.WORKING); - break; - case SNAPSHOT: - tgt.setValue(org.hl7.fhir.r4.model.Composition.SectionMode.SNAPSHOT); - break; - case CHANGES: - tgt.setValue(org.hl7.fhir.r4.model.Composition.SectionMode.CHANGES); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Composition.SectionMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new Composition.SectionModeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case WORKING: + tgt.setValue(Composition.SectionMode.WORKING); + break; + case SNAPSHOT: + tgt.setValue(Composition.SectionMode.SNAPSHOT); + break; + case CHANGES: + tgt.setValue(Composition.SectionMode.CHANGES); + break; + default: + tgt.setValue(Composition.SectionMode.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ConceptMap40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ConceptMap40_50.java index 17fcbd651d..0a8cc35e81 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ConceptMap40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ConceptMap40_50.java @@ -15,10 +15,7 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Uri40_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence; -import org.hl7.fhir.r5.model.CanonicalType; -import org.hl7.fhir.r5.model.Coding; -import org.hl7.fhir.r5.model.Enumeration; -import org.hl7.fhir.r5.model.Enumerations; +import org.hl7.fhir.r5.model.*; import org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship; import org.hl7.fhir.r5.utils.ToolingExtensions; import org.hl7.fhir.utilities.CanonicalPair; @@ -293,72 +290,80 @@ public static org.hl7.fhir.r4.model.Enumeration convertCo if (ccm.hasExtension(VersionConvertorConstants.EXT_OLD_CONCEPTMAP_EQUIVALENCE)) { tgt.setValueAsString(ccm.getExtensionString(VersionConvertorConstants.EXT_OLD_CONCEPTMAP_EQUIVALENCE)); } else { - switch (src.getValue()) { - case RELATEDTO: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.RELATEDTO); - break; - case EQUIVALENT: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.EQUIVALENT); - break; - case SOURCEISNARROWERTHANTARGET: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.WIDER); - break; - case SOURCEISBROADERTHANTARGET: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.NARROWER); - break; - case NOTRELATEDTO: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.DISJOINT); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.NULL); - break; - } + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case RELATEDTO: + tgt.setValue(ConceptMapEquivalence.RELATEDTO); + break; + case EQUIVALENT: + tgt.setValue(ConceptMapEquivalence.EQUIVALENT); + break; + case SOURCEISNARROWERTHANTARGET: + tgt.setValue(ConceptMapEquivalence.WIDER); + break; + case SOURCEISBROADERTHANTARGET: + tgt.setValue(ConceptMapEquivalence.NARROWER); + break; + case NOTRELATEDTO: + tgt.setValue(ConceptMapEquivalence.DISJOINT); + break; + default: + tgt.setValue(ConceptMapEquivalence.NULL); + break; + } + } } return tgt; } public static Enumeration convertConceptMapRelationship(org.hl7.fhir.r4.model.Enumeration src, org.hl7.fhir.r5.model.ConceptMap.TargetElementComponent tgtCtxt) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - Enumeration tgt = new Enumeration(new Enumerations.ConceptMapRelationshipEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - ToolingExtensions.setCodeExtensionMod(tgtCtxt, VersionConvertorConstants.EXT_OLD_CONCEPTMAP_EQUIVALENCE, src.getValueAsString()); - switch (src.getValue()) { - case EQUIVALENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.EQUIVALENT); - break; - case EQUAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.EQUIVALENT); - break; - case WIDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.SOURCEISNARROWERTHANTARGET); - break; - case SUBSUMES: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.SOURCEISNARROWERTHANTARGET); - break; - case NARROWER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.SOURCEISBROADERTHANTARGET); - break; - case SPECIALIZES: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.SOURCEISBROADERTHANTARGET); - break; - case RELATEDTO: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.RELATEDTO); - break; - case INEXACT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.RELATEDTO); - break; - case UNMATCHED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NULL); - break; - case DISJOINT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NOTRELATEDTO); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration(new Enumerations.ConceptMapRelationshipEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + ToolingExtensions.setCodeExtensionMod(tgtCtxt, VersionConvertorConstants.EXT_OLD_CONCEPTMAP_EQUIVALENCE, src.getValueAsString()); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUIVALENT: + tgt.setValue(ConceptMapRelationship.EQUIVALENT); + break; + case EQUAL: + tgt.setValue(ConceptMapRelationship.EQUIVALENT); + break; + case WIDER: + tgt.setValue(ConceptMapRelationship.SOURCEISNARROWERTHANTARGET); + break; + case SUBSUMES: + tgt.setValue(ConceptMapRelationship.SOURCEISNARROWERTHANTARGET); + break; + case NARROWER: + tgt.setValue(ConceptMapRelationship.SOURCEISBROADERTHANTARGET); + break; + case SPECIALIZES: + tgt.setValue(ConceptMapRelationship.SOURCEISBROADERTHANTARGET); + break; + case RELATEDTO: + tgt.setValue(ConceptMapRelationship.RELATEDTO); + break; + case INEXACT: + tgt.setValue(ConceptMapRelationship.RELATEDTO); + break; + case UNMATCHED: + tgt.setValue(ConceptMapRelationship.NULL); + break; + case DISJOINT: + tgt.setValue(ConceptMapRelationship.NOTRELATEDTO); + break; + default: + tgt.setValue(ConceptMapRelationship.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent convertOtherElementComponent(org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent src, org.hl7.fhir.r5.model.ConceptMap tgtMap) throws FHIRException { @@ -428,46 +433,54 @@ public static org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedComponent } static public org.hl7.fhir.r5.model.Enumeration convertConceptMapGroupUnmappedMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedModeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROVIDED: - tgt.setValue(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode.USESOURCECODE); - break; - case FIXED: - tgt.setValue(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode.FIXED); - break; - case OTHERMAP: - tgt.setValue(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode.OTHERMAP); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ConceptMap.ConceptMapGroupUnmappedModeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROVIDED: + tgt.setValue(ConceptMap.ConceptMapGroupUnmappedMode.USESOURCECODE); + break; + case FIXED: + tgt.setValue(ConceptMap.ConceptMapGroupUnmappedMode.FIXED); + break; + case OTHERMAP: + tgt.setValue(ConceptMap.ConceptMapGroupUnmappedMode.OTHERMAP); + break; + default: + tgt.setValue(ConceptMap.ConceptMapGroupUnmappedMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertConceptMapGroupUnmappedMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedModeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case USESOURCECODE: - tgt.setValue(org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode.PROVIDED); - break; - case FIXED: - tgt.setValue(org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode.FIXED); - break; - case OTHERMAP: - tgt.setValue(org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode.OTHERMAP); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedModeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case USESOURCECODE: + tgt.setValue(org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode.PROVIDED); + break; + case FIXED: + tgt.setValue(org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode.FIXED); + break; + case OTHERMAP: + tgt.setValue(org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode.OTHERMAP); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Consent40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Consent40_50.java index 727efa673b..ef121a4a17 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Consent40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Consent40_50.java @@ -10,6 +10,9 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.DateTime40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Consent; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -113,59 +116,67 @@ public static org.hl7.fhir.r4.model.Consent convertConsent(org.hl7.fhir.r5.model } static public org.hl7.fhir.r5.model.Enumeration convertConsentState(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Consent.ConsentStateEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.Consent.ConsentState.DRAFT); - break; - case PROPOSED: - tgt.setValue(org.hl7.fhir.r5.model.Consent.ConsentState.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Consent.ConsentState.ACTIVE); - break; - case REJECTED: - tgt.setValue(org.hl7.fhir.r5.model.Consent.ConsentState.INACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Consent.ConsentState.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Consent.ConsentState.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Consent.ConsentState.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Consent.ConsentStateEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(Consent.ConsentState.DRAFT); + break; + case PROPOSED: + tgt.setValue(Consent.ConsentState.DRAFT); + break; + case ACTIVE: + tgt.setValue(Consent.ConsentState.ACTIVE); + break; + case REJECTED: + tgt.setValue(Consent.ConsentState.INACTIVE); + break; + case INACTIVE: + tgt.setValue(Consent.ConsentState.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(Consent.ConsentState.ENTEREDINERROR); + break; + default: + tgt.setValue(Consent.ConsentState.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertConsentState(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Consent.ConsentStateEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r4.model.Consent.ConsentState.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Consent.ConsentState.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Consent.ConsentState.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Consent.ConsentState.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Consent.ConsentState.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Consent.ConsentStateEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(org.hl7.fhir.r4.model.Consent.ConsentState.DRAFT); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4.model.Consent.ConsentState.ACTIVE); + break; + case INACTIVE: + tgt.setValue(org.hl7.fhir.r4.model.Consent.ConsentState.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.Consent.ConsentState.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Consent.ConsentState.NULL); + break; + } + } + return tgt; } // public static org.hl7.fhir.r5.model.Consent.ConsentPolicyComponent convertConsentPolicyComponent(org.hl7.fhir.r4.model.Consent.ConsentPolicyComponent src) throws FHIRException { @@ -275,41 +286,49 @@ public static org.hl7.fhir.r4.model.Consent.ProvisionComponent convertprovisionC } static public org.hl7.fhir.r5.model.Enumeration convertConsentProvisionType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ConsentProvisionTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case DENY: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConsentProvisionType.DENY); - break; - case PERMIT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConsentProvisionType.PERMIT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConsentProvisionType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ConsentProvisionTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DENY: + tgt.setValue(Enumerations.ConsentProvisionType.DENY); + break; + case PERMIT: + tgt.setValue(Enumerations.ConsentProvisionType.PERMIT); + break; + default: + tgt.setValue(Enumerations.ConsentProvisionType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertConsentProvisionType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Consent.ConsentProvisionTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case DENY: - tgt.setValue(org.hl7.fhir.r4.model.Consent.ConsentProvisionType.DENY); - break; - case PERMIT: - tgt.setValue(org.hl7.fhir.r4.model.Consent.ConsentProvisionType.PERMIT); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Consent.ConsentProvisionType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Consent.ConsentProvisionTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DENY: + tgt.setValue(org.hl7.fhir.r4.model.Consent.ConsentProvisionType.DENY); + break; + case PERMIT: + tgt.setValue(org.hl7.fhir.r4.model.Consent.ConsentProvisionType.PERMIT); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Consent.ConsentProvisionType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Consent.ProvisionActorComponent convertprovisionActorComponent(org.hl7.fhir.r4.model.Consent.provisionActorComponent src) throws FHIRException { @@ -361,52 +380,60 @@ public static org.hl7.fhir.r4.model.Consent.provisionDataComponent convertprovis } static public org.hl7.fhir.r5.model.Enumeration convertConsentDataMeaning(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ConsentDataMeaningEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConsentDataMeaning.INSTANCE); - break; - case RELATED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConsentDataMeaning.RELATED); - break; - case DEPENDENTS: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConsentDataMeaning.DEPENDENTS); - break; - case AUTHOREDBY: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConsentDataMeaning.AUTHOREDBY); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConsentDataMeaning.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ConsentDataMeaningEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(Enumerations.ConsentDataMeaning.INSTANCE); + break; + case RELATED: + tgt.setValue(Enumerations.ConsentDataMeaning.RELATED); + break; + case DEPENDENTS: + tgt.setValue(Enumerations.ConsentDataMeaning.DEPENDENTS); + break; + case AUTHOREDBY: + tgt.setValue(Enumerations.ConsentDataMeaning.AUTHOREDBY); + break; + default: + tgt.setValue(Enumerations.ConsentDataMeaning.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertConsentDataMeaning(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Consent.ConsentDataMeaningEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.r4.model.Consent.ConsentDataMeaning.INSTANCE); - break; - case RELATED: - tgt.setValue(org.hl7.fhir.r4.model.Consent.ConsentDataMeaning.RELATED); - break; - case DEPENDENTS: - tgt.setValue(org.hl7.fhir.r4.model.Consent.ConsentDataMeaning.DEPENDENTS); - break; - case AUTHOREDBY: - tgt.setValue(org.hl7.fhir.r4.model.Consent.ConsentDataMeaning.AUTHOREDBY); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Consent.ConsentDataMeaning.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Consent.ConsentDataMeaningEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(org.hl7.fhir.r4.model.Consent.ConsentDataMeaning.INSTANCE); + break; + case RELATED: + tgt.setValue(org.hl7.fhir.r4.model.Consent.ConsentDataMeaning.RELATED); + break; + case DEPENDENTS: + tgt.setValue(org.hl7.fhir.r4.model.Consent.ConsentDataMeaning.DEPENDENTS); + break; + case AUTHOREDBY: + tgt.setValue(org.hl7.fhir.r4.model.Consent.ConsentDataMeaning.AUTHOREDBY); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Consent.ConsentDataMeaning.NULL); + break; + } + } + return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Contract40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Contract40_50.java index 6e164ec61c..0b46f8eeea 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Contract40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Contract40_50.java @@ -19,6 +19,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Contract; +import org.hl7.fhir.r5.model.Enumeration; /* Copyright (c) 2011+, HL7, Inc. @@ -188,119 +190,127 @@ public static org.hl7.fhir.r4.model.Contract convertContract(org.hl7.fhir.r5.mod } static public org.hl7.fhir.r5.model.Enumeration convertContractStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodesEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case AMENDED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.AMENDED); - break; - case APPENDED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.APPENDED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.CANCELLED); - break; - case DISPUTED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.DISPUTED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.ENTEREDINERROR); - break; - case EXECUTABLE: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.EXECUTABLE); - break; - case EXECUTED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.EXECUTED); - break; - case NEGOTIABLE: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.NEGOTIABLE); - break; - case OFFERED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.OFFERED); - break; - case POLICY: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.POLICY); - break; - case REJECTED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.REJECTED); - break; - case RENEWED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.RENEWED); - break; - case REVOKED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.REVOKED); - break; - case RESOLVED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.RESOLVED); - break; - case TERMINATED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.TERMINATED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Contract.ContractResourceStatusCodesEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case AMENDED: + tgt.setValue(Contract.ContractResourceStatusCodes.AMENDED); + break; + case APPENDED: + tgt.setValue(Contract.ContractResourceStatusCodes.APPENDED); + break; + case CANCELLED: + tgt.setValue(Contract.ContractResourceStatusCodes.CANCELLED); + break; + case DISPUTED: + tgt.setValue(Contract.ContractResourceStatusCodes.DISPUTED); + break; + case ENTEREDINERROR: + tgt.setValue(Contract.ContractResourceStatusCodes.ENTEREDINERROR); + break; + case EXECUTABLE: + tgt.setValue(Contract.ContractResourceStatusCodes.EXECUTABLE); + break; + case EXECUTED: + tgt.setValue(Contract.ContractResourceStatusCodes.EXECUTED); + break; + case NEGOTIABLE: + tgt.setValue(Contract.ContractResourceStatusCodes.NEGOTIABLE); + break; + case OFFERED: + tgt.setValue(Contract.ContractResourceStatusCodes.OFFERED); + break; + case POLICY: + tgt.setValue(Contract.ContractResourceStatusCodes.POLICY); + break; + case REJECTED: + tgt.setValue(Contract.ContractResourceStatusCodes.REJECTED); + break; + case RENEWED: + tgt.setValue(Contract.ContractResourceStatusCodes.RENEWED); + break; + case REVOKED: + tgt.setValue(Contract.ContractResourceStatusCodes.REVOKED); + break; + case RESOLVED: + tgt.setValue(Contract.ContractResourceStatusCodes.RESOLVED); + break; + case TERMINATED: + tgt.setValue(Contract.ContractResourceStatusCodes.TERMINATED); + break; + default: + tgt.setValue(Contract.ContractResourceStatusCodes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertContractStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Contract.ContractStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case AMENDED: - tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractStatus.AMENDED); - break; - case APPENDED: - tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractStatus.APPENDED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractStatus.CANCELLED); - break; - case DISPUTED: - tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractStatus.DISPUTED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractStatus.ENTEREDINERROR); - break; - case EXECUTABLE: - tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractStatus.EXECUTABLE); - break; - case EXECUTED: - tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractStatus.EXECUTED); - break; - case NEGOTIABLE: - tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractStatus.NEGOTIABLE); - break; - case OFFERED: - tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractStatus.OFFERED); - break; - case POLICY: - tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractStatus.POLICY); - break; - case REJECTED: - tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractStatus.REJECTED); - break; - case RENEWED: - tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractStatus.RENEWED); - break; - case REVOKED: - tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractStatus.REVOKED); - break; - case RESOLVED: - tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractStatus.RESOLVED); - break; - case TERMINATED: - tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractStatus.TERMINATED); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Contract.ContractStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case AMENDED: + tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractStatus.AMENDED); + break; + case APPENDED: + tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractStatus.APPENDED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractStatus.CANCELLED); + break; + case DISPUTED: + tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractStatus.DISPUTED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractStatus.ENTEREDINERROR); + break; + case EXECUTABLE: + tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractStatus.EXECUTABLE); + break; + case EXECUTED: + tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractStatus.EXECUTED); + break; + case NEGOTIABLE: + tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractStatus.NEGOTIABLE); + break; + case OFFERED: + tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractStatus.OFFERED); + break; + case POLICY: + tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractStatus.POLICY); + break; + case REJECTED: + tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractStatus.REJECTED); + break; + case RENEWED: + tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractStatus.RENEWED); + break; + case REVOKED: + tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractStatus.REVOKED); + break; + case RESOLVED: + tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractStatus.RESOLVED); + break; + case TERMINATED: + tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractStatus.TERMINATED); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Contract.ContentDefinitionComponent convertContentDefinitionComponent(org.hl7.fhir.r4.model.Contract.ContentDefinitionComponent src) throws FHIRException { @@ -344,119 +354,127 @@ public static org.hl7.fhir.r4.model.Contract.ContentDefinitionComponent convertC } static public org.hl7.fhir.r5.model.Enumeration convertContractPublicationStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodesEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case AMENDED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.AMENDED); - break; - case APPENDED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.APPENDED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.CANCELLED); - break; - case DISPUTED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.DISPUTED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.ENTEREDINERROR); - break; - case EXECUTABLE: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.EXECUTABLE); - break; - case EXECUTED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.EXECUTED); - break; - case NEGOTIABLE: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.NEGOTIABLE); - break; - case OFFERED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.OFFERED); - break; - case POLICY: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.POLICY); - break; - case REJECTED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.REJECTED); - break; - case RENEWED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.RENEWED); - break; - case REVOKED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.REVOKED); - break; - case RESOLVED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.RESOLVED); - break; - case TERMINATED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.TERMINATED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Contract.ContractResourcePublicationStatusCodesEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case AMENDED: + tgt.setValue(Contract.ContractResourcePublicationStatusCodes.AMENDED); + break; + case APPENDED: + tgt.setValue(Contract.ContractResourcePublicationStatusCodes.APPENDED); + break; + case CANCELLED: + tgt.setValue(Contract.ContractResourcePublicationStatusCodes.CANCELLED); + break; + case DISPUTED: + tgt.setValue(Contract.ContractResourcePublicationStatusCodes.DISPUTED); + break; + case ENTEREDINERROR: + tgt.setValue(Contract.ContractResourcePublicationStatusCodes.ENTEREDINERROR); + break; + case EXECUTABLE: + tgt.setValue(Contract.ContractResourcePublicationStatusCodes.EXECUTABLE); + break; + case EXECUTED: + tgt.setValue(Contract.ContractResourcePublicationStatusCodes.EXECUTED); + break; + case NEGOTIABLE: + tgt.setValue(Contract.ContractResourcePublicationStatusCodes.NEGOTIABLE); + break; + case OFFERED: + tgt.setValue(Contract.ContractResourcePublicationStatusCodes.OFFERED); + break; + case POLICY: + tgt.setValue(Contract.ContractResourcePublicationStatusCodes.POLICY); + break; + case REJECTED: + tgt.setValue(Contract.ContractResourcePublicationStatusCodes.REJECTED); + break; + case RENEWED: + tgt.setValue(Contract.ContractResourcePublicationStatusCodes.RENEWED); + break; + case REVOKED: + tgt.setValue(Contract.ContractResourcePublicationStatusCodes.REVOKED); + break; + case RESOLVED: + tgt.setValue(Contract.ContractResourcePublicationStatusCodes.RESOLVED); + break; + case TERMINATED: + tgt.setValue(Contract.ContractResourcePublicationStatusCodes.TERMINATED); + break; + default: + tgt.setValue(Contract.ContractResourcePublicationStatusCodes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertContractPublicationStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Contract.ContractPublicationStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case AMENDED: - tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.AMENDED); - break; - case APPENDED: - tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.APPENDED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.CANCELLED); - break; - case DISPUTED: - tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.DISPUTED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.ENTEREDINERROR); - break; - case EXECUTABLE: - tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.EXECUTABLE); - break; - case EXECUTED: - tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.EXECUTED); - break; - case NEGOTIABLE: - tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.NEGOTIABLE); - break; - case OFFERED: - tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.OFFERED); - break; - case POLICY: - tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.POLICY); - break; - case REJECTED: - tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.REJECTED); - break; - case RENEWED: - tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.RENEWED); - break; - case REVOKED: - tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.REVOKED); - break; - case RESOLVED: - tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.RESOLVED); - break; - case TERMINATED: - tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.TERMINATED); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Contract.ContractPublicationStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case AMENDED: + tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.AMENDED); + break; + case APPENDED: + tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.APPENDED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.CANCELLED); + break; + case DISPUTED: + tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.DISPUTED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.ENTEREDINERROR); + break; + case EXECUTABLE: + tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.EXECUTABLE); + break; + case EXECUTED: + tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.EXECUTED); + break; + case NEGOTIABLE: + tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.NEGOTIABLE); + break; + case OFFERED: + tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.OFFERED); + break; + case POLICY: + tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.POLICY); + break; + case REJECTED: + tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.REJECTED); + break; + case RENEWED: + tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.RENEWED); + break; + case REVOKED: + tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.REVOKED); + break; + case RESOLVED: + tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.RESOLVED); + break; + case TERMINATED: + tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.TERMINATED); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Contract.TermComponent convertTermComponent(org.hl7.fhir.r4.model.Contract.TermComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Coverage40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Coverage40_50.java index 15cee8eb16..98ce7c14a5 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Coverage40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Coverage40_50.java @@ -9,6 +9,9 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Coverage; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -120,53 +123,61 @@ public static org.hl7.fhir.r4.model.Coverage convertCoverage(org.hl7.fhir.r5.mod } static public org.hl7.fhir.r5.model.Enumeration convertCoverageStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodesEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.CANCELLED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.FinancialResourceStatusCodesEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.ACTIVE); + break; + case CANCELLED: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.CANCELLED); + break; + case DRAFT: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); + break; + default: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertCoverageStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Coverage.CoverageStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Coverage.CoverageStatus.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.Coverage.CoverageStatus.CANCELLED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r4.model.Coverage.CoverageStatus.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Coverage.CoverageStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Coverage.CoverageStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new Coverage.CoverageStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Coverage.CoverageStatus.ACTIVE); + break; + case CANCELLED: + tgt.setValue(Coverage.CoverageStatus.CANCELLED); + break; + case DRAFT: + tgt.setValue(Coverage.CoverageStatus.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(Coverage.CoverageStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Coverage.CoverageStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Coverage.ClassComponent convertClassComponent(org.hl7.fhir.r4.model.Coverage.ClassComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/CoverageEligibilityRequest40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/CoverageEligibilityRequest40_50.java index 02249b55bd..643c922e1e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/CoverageEligibilityRequest40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/CoverageEligibilityRequest40_50.java @@ -13,6 +13,9 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.CoverageEligibilityRequest; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -120,103 +123,119 @@ public static org.hl7.fhir.r4.model.CoverageEligibilityRequest convertCoverageEl } static public org.hl7.fhir.r5.model.Enumeration convertEligibilityRequestStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodesEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.CANCELLED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.FinancialResourceStatusCodesEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.ACTIVE); + break; + case CANCELLED: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.CANCELLED); + break; + case DRAFT: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); + break; + default: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertEligibilityRequestStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestStatus.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestStatus.CANCELLED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestStatus.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new CoverageEligibilityRequest.EligibilityRequestStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(CoverageEligibilityRequest.EligibilityRequestStatus.ACTIVE); + break; + case CANCELLED: + tgt.setValue(CoverageEligibilityRequest.EligibilityRequestStatus.CANCELLED); + break; + case DRAFT: + tgt.setValue(CoverageEligibilityRequest.EligibilityRequestStatus.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(CoverageEligibilityRequest.EligibilityRequestStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(CoverageEligibilityRequest.EligibilityRequestStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertEligibilityRequestPurpose(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurposeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case AUTHREQUIREMENTS: - tgt.setValue(org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose.AUTHREQUIREMENTS); - break; - case BENEFITS: - tgt.setValue(org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose.BENEFITS); - break; - case DISCOVERY: - tgt.setValue(org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose.DISCOVERY); - break; - case VALIDATION: - tgt.setValue(org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose.VALIDATION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurposeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case AUTHREQUIREMENTS: + tgt.setValue(org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose.AUTHREQUIREMENTS); + break; + case BENEFITS: + tgt.setValue(org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose.BENEFITS); + break; + case DISCOVERY: + tgt.setValue(org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose.DISCOVERY); + break; + case VALIDATION: + tgt.setValue(org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose.VALIDATION); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertEligibilityRequestPurpose(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestPurposeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case AUTHREQUIREMENTS: - tgt.setValue(org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestPurpose.AUTHREQUIREMENTS); - break; - case BENEFITS: - tgt.setValue(org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestPurpose.BENEFITS); - break; - case DISCOVERY: - tgt.setValue(org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestPurpose.DISCOVERY); - break; - case VALIDATION: - tgt.setValue(org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestPurpose.VALIDATION); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestPurpose.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new CoverageEligibilityRequest.EligibilityRequestPurposeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case AUTHREQUIREMENTS: + tgt.setValue(CoverageEligibilityRequest.EligibilityRequestPurpose.AUTHREQUIREMENTS); + break; + case BENEFITS: + tgt.setValue(CoverageEligibilityRequest.EligibilityRequestPurpose.BENEFITS); + break; + case DISCOVERY: + tgt.setValue(CoverageEligibilityRequest.EligibilityRequestPurpose.DISCOVERY); + break; + case VALIDATION: + tgt.setValue(CoverageEligibilityRequest.EligibilityRequestPurpose.VALIDATION); + break; + default: + tgt.setValue(CoverageEligibilityRequest.EligibilityRequestPurpose.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.CoverageEligibilityRequest.SupportingInformationComponent convertSupportingInformationComponent(org.hl7.fhir.r4.model.CoverageEligibilityRequest.SupportingInformationComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/DetectedIssue40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/DetectedIssue40_50.java index 104c27a7c2..3bcd4a710e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/DetectedIssue40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/DetectedIssue40_50.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Uri40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.DetectedIssue; +import org.hl7.fhir.r5.model.Enumeration; /* Copyright (c) 2011+, HL7, Inc. @@ -103,109 +105,125 @@ public static org.hl7.fhir.r4.model.DetectedIssue convertDetectedIssue(org.hl7.f } static public org.hl7.fhir.r5.model.Enumeration convertDetectedIssueStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.PRELIMINARY); - break; - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.FINAL); - break; - case CORRECTED: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.MITIGATED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.MITIGATED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.NULL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DetectedIssue.DetectedIssueStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(DetectedIssue.DetectedIssueStatus.PRELIMINARY); + break; + case PRELIMINARY: + tgt.setValue(DetectedIssue.DetectedIssueStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(DetectedIssue.DetectedIssueStatus.FINAL); + break; + case AMENDED: + tgt.setValue(DetectedIssue.DetectedIssueStatus.FINAL); + break; + case CORRECTED: + tgt.setValue(DetectedIssue.DetectedIssueStatus.MITIGATED); + break; + case CANCELLED: + tgt.setValue(DetectedIssue.DetectedIssueStatus.MITIGATED); + break; + case ENTEREDINERROR: + tgt.setValue(DetectedIssue.DetectedIssueStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(DetectedIssue.DetectedIssueStatus.NULL); + break; + default: + tgt.setValue(DetectedIssue.DetectedIssueStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertDetectedIssueStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.FINAL); - break; - case MITIGATED: - tgt.setValue(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.CORRECTED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRELIMINARY: + tgt.setValue(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.FINAL); + break; + case MITIGATED: + tgt.setValue(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.CORRECTED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertDetectedIssueSeverity(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverityEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case HIGH: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity.HIGH); - break; - case MODERATE: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity.MODERATE); - break; - case LOW: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity.LOW); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DetectedIssue.DetectedIssueSeverityEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case HIGH: + tgt.setValue(DetectedIssue.DetectedIssueSeverity.HIGH); + break; + case MODERATE: + tgt.setValue(DetectedIssue.DetectedIssueSeverity.MODERATE); + break; + case LOW: + tgt.setValue(DetectedIssue.DetectedIssueSeverity.LOW); + break; + default: + tgt.setValue(DetectedIssue.DetectedIssueSeverity.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertDetectedIssueSeverity(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverityEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case HIGH: - tgt.setValue(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverity.HIGH); - break; - case MODERATE: - tgt.setValue(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverity.MODERATE); - break; - case LOW: - tgt.setValue(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverity.LOW); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverity.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverityEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case HIGH: + tgt.setValue(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverity.HIGH); + break; + case MODERATE: + tgt.setValue(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverity.MODERATE); + break; + case LOW: + tgt.setValue(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverity.LOW); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverity.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueEvidenceComponent convertDetectedIssueEvidenceComponent(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueEvidenceComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Device40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Device40_50.java index 1e7268d1e0..7b4f6ad2c6 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Device40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Device40_50.java @@ -12,6 +12,9 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Uri40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Device; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -163,50 +166,58 @@ public static org.hl7.fhir.r4.model.Device convertDevice(org.hl7.fhir.r5.model.D } static public org.hl7.fhir.r5.model.Enumeration convertFHIRDeviceStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Device.FHIRDeviceStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Device.FHIRDeviceStatus.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Device.FHIRDeviceStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Device.FHIRDeviceStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.Device.FHIRDeviceStatus.NULL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Device.FHIRDeviceStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Device.FHIRDeviceStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Device.FHIRDeviceStatus.ACTIVE); + break; + case INACTIVE: + tgt.setValue(Device.FHIRDeviceStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(Device.FHIRDeviceStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Device.FHIRDeviceStatus.NULL); + break; + default: + tgt.setValue(Device.FHIRDeviceStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertFHIRDeviceStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Device.FHIRDeviceStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Device.FHIRDeviceStatus.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Device.FHIRDeviceStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Device.FHIRDeviceStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Device.FHIRDeviceStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Device.FHIRDeviceStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4.model.Device.FHIRDeviceStatus.ACTIVE); + break; + case INACTIVE: + tgt.setValue(org.hl7.fhir.r4.model.Device.FHIRDeviceStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.Device.FHIRDeviceStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Device.FHIRDeviceStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Device.DeviceUdiCarrierComponent convertDeviceUdiCarrierComponent(org.hl7.fhir.r4.model.Device.DeviceUdiCarrierComponent src) throws FHIRException { @@ -250,65 +261,73 @@ public static org.hl7.fhir.r4.model.Device.DeviceUdiCarrierComponent convertDevi } static public org.hl7.fhir.r5.model.Enumeration convertUDIEntryType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Device.UDIEntryTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case BARCODE: - tgt.setValue(org.hl7.fhir.r5.model.Device.UDIEntryType.BARCODE); - break; - case RFID: - tgt.setValue(org.hl7.fhir.r5.model.Device.UDIEntryType.RFID); - break; - case MANUAL: - tgt.setValue(org.hl7.fhir.r5.model.Device.UDIEntryType.MANUAL); - break; - case CARD: - tgt.setValue(org.hl7.fhir.r5.model.Device.UDIEntryType.CARD); - break; - case SELFREPORTED: - tgt.setValue(org.hl7.fhir.r5.model.Device.UDIEntryType.SELFREPORTED); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.Device.UDIEntryType.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Device.UDIEntryType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Device.UDIEntryTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case BARCODE: + tgt.setValue(Device.UDIEntryType.BARCODE); + break; + case RFID: + tgt.setValue(Device.UDIEntryType.RFID); + break; + case MANUAL: + tgt.setValue(Device.UDIEntryType.MANUAL); + break; + case CARD: + tgt.setValue(Device.UDIEntryType.CARD); + break; + case SELFREPORTED: + tgt.setValue(Device.UDIEntryType.SELFREPORTED); + break; + case UNKNOWN: + tgt.setValue(Device.UDIEntryType.UNKNOWN); + break; + default: + tgt.setValue(Device.UDIEntryType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertUDIEntryType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Device.UDIEntryTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case BARCODE: - tgt.setValue(org.hl7.fhir.r4.model.Device.UDIEntryType.BARCODE); - break; - case RFID: - tgt.setValue(org.hl7.fhir.r4.model.Device.UDIEntryType.RFID); - break; - case MANUAL: - tgt.setValue(org.hl7.fhir.r4.model.Device.UDIEntryType.MANUAL); - break; - case CARD: - tgt.setValue(org.hl7.fhir.r4.model.Device.UDIEntryType.CARD); - break; - case SELFREPORTED: - tgt.setValue(org.hl7.fhir.r4.model.Device.UDIEntryType.SELFREPORTED); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.Device.UDIEntryType.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Device.UDIEntryType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Device.UDIEntryTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case BARCODE: + tgt.setValue(org.hl7.fhir.r4.model.Device.UDIEntryType.BARCODE); + break; + case RFID: + tgt.setValue(org.hl7.fhir.r4.model.Device.UDIEntryType.RFID); + break; + case MANUAL: + tgt.setValue(org.hl7.fhir.r4.model.Device.UDIEntryType.MANUAL); + break; + case CARD: + tgt.setValue(org.hl7.fhir.r4.model.Device.UDIEntryType.CARD); + break; + case SELFREPORTED: + tgt.setValue(org.hl7.fhir.r4.model.Device.UDIEntryType.SELFREPORTED); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4.model.Device.UDIEntryType.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Device.UDIEntryType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Device.DeviceNameComponent convertDeviceDeviceNameComponent(org.hl7.fhir.r4.model.Device.DeviceDeviceNameComponent src) throws FHIRException { @@ -336,53 +355,61 @@ public static org.hl7.fhir.r4.model.Device.DeviceDeviceNameComponent convertDevi } static public org.hl7.fhir.r5.model.Enumeration convertDeviceNameType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.DeviceNameTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case USERFRIENDLYNAME: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.USERFRIENDLYNAME); - break; - case PATIENTREPORTEDNAME: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.PATIENTREPORTEDNAME); - break; - case MANUFACTURERNAME: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.REGISTEREDNAME); - break; - case MODELNAME: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.USERFRIENDLYNAME); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.NULL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.DeviceNameTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case USERFRIENDLYNAME: + tgt.setValue(Enumerations.DeviceNameType.USERFRIENDLYNAME); + break; + case PATIENTREPORTEDNAME: + tgt.setValue(Enumerations.DeviceNameType.PATIENTREPORTEDNAME); + break; + case MANUFACTURERNAME: + tgt.setValue(Enumerations.DeviceNameType.REGISTEREDNAME); + break; + case MODELNAME: + tgt.setValue(Enumerations.DeviceNameType.USERFRIENDLYNAME); + break; + case OTHER: + tgt.setValue(Enumerations.DeviceNameType.NULL); + break; + default: + tgt.setValue(Enumerations.DeviceNameType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertDeviceNameType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Device.DeviceNameTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case USERFRIENDLYNAME: - tgt.setValue(org.hl7.fhir.r4.model.Device.DeviceNameType.USERFRIENDLYNAME); - break; - case PATIENTREPORTEDNAME: - tgt.setValue(org.hl7.fhir.r4.model.Device.DeviceNameType.PATIENTREPORTEDNAME); - break; - case REGISTEREDNAME: - tgt.setValue(org.hl7.fhir.r4.model.Device.DeviceNameType.MANUFACTURERNAME); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Device.DeviceNameType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Device.DeviceNameTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case USERFRIENDLYNAME: + tgt.setValue(org.hl7.fhir.r4.model.Device.DeviceNameType.USERFRIENDLYNAME); + break; + case PATIENTREPORTEDNAME: + tgt.setValue(org.hl7.fhir.r4.model.Device.DeviceNameType.PATIENTREPORTEDNAME); + break; + case REGISTEREDNAME: + tgt.setValue(org.hl7.fhir.r4.model.Device.DeviceNameType.MANUFACTURERNAME); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Device.DeviceNameType.NULL); + break; + } + } + return tgt; } // public static org.hl7.fhir.r5.model.Device.DeviceSpecializationComponent convertDeviceSpecializationComponent(org.hl7.fhir.r4.model.Device.DeviceSpecializationComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/DeviceDefinition40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/DeviceDefinition40_50.java index 1472659544..dc2c7e3722 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/DeviceDefinition40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/DeviceDefinition40_50.java @@ -11,8 +11,11 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Uri40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.DeviceDefinition; import org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionClassificationComponent; import org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionVersionComponent; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -192,50 +195,58 @@ public static org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionDeviceNameC } static public org.hl7.fhir.r5.model.Enumeration convertDeviceNameType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.DeviceNameTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case USERFRIENDLYNAME: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.USERFRIENDLYNAME); - break; - case PATIENTREPORTEDNAME: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.PATIENTREPORTEDNAME); - break; - case MANUFACTURERNAME: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.REGISTEREDNAME); - break; - case MODELNAME: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.USERFRIENDLYNAME); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.DeviceNameTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case USERFRIENDLYNAME: + tgt.setValue(Enumerations.DeviceNameType.USERFRIENDLYNAME); + break; + case PATIENTREPORTEDNAME: + tgt.setValue(Enumerations.DeviceNameType.PATIENTREPORTEDNAME); + break; + case MANUFACTURERNAME: + tgt.setValue(Enumerations.DeviceNameType.REGISTEREDNAME); + break; + case MODELNAME: + tgt.setValue(Enumerations.DeviceNameType.USERFRIENDLYNAME); + break; + default: + tgt.setValue(Enumerations.DeviceNameType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertDeviceNameType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.DeviceDefinition.DeviceNameTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case USERFRIENDLYNAME: - tgt.setValue(org.hl7.fhir.r4.model.DeviceDefinition.DeviceNameType.USERFRIENDLYNAME); - break; - case PATIENTREPORTEDNAME: - tgt.setValue(org.hl7.fhir.r4.model.DeviceDefinition.DeviceNameType.PATIENTREPORTEDNAME); - break; - case REGISTEREDNAME: - tgt.setValue(org.hl7.fhir.r4.model.DeviceDefinition.DeviceNameType.MANUFACTURERNAME); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.DeviceDefinition.DeviceNameType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new DeviceDefinition.DeviceNameTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case USERFRIENDLYNAME: + tgt.setValue(DeviceDefinition.DeviceNameType.USERFRIENDLYNAME); + break; + case PATIENTREPORTEDNAME: + tgt.setValue(DeviceDefinition.DeviceNameType.PATIENTREPORTEDNAME); + break; + case REGISTEREDNAME: + tgt.setValue(DeviceDefinition.DeviceNameType.MANUFACTURERNAME); + break; + default: + tgt.setValue(DeviceDefinition.DeviceNameType.NULL); + break; + } + } + return tgt; } // // public static org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionSpecializationComponent convertDeviceDefinitionSpecializationComponent(org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionSpecializationComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/DeviceMetric40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/DeviceMetric40_50.java index cb4f06daaf..97d9e0a7e3 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/DeviceMetric40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/DeviceMetric40_50.java @@ -6,6 +6,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Instant40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.DeviceMetric; +import org.hl7.fhir.r5.model.Enumeration; /* Copyright (c) 2011+, HL7, Inc. @@ -95,53 +97,61 @@ public static org.hl7.fhir.r4.model.DeviceMetric convertDeviceMetric(org.hl7.fhi } static public org.hl7.fhir.r5.model.Enumeration convertDeviceMetricOperationalStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ON: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus.ON); - break; - case OFF: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus.OFF); - break; - case STANDBY: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus.STANDBY); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DeviceMetric.DeviceMetricOperationalStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ON: + tgt.setValue(DeviceMetric.DeviceMetricOperationalStatus.ON); + break; + case OFF: + tgt.setValue(DeviceMetric.DeviceMetricOperationalStatus.OFF); + break; + case STANDBY: + tgt.setValue(DeviceMetric.DeviceMetricOperationalStatus.STANDBY); + break; + case ENTEREDINERROR: + tgt.setValue(DeviceMetric.DeviceMetricOperationalStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(DeviceMetric.DeviceMetricOperationalStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertDeviceMetricOperationalStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricOperationalStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ON: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricOperationalStatus.ON); - break; - case OFF: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricOperationalStatus.OFF); - break; - case STANDBY: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricOperationalStatus.STANDBY); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricOperationalStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricOperationalStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricOperationalStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ON: + tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricOperationalStatus.ON); + break; + case OFF: + tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricOperationalStatus.OFF); + break; + case STANDBY: + tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricOperationalStatus.STANDBY); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricOperationalStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricOperationalStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.CodeType convertDeviceMetricColor(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { @@ -191,53 +201,61 @@ static public org.hl7.fhir.r4.model.Enumeration convertDeviceMetricCategory(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategoryEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case MEASUREMENT: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory.MEASUREMENT); - break; - case SETTING: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory.SETTING); - break; - case CALCULATION: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory.CALCULATION); - break; - case UNSPECIFIED: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory.UNSPECIFIED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DeviceMetric.DeviceMetricCategoryEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MEASUREMENT: + tgt.setValue(DeviceMetric.DeviceMetricCategory.MEASUREMENT); + break; + case SETTING: + tgt.setValue(DeviceMetric.DeviceMetricCategory.SETTING); + break; + case CALCULATION: + tgt.setValue(DeviceMetric.DeviceMetricCategory.CALCULATION); + break; + case UNSPECIFIED: + tgt.setValue(DeviceMetric.DeviceMetricCategory.UNSPECIFIED); + break; + default: + tgt.setValue(DeviceMetric.DeviceMetricCategory.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertDeviceMetricCategory(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCategoryEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case MEASUREMENT: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCategory.MEASUREMENT); - break; - case SETTING: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCategory.SETTING); - break; - case CALCULATION: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCategory.CALCULATION); - break; - case UNSPECIFIED: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCategory.UNSPECIFIED); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCategory.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCategoryEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MEASUREMENT: + tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCategory.MEASUREMENT); + break; + case SETTING: + tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCategory.SETTING); + break; + case CALCULATION: + tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCategory.CALCULATION); + break; + case UNSPECIFIED: + tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCategory.UNSPECIFIED); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCategory.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationComponent convertDeviceMetricCalibrationComponent(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationComponent src) throws FHIRException { @@ -269,102 +287,118 @@ public static org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationComponen } static public org.hl7.fhir.r5.model.Enumeration convertDeviceMetricCalibrationType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case UNSPECIFIED: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType.UNSPECIFIED); - break; - case OFFSET: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType.OFFSET); - break; - case GAIN: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType.GAIN); - break; - case TWOPOINT: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType.TWOPOINT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DeviceMetric.DeviceMetricCalibrationTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case UNSPECIFIED: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationType.UNSPECIFIED); + break; + case OFFSET: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationType.OFFSET); + break; + case GAIN: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationType.GAIN); + break; + case TWOPOINT: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationType.TWOPOINT); + break; + default: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertDeviceMetricCalibrationType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case UNSPECIFIED: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationType.UNSPECIFIED); - break; - case OFFSET: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationType.OFFSET); - break; - case GAIN: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationType.GAIN); - break; - case TWOPOINT: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationType.TWOPOINT); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case UNSPECIFIED: + tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationType.UNSPECIFIED); + break; + case OFFSET: + tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationType.OFFSET); + break; + case GAIN: + tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationType.GAIN); + break; + case TWOPOINT: + tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationType.TWOPOINT); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertDeviceMetricCalibrationState(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationStateEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case NOTCALIBRATED: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState.NOTCALIBRATED); - break; - case CALIBRATIONREQUIRED: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATIONREQUIRED); - break; - case CALIBRATED: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATED); - break; - case UNSPECIFIED: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState.UNSPECIFIED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DeviceMetric.DeviceMetricCalibrationStateEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTCALIBRATED: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationState.NOTCALIBRATED); + break; + case CALIBRATIONREQUIRED: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationState.CALIBRATIONREQUIRED); + break; + case CALIBRATED: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationState.CALIBRATED); + break; + case UNSPECIFIED: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationState.UNSPECIFIED); + break; + default: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationState.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertDeviceMetricCalibrationState(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationStateEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case NOTCALIBRATED: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationState.NOTCALIBRATED); - break; - case CALIBRATIONREQUIRED: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATIONREQUIRED); - break; - case CALIBRATED: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATED); - break; - case UNSPECIFIED: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationState.UNSPECIFIED); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationState.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationStateEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTCALIBRATED: + tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationState.NOTCALIBRATED); + break; + case CALIBRATIONREQUIRED: + tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATIONREQUIRED); + break; + case CALIBRATED: + tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATED); + break; + case UNSPECIFIED: + tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationState.UNSPECIFIED); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationState.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/DeviceRequest40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/DeviceRequest40_50.java index 234e4cacc1..f4a84be812 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/DeviceRequest40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/DeviceRequest40_50.java @@ -9,7 +9,10 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Uri40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.DeviceRequest; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -156,201 +159,225 @@ public static org.hl7.fhir.r4.model.DeviceRequest convertDeviceRequest(org.hl7.f } static public org.hl7.fhir.r5.model.Enumeration convertDeviceRequestStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ONHOLD); - break; - case REVOKED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.REVOKED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.RequestStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(Enumerations.RequestStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(Enumerations.RequestStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(Enumerations.RequestStatus.ONHOLD); + break; + case REVOKED: + tgt.setValue(Enumerations.RequestStatus.REVOKED); + break; + case COMPLETED: + tgt.setValue(Enumerations.RequestStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.RequestStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Enumerations.RequestStatus.UNKNOWN); + break; + default: + tgt.setValue(Enumerations.RequestStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertDeviceRequestStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestStatus.ONHOLD); - break; - case REVOKED: - tgt.setValue(org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestStatus.REVOKED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new DeviceRequest.DeviceRequestStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(DeviceRequest.DeviceRequestStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(DeviceRequest.DeviceRequestStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(DeviceRequest.DeviceRequestStatus.ONHOLD); + break; + case REVOKED: + tgt.setValue(DeviceRequest.DeviceRequestStatus.REVOKED); + break; + case COMPLETED: + tgt.setValue(DeviceRequest.DeviceRequestStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(DeviceRequest.DeviceRequestStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(DeviceRequest.DeviceRequestStatus.UNKNOWN); + break; + default: + tgt.setValue(DeviceRequest.DeviceRequestStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertRequestIntent(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestIntentEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.PROPOSAL); - break; - case PLAN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.PLAN); - break; - case DIRECTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.DIRECTIVE); - break; - case ORDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORDER); - break; - case ORIGINALORDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORIGINALORDER); - break; - case REFLEXORDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.REFLEXORDER); - break; - case FILLERORDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.FILLERORDER); - break; - case INSTANCEORDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.INSTANCEORDER); - break; - case OPTION: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.OPTION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.RequestIntentEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSAL: + tgt.setValue(Enumerations.RequestIntent.PROPOSAL); + break; + case PLAN: + tgt.setValue(Enumerations.RequestIntent.PLAN); + break; + case DIRECTIVE: + tgt.setValue(Enumerations.RequestIntent.DIRECTIVE); + break; + case ORDER: + tgt.setValue(Enumerations.RequestIntent.ORDER); + break; + case ORIGINALORDER: + tgt.setValue(Enumerations.RequestIntent.ORIGINALORDER); + break; + case REFLEXORDER: + tgt.setValue(Enumerations.RequestIntent.REFLEXORDER); + break; + case FILLERORDER: + tgt.setValue(Enumerations.RequestIntent.FILLERORDER); + break; + case INSTANCEORDER: + tgt.setValue(Enumerations.RequestIntent.INSTANCEORDER); + break; + case OPTION: + tgt.setValue(Enumerations.RequestIntent.OPTION); + break; + default: + tgt.setValue(Enumerations.RequestIntent.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertRequestIntent(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.DeviceRequest.RequestIntentEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSAL: - tgt.setValue(org.hl7.fhir.r4.model.DeviceRequest.RequestIntent.PROPOSAL); - break; - case PLAN: - tgt.setValue(org.hl7.fhir.r4.model.DeviceRequest.RequestIntent.PLAN); - break; - case DIRECTIVE: - tgt.setValue(org.hl7.fhir.r4.model.DeviceRequest.RequestIntent.DIRECTIVE); - break; - case ORDER: - tgt.setValue(org.hl7.fhir.r4.model.DeviceRequest.RequestIntent.ORDER); - break; - case ORIGINALORDER: - tgt.setValue(org.hl7.fhir.r4.model.DeviceRequest.RequestIntent.ORIGINALORDER); - break; - case REFLEXORDER: - tgt.setValue(org.hl7.fhir.r4.model.DeviceRequest.RequestIntent.REFLEXORDER); - break; - case FILLERORDER: - tgt.setValue(org.hl7.fhir.r4.model.DeviceRequest.RequestIntent.FILLERORDER); - break; - case INSTANCEORDER: - tgt.setValue(org.hl7.fhir.r4.model.DeviceRequest.RequestIntent.INSTANCEORDER); - break; - case OPTION: - tgt.setValue(org.hl7.fhir.r4.model.DeviceRequest.RequestIntent.OPTION); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.DeviceRequest.RequestIntent.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new DeviceRequest.RequestIntentEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSAL: + tgt.setValue(DeviceRequest.RequestIntent.PROPOSAL); + break; + case PLAN: + tgt.setValue(DeviceRequest.RequestIntent.PLAN); + break; + case DIRECTIVE: + tgt.setValue(DeviceRequest.RequestIntent.DIRECTIVE); + break; + case ORDER: + tgt.setValue(DeviceRequest.RequestIntent.ORDER); + break; + case ORIGINALORDER: + tgt.setValue(DeviceRequest.RequestIntent.ORIGINALORDER); + break; + case REFLEXORDER: + tgt.setValue(DeviceRequest.RequestIntent.REFLEXORDER); + break; + case FILLERORDER: + tgt.setValue(DeviceRequest.RequestIntent.FILLERORDER); + break; + case INSTANCEORDER: + tgt.setValue(DeviceRequest.RequestIntent.INSTANCEORDER); + break; + case OPTION: + tgt.setValue(DeviceRequest.RequestIntent.OPTION); + break; + default: + tgt.setValue(DeviceRequest.RequestIntent.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertRequestPriority(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestPriorityEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP); - break; - case STAT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.RequestPriorityEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(Enumerations.RequestPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(Enumerations.RequestPriority.URGENT); + break; + case ASAP: + tgt.setValue(Enumerations.RequestPriority.ASAP); + break; + case STAT: + tgt.setValue(Enumerations.RequestPriority.STAT); + break; + default: + tgt.setValue(Enumerations.RequestPriority.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertRequestPriority(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.DeviceRequest.RequestPriorityEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.r4.model.DeviceRequest.RequestPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.r4.model.DeviceRequest.RequestPriority.URGENT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.r4.model.DeviceRequest.RequestPriority.ASAP); - break; - case STAT: - tgt.setValue(org.hl7.fhir.r4.model.DeviceRequest.RequestPriority.STAT); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.DeviceRequest.RequestPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new DeviceRequest.RequestPriorityEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(DeviceRequest.RequestPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(DeviceRequest.RequestPriority.URGENT); + break; + case ASAP: + tgt.setValue(DeviceRequest.RequestPriority.ASAP); + break; + case STAT: + tgt.setValue(DeviceRequest.RequestPriority.STAT); + break; + default: + tgt.setValue(DeviceRequest.RequestPriority.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.DeviceRequest.DeviceRequestParameterComponent convertDeviceRequestParameterComponent(org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestParameterComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/DeviceUseStatement40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/DeviceUseStatement40_50.java index b6267b460a..89e19a15e6 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/DeviceUseStatement40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/DeviceUseStatement40_50.java @@ -7,7 +7,10 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.DateTime40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.DeviceUseStatement; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.DeviceUsage; +import org.hl7.fhir.r5.model.Enumeration; /* Copyright (c) 2011+, HL7, Inc. @@ -107,64 +110,72 @@ public static org.hl7.fhir.r4.model.DeviceUseStatement convertDeviceUseStatement } static public org.hl7.fhir.r5.model.Enumeration convertDeviceUseStatementStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DeviceUsage.DeviceUsageStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.DeviceUsage.DeviceUsageStatus.ACTIVE); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.DeviceUsage.DeviceUsageStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.DeviceUsage.DeviceUsageStatus.ENTEREDINERROR); - break; - case INTENDED: - tgt.setValue(org.hl7.fhir.r5.model.DeviceUsage.DeviceUsageStatus.INTENDED); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r5.model.DeviceUsage.DeviceUsageStatus.STOPPED); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r5.model.DeviceUsage.DeviceUsageStatus.ONHOLD); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.DeviceUsage.DeviceUsageStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DeviceUsage.DeviceUsageStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(DeviceUsage.DeviceUsageStatus.ACTIVE); + break; + case COMPLETED: + tgt.setValue(DeviceUsage.DeviceUsageStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(DeviceUsage.DeviceUsageStatus.ENTEREDINERROR); + break; + case INTENDED: + tgt.setValue(DeviceUsage.DeviceUsageStatus.INTENDED); + break; + case STOPPED: + tgt.setValue(DeviceUsage.DeviceUsageStatus.STOPPED); + break; + case ONHOLD: + tgt.setValue(DeviceUsage.DeviceUsageStatus.ONHOLD); + break; + default: + tgt.setValue(DeviceUsage.DeviceUsageStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertDeviceUseStatementStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatus.ACTIVE); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatus.ENTEREDINERROR); - break; - case INTENDED: - tgt.setValue(org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatus.INTENDED); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatus.STOPPED); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatus.ONHOLD); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new DeviceUseStatement.DeviceUseStatementStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(DeviceUseStatement.DeviceUseStatementStatus.ACTIVE); + break; + case COMPLETED: + tgt.setValue(DeviceUseStatement.DeviceUseStatementStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(DeviceUseStatement.DeviceUseStatementStatus.ENTEREDINERROR); + break; + case INTENDED: + tgt.setValue(DeviceUseStatement.DeviceUseStatementStatus.INTENDED); + break; + case STOPPED: + tgt.setValue(DeviceUseStatement.DeviceUseStatementStatus.STOPPED); + break; + case ONHOLD: + tgt.setValue(DeviceUseStatement.DeviceUseStatementStatus.ONHOLD); + break; + default: + tgt.setValue(DeviceUseStatement.DeviceUseStatementStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/DiagnosticReport40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/DiagnosticReport40_50.java index edd8f2c473..e98fe73c0c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/DiagnosticReport40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/DiagnosticReport40_50.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.DiagnosticReport; +import org.hl7.fhir.r5.model.Enumeration; /* Copyright (c) 2011+, HL7, Inc. @@ -117,89 +119,97 @@ public static org.hl7.fhir.r4.model.DiagnosticReport convertDiagnosticReport(org } static public org.hl7.fhir.r5.model.Enumeration convertDiagnosticReportStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.REGISTERED); - break; - case PARTIAL: - tgt.setValue(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.PARTIAL); - break; - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.AMENDED); - break; - case CORRECTED: - tgt.setValue(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.CORRECTED); - break; - case APPENDED: - tgt.setValue(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.APPENDED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DiagnosticReport.DiagnosticReportStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.REGISTERED); + break; + case PARTIAL: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.PARTIAL); + break; + case PRELIMINARY: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.FINAL); + break; + case AMENDED: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.AMENDED); + break; + case CORRECTED: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.CORRECTED); + break; + case APPENDED: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.APPENDED); + break; + case CANCELLED: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.UNKNOWN); + break; + default: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertDiagnosticReportStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.REGISTERED); - break; - case PARTIAL: - tgt.setValue(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.PARTIAL); - break; - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.AMENDED); - break; - case CORRECTED: - tgt.setValue(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.CORRECTED); - break; - case APPENDED: - tgt.setValue(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.APPENDED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.REGISTERED); + break; + case PARTIAL: + tgt.setValue(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.PARTIAL); + break; + case PRELIMINARY: + tgt.setValue(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.FINAL); + break; + case AMENDED: + tgt.setValue(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.AMENDED); + break; + case CORRECTED: + tgt.setValue(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.CORRECTED); + break; + case APPENDED: + tgt.setValue(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.APPENDED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportMediaComponent convertDiagnosticReportMediaComponent(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportMediaComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/DocumentReference40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/DocumentReference40_50.java index 5076b01785..aa51f1b534 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/DocumentReference40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/DocumentReference40_50.java @@ -10,8 +10,12 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.DocumentReference; +import org.hl7.fhir.r5.model.CodeableConcept; import org.hl7.fhir.r5.model.CodeableReference; import org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceAttesterComponent; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -125,53 +129,61 @@ public static org.hl7.fhir.r4.model.DocumentReference convertDocumentReference(o } static public org.hl7.fhir.r5.model.Enumeration convertReferredDocumentStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.CompositionStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.AMENDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.CompositionStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRELIMINARY: + tgt.setValue(Enumerations.CompositionStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(Enumerations.CompositionStatus.FINAL); + break; + case AMENDED: + tgt.setValue(Enumerations.CompositionStatus.AMENDED); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.CompositionStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Enumerations.CompositionStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertReferredDocumentStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus.AMENDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new DocumentReference.ReferredDocumentStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRELIMINARY: + tgt.setValue(DocumentReference.ReferredDocumentStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(DocumentReference.ReferredDocumentStatus.FINAL); + break; + case AMENDED: + tgt.setValue(DocumentReference.ReferredDocumentStatus.AMENDED); + break; + case ENTEREDINERROR: + tgt.setValue(DocumentReference.ReferredDocumentStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(DocumentReference.ReferredDocumentStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceRelatesToComponent convertDocumentReferenceRelatesToComponent(org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceRelatesToComponent src) throws FHIRException { @@ -199,27 +211,31 @@ public static org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceRelatesTo } static public org.hl7.fhir.r5.model.CodeableConcept convertDocumentRelationshipType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.CodeableConcept tgt = new org.hl7.fhir.r5.model.CodeableConcept(); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case REPLACES: - tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("replaces"); - break; - case TRANSFORMS: - tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("transforms"); - break; - case SIGNS: - tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("signs"); - break; - case APPENDS: - tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("appends"); - break; - default: - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + CodeableConcept tgt = new CodeableConcept(); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + // Add nothing + } else { + switch (src.getValue()) { + case REPLACES: + tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("replaces"); + break; + case TRANSFORMS: + tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("transforms"); + break; + case SIGNS: + tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("signs"); + break; + case APPENDS: + tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("appends"); + break; + default: + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertDocumentRelationshipType(org.hl7.fhir.r5.model.CodeableConcept src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Encounter40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Encounter40_50.java index 498d48e949..1891bc3733 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Encounter40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Encounter40_50.java @@ -8,8 +8,11 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.general40_50.Period40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Encounter; import org.hl7.fhir.r5.model.CodeableReference; import org.hl7.fhir.r5.model.Encounter.ReasonComponent; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -151,74 +154,82 @@ public static org.hl7.fhir.r4.model.Encounter convertEncounter(org.hl7.fhir.r5.m } static public org.hl7.fhir.r5.model.Enumeration convertEncounterStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.EncounterStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EncounterStatus.PLANNED); - break; - case ARRIVED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EncounterStatus.INPROGRESS); - break; - case TRIAGED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EncounterStatus.INPROGRESS); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EncounterStatus.INPROGRESS); - break; - case ONLEAVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EncounterStatus.INPROGRESS); - break; - case FINISHED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EncounterStatus.COMPLETED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EncounterStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EncounterStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EncounterStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EncounterStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.EncounterStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(Enumerations.EncounterStatus.PLANNED); + break; + case ARRIVED: + tgt.setValue(Enumerations.EncounterStatus.INPROGRESS); + break; + case TRIAGED: + tgt.setValue(Enumerations.EncounterStatus.INPROGRESS); + break; + case INPROGRESS: + tgt.setValue(Enumerations.EncounterStatus.INPROGRESS); + break; + case ONLEAVE: + tgt.setValue(Enumerations.EncounterStatus.INPROGRESS); + break; + case FINISHED: + tgt.setValue(Enumerations.EncounterStatus.COMPLETED); + break; + case CANCELLED: + tgt.setValue(Enumerations.EncounterStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.EncounterStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Enumerations.EncounterStatus.UNKNOWN); + break; + default: + tgt.setValue(Enumerations.EncounterStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertEncounterStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Encounter.EncounterStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterStatus.PLANNED); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterStatus.INPROGRESS); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterStatus.CANCELLED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterStatus.FINISHED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new Encounter.EncounterStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(Encounter.EncounterStatus.PLANNED); + break; + case INPROGRESS: + tgt.setValue(Encounter.EncounterStatus.INPROGRESS); + break; + case CANCELLED: + tgt.setValue(Encounter.EncounterStatus.CANCELLED); + break; + case COMPLETED: + tgt.setValue(Encounter.EncounterStatus.FINISHED); + break; + case ENTEREDINERROR: + tgt.setValue(Encounter.EncounterStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Encounter.EncounterStatus.UNKNOWN); + break; + default: + tgt.setValue(Encounter.EncounterStatus.NULL); + break; + } + } + return tgt; } // public static org.hl7.fhir.r5.model.Encounter.StatusHistoryComponent convertStatusHistoryComponent(org.hl7.fhir.r4.model.Encounter.StatusHistoryComponent src) throws FHIRException { @@ -410,52 +421,60 @@ public static org.hl7.fhir.r4.model.Encounter.EncounterLocationComponent convert } static public org.hl7.fhir.r5.model.Enumeration convertEncounterLocationStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Encounter.EncounterLocationStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.PLANNED); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.ACTIVE); - break; - case RESERVED: - tgt.setValue(org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.RESERVED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.COMPLETED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new org.hl7.fhir.r5.model.Encounter.EncounterLocationStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.PLANNED); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.ACTIVE); + break; + case RESERVED: + tgt.setValue(org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.RESERVED); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.COMPLETED); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertEncounterLocationStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Encounter.EncounterLocationStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus.PLANNED); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus.ACTIVE); - break; - case RESERVED: - tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus.RESERVED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus.COMPLETED); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new Encounter.EncounterLocationStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(Encounter.EncounterLocationStatus.PLANNED); + break; + case ACTIVE: + tgt.setValue(Encounter.EncounterLocationStatus.ACTIVE); + break; + case RESERVED: + tgt.setValue(Encounter.EncounterLocationStatus.RESERVED); + break; + case COMPLETED: + tgt.setValue(Encounter.EncounterLocationStatus.COMPLETED); + break; + default: + tgt.setValue(Encounter.EncounterLocationStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Endpoint40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Endpoint40_50.java index 31b603ab10..7824e15714 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Endpoint40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Endpoint40_50.java @@ -11,7 +11,9 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Url40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Endpoint; import org.hl7.fhir.r5.model.Endpoint.EndpointPayloadComponent; +import org.hl7.fhir.r5.model.Enumeration; /* Copyright (c) 2011+, HL7, Inc. @@ -105,58 +107,66 @@ public static org.hl7.fhir.r4.model.Endpoint convertEndpoint(org.hl7.fhir.r5.mod } static public org.hl7.fhir.r5.model.Enumeration convertEndpointStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Endpoint.EndpointStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Endpoint.EndpointStatus.ACTIVE); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.r5.model.Endpoint.EndpointStatus.SUSPENDED); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.r5.model.Endpoint.EndpointStatus.ERROR); - break; - case OFF: - tgt.setValue(org.hl7.fhir.r5.model.Endpoint.EndpointStatus.OFF); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Endpoint.EndpointStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Endpoint.EndpointStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Endpoint.EndpointStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Endpoint.EndpointStatus.ACTIVE); + break; + case SUSPENDED: + tgt.setValue(Endpoint.EndpointStatus.SUSPENDED); + break; + case ERROR: + tgt.setValue(Endpoint.EndpointStatus.ERROR); + break; + case OFF: + tgt.setValue(Endpoint.EndpointStatus.OFF); + break; + case ENTEREDINERROR: + tgt.setValue(Endpoint.EndpointStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Endpoint.EndpointStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertEndpointStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Endpoint.EndpointStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Endpoint.EndpointStatus.ACTIVE); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.r4.model.Endpoint.EndpointStatus.SUSPENDED); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.r4.model.Endpoint.EndpointStatus.ERROR); - break; - case OFF: - tgt.setValue(org.hl7.fhir.r4.model.Endpoint.EndpointStatus.OFF); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Endpoint.EndpointStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Endpoint.EndpointStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Endpoint.EndpointStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4.model.Endpoint.EndpointStatus.ACTIVE); + break; + case SUSPENDED: + tgt.setValue(org.hl7.fhir.r4.model.Endpoint.EndpointStatus.SUSPENDED); + break; + case ERROR: + tgt.setValue(org.hl7.fhir.r4.model.Endpoint.EndpointStatus.ERROR); + break; + case OFF: + tgt.setValue(org.hl7.fhir.r4.model.Endpoint.EndpointStatus.OFF); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.Endpoint.EndpointStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Endpoint.EndpointStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/EnrollmentRequest40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/EnrollmentRequest40_50.java index 6a1083f051..092eb60a2d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/EnrollmentRequest40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/EnrollmentRequest40_50.java @@ -5,6 +5,9 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.DateTime40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.EnrollmentRequest; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -82,52 +85,60 @@ public static org.hl7.fhir.r4.model.EnrollmentRequest convertEnrollmentRequest(o } static public org.hl7.fhir.r5.model.Enumeration convertEnrollmentRequestStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodesEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.CANCELLED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.FinancialResourceStatusCodesEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.ACTIVE); + break; + case CANCELLED: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.CANCELLED); + break; + case DRAFT: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); + break; + default: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertEnrollmentRequestStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.EnrollmentRequest.EnrollmentRequestStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.EnrollmentRequest.EnrollmentRequestStatus.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.EnrollmentRequest.EnrollmentRequestStatus.CANCELLED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r4.model.EnrollmentRequest.EnrollmentRequestStatus.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.EnrollmentRequest.EnrollmentRequestStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.EnrollmentRequest.EnrollmentRequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new EnrollmentRequest.EnrollmentRequestStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(EnrollmentRequest.EnrollmentRequestStatus.ACTIVE); + break; + case CANCELLED: + tgt.setValue(EnrollmentRequest.EnrollmentRequestStatus.CANCELLED); + break; + case DRAFT: + tgt.setValue(EnrollmentRequest.EnrollmentRequestStatus.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(EnrollmentRequest.EnrollmentRequestStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(EnrollmentRequest.EnrollmentRequestStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Enumerations40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Enumerations40_50.java index 84a211e982..f3b9859d32 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Enumerations40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Enumerations40_50.java @@ -3,6 +3,10 @@ import org.hl7.fhir.convertors.context.ConversionContext40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Extension40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.DocumentReference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; +import org.hl7.fhir.r5.model.PaymentReconciliation; /* Copyright (c) 2011+, HL7, Inc. @@ -50,623 +54,687 @@ public static void copyEnumeration(org.hl7.fhir.r5.model.Enumeration src, org } static public org.hl7.fhir.r5.model.Enumeration convertBindingStrength(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.BindingStrengthEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case REQUIRED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.BindingStrength.REQUIRED); - break; - case EXTENSIBLE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.BindingStrength.EXTENSIBLE); - break; - case PREFERRED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.BindingStrength.PREFERRED); - break; - case EXAMPLE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.BindingStrength.EXAMPLE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.BindingStrength.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.BindingStrengthEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REQUIRED: + tgt.setValue(Enumerations.BindingStrength.REQUIRED); + break; + case EXTENSIBLE: + tgt.setValue(Enumerations.BindingStrength.EXTENSIBLE); + break; + case PREFERRED: + tgt.setValue(Enumerations.BindingStrength.PREFERRED); + break; + case EXAMPLE: + tgt.setValue(Enumerations.BindingStrength.EXAMPLE); + break; + default: + tgt.setValue(Enumerations.BindingStrength.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertBindingStrength(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.BindingStrengthEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case REQUIRED: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.BindingStrength.REQUIRED); - break; - case EXTENSIBLE: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.BindingStrength.EXTENSIBLE); - break; - case PREFERRED: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.BindingStrength.PREFERRED); - break; - case EXAMPLE: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.BindingStrength.EXAMPLE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.BindingStrength.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.BindingStrengthEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REQUIRED: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.BindingStrength.REQUIRED); + break; + case EXTENSIBLE: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.BindingStrength.EXTENSIBLE); + break; + case PREFERRED: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.BindingStrength.PREFERRED); + break; + case EXAMPLE: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.BindingStrength.EXAMPLE); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.BindingStrength.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertPublicationStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.PublicationStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.ACTIVE); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.RETIRED); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.PublicationStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(Enumerations.PublicationStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(Enumerations.PublicationStatus.ACTIVE); + break; + case RETIRED: + tgt.setValue(Enumerations.PublicationStatus.RETIRED); + break; + case UNKNOWN: + tgt.setValue(Enumerations.PublicationStatus.UNKNOWN); + break; + default: + tgt.setValue(Enumerations.PublicationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertPublicationStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.PublicationStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.ACTIVE); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.RETIRED); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.PublicationStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.ACTIVE); + break; + case RETIRED: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.RETIRED); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertFHIRVersion(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.FHIRVersionEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case _0_01: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_01); - break; - case _0_05: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_05); - break; - case _0_06: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_06); - break; - case _0_11: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_11); - break; - case _0_0_80: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_0_80); - break; - case _0_0_81: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_0_81); - break; - case _0_0_82: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_0_82); - break; - case _0_4_0: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_4_0); - break; - case _0_5_0: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_5_0); - break; - case _1_0_0: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_0_0); - break; - case _1_0_1: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_0_1); - break; - case _1_0_2: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_0_2); - break; - case _1_1_0: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_1_0); - break; - case _1_4_0: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_4_0); - break; - case _1_6_0: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_6_0); - break; - case _1_8_0: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_8_0); - break; - case _3_0_0: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._3_0_0); - break; - case _3_0_1: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._3_0_1); - break; - case _3_0_2: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._3_0_2); - break; - case _3_3_0: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._3_3_0); - break; - case _3_5_0: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._3_5_0); - break; - case _4_0_0: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._4_0_0); - break; - case _4_0_1: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._4_0_1); - break; - case _4_1_0: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._4_1_0); - break; - case _4_3_0: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._4_3_0); - break; - case _5_0_0: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._5_0_0); - break; - case _5_0_0SNAPSHOT1: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._5_0_0SNAPSHOT1); - break; - case _5_0_0SNAPSHOT2: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._5_0_0SNAPSHOT2); - break; - case _5_0_0BALLOT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._5_0_0BALLOT); - break; - case _5_0_0SNAPSHOT3: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._5_0_0SNAPSHOT3); - break; - case _5_0_0DRAFTFINAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._5_0_0DRAFTFINAL); - break; - case _6_0_0: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._6_0_0); - break; - case _6_0_0_BALLOT1: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._6_0_0_BALLOT1); - break; - case _6_0_0_BALLOT2: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._6_0_0_BALLOT2); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.FHIRVersionEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case _0_01: + tgt.setValue(Enumerations.FHIRVersion._0_01); + break; + case _0_05: + tgt.setValue(Enumerations.FHIRVersion._0_05); + break; + case _0_06: + tgt.setValue(Enumerations.FHIRVersion._0_06); + break; + case _0_11: + tgt.setValue(Enumerations.FHIRVersion._0_11); + break; + case _0_0_80: + tgt.setValue(Enumerations.FHIRVersion._0_0_80); + break; + case _0_0_81: + tgt.setValue(Enumerations.FHIRVersion._0_0_81); + break; + case _0_0_82: + tgt.setValue(Enumerations.FHIRVersion._0_0_82); + break; + case _0_4_0: + tgt.setValue(Enumerations.FHIRVersion._0_4_0); + break; + case _0_5_0: + tgt.setValue(Enumerations.FHIRVersion._0_5_0); + break; + case _1_0_0: + tgt.setValue(Enumerations.FHIRVersion._1_0_0); + break; + case _1_0_1: + tgt.setValue(Enumerations.FHIRVersion._1_0_1); + break; + case _1_0_2: + tgt.setValue(Enumerations.FHIRVersion._1_0_2); + break; + case _1_1_0: + tgt.setValue(Enumerations.FHIRVersion._1_1_0); + break; + case _1_4_0: + tgt.setValue(Enumerations.FHIRVersion._1_4_0); + break; + case _1_6_0: + tgt.setValue(Enumerations.FHIRVersion._1_6_0); + break; + case _1_8_0: + tgt.setValue(Enumerations.FHIRVersion._1_8_0); + break; + case _3_0_0: + tgt.setValue(Enumerations.FHIRVersion._3_0_0); + break; + case _3_0_1: + tgt.setValue(Enumerations.FHIRVersion._3_0_1); + break; + case _3_0_2: + tgt.setValue(Enumerations.FHIRVersion._3_0_2); + break; + case _3_3_0: + tgt.setValue(Enumerations.FHIRVersion._3_3_0); + break; + case _3_5_0: + tgt.setValue(Enumerations.FHIRVersion._3_5_0); + break; + case _4_0_0: + tgt.setValue(Enumerations.FHIRVersion._4_0_0); + break; + case _4_0_1: + tgt.setValue(Enumerations.FHIRVersion._4_0_1); + break; + case _4_1_0: + tgt.setValue(Enumerations.FHIRVersion._4_1_0); + break; + case _4_3_0: + tgt.setValue(Enumerations.FHIRVersion._4_3_0); + break; + case _5_0_0: + tgt.setValue(Enumerations.FHIRVersion._5_0_0); + break; + case _5_0_0SNAPSHOT1: + tgt.setValue(Enumerations.FHIRVersion._5_0_0SNAPSHOT1); + break; + case _5_0_0SNAPSHOT2: + tgt.setValue(Enumerations.FHIRVersion._5_0_0SNAPSHOT2); + break; + case _5_0_0BALLOT: + tgt.setValue(Enumerations.FHIRVersion._5_0_0BALLOT); + break; + case _5_0_0SNAPSHOT3: + tgt.setValue(Enumerations.FHIRVersion._5_0_0SNAPSHOT3); + break; + case _5_0_0DRAFTFINAL: + tgt.setValue(Enumerations.FHIRVersion._5_0_0DRAFTFINAL); + break; + case _6_0_0: + tgt.setValue(Enumerations.FHIRVersion._6_0_0); + break; + case _6_0_0_BALLOT1: + tgt.setValue(Enumerations.FHIRVersion._6_0_0_BALLOT1); + break; + case _6_0_0_BALLOT2: + tgt.setValue(Enumerations.FHIRVersion._6_0_0_BALLOT2); + break; + default: + tgt.setValue(Enumerations.FHIRVersion.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertFHIRVersion(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.FHIRVersionEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case _0_01: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_01); - break; - case _0_05: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_05); - break; - case _0_06: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_06); - break; - case _0_11: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_11); - break; - case _0_0_80: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_0_80); - break; - case _0_0_81: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_0_81); - break; - case _0_0_82: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_0_82); - break; - case _0_4_0: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_4_0); - break; - case _0_5_0: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_5_0); - break; - case _1_0_0: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_0_0); - break; - case _1_0_1: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_0_1); - break; - case _1_0_2: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_0_2); - break; - case _1_1_0: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_1_0); - break; - case _1_4_0: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_4_0); - break; - case _1_6_0: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_6_0); - break; - case _1_8_0: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_8_0); - break; - case _3_0_0: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._3_0_0); - break; - case _3_0_1: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._3_0_1); - break; - case _3_0_2: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._3_0_2); - break; - case _3_3_0: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._3_3_0); - break; - case _3_5_0: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._3_5_0); - break; - case _4_0_0: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._4_0_0); - break; - case _4_0_1: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._4_0_1); - break; - case _4_1_0: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._4_1_0); - break; - case _4_3_0: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._4_3_0); - break; - case _5_0_0: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._5_0_0); - break; - case _5_0_0SNAPSHOT1: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._5_0_0SNAPSHOT1); - break; - case _5_0_0SNAPSHOT2: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._5_0_0SNAPSHOT2); - break; - case _5_0_0BALLOT: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._5_0_0BALLOT); - break; - case _5_0_0SNAPSHOT3: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._5_0_0SNAPSHOT3); - break; - case _5_0_0DRAFTFINAL: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._5_0_0DRAFTFINAL); - break; - case _6_0_0: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._6_0_0); - break; - case _6_0_0_BALLOT1: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._6_0_0_BALLOT1); - break; - case _6_0_0_BALLOT2: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._6_0_0_BALLOT2); - break; - - default: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.FHIRVersionEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case _0_01: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_01); + break; + case _0_05: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_05); + break; + case _0_06: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_06); + break; + case _0_11: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_11); + break; + case _0_0_80: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_0_80); + break; + case _0_0_81: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_0_81); + break; + case _0_0_82: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_0_82); + break; + case _0_4_0: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_4_0); + break; + case _0_5_0: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_5_0); + break; + case _1_0_0: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_0_0); + break; + case _1_0_1: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_0_1); + break; + case _1_0_2: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_0_2); + break; + case _1_1_0: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_1_0); + break; + case _1_4_0: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_4_0); + break; + case _1_6_0: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_6_0); + break; + case _1_8_0: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_8_0); + break; + case _3_0_0: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._3_0_0); + break; + case _3_0_1: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._3_0_1); + break; + case _3_0_2: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._3_0_2); + break; + case _3_3_0: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._3_3_0); + break; + case _3_5_0: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._3_5_0); + break; + case _4_0_0: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._4_0_0); + break; + case _4_0_1: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._4_0_1); + break; + case _4_1_0: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._4_1_0); + break; + case _4_3_0: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._4_3_0); + break; + case _5_0_0: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._5_0_0); + break; + case _5_0_0SNAPSHOT1: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._5_0_0SNAPSHOT1); + break; + case _5_0_0SNAPSHOT2: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._5_0_0SNAPSHOT2); + break; + case _5_0_0BALLOT: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._5_0_0BALLOT); + break; + case _5_0_0SNAPSHOT3: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._5_0_0SNAPSHOT3); + break; + case _5_0_0DRAFTFINAL: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._5_0_0DRAFTFINAL); + break; + case _6_0_0: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._6_0_0); + break; + case _6_0_0_BALLOT1: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._6_0_0_BALLOT1); + break; + case _6_0_0_BALLOT2: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._6_0_0_BALLOT2); + break; + + default: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertSearchParamType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.SearchParamTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case NUMBER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.NUMBER); - break; - case DATE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.DATE); - break; - case STRING: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.STRING); - break; - case TOKEN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.TOKEN); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.REFERENCE); - break; - case COMPOSITE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.COMPOSITE); - break; - case QUANTITY: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.QUANTITY); - break; - case URI: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.URI); - break; - case SPECIAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.SPECIAL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.SearchParamTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NUMBER: + tgt.setValue(Enumerations.SearchParamType.NUMBER); + break; + case DATE: + tgt.setValue(Enumerations.SearchParamType.DATE); + break; + case STRING: + tgt.setValue(Enumerations.SearchParamType.STRING); + break; + case TOKEN: + tgt.setValue(Enumerations.SearchParamType.TOKEN); + break; + case REFERENCE: + tgt.setValue(Enumerations.SearchParamType.REFERENCE); + break; + case COMPOSITE: + tgt.setValue(Enumerations.SearchParamType.COMPOSITE); + break; + case QUANTITY: + tgt.setValue(Enumerations.SearchParamType.QUANTITY); + break; + case URI: + tgt.setValue(Enumerations.SearchParamType.URI); + break; + case SPECIAL: + tgt.setValue(Enumerations.SearchParamType.SPECIAL); + break; + default: + tgt.setValue(Enumerations.SearchParamType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertSearchParamType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.SearchParamTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case NUMBER: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.NUMBER); - break; - case DATE: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.DATE); - break; - case STRING: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.STRING); - break; - case TOKEN: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.TOKEN); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.REFERENCE); - break; - case COMPOSITE: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.COMPOSITE); - break; - case QUANTITY: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.QUANTITY); - break; - case URI: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.URI); - break; - case SPECIAL: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.SPECIAL); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.SearchParamTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NUMBER: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.NUMBER); + break; + case DATE: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.DATE); + break; + case STRING: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.STRING); + break; + case TOKEN: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.TOKEN); + break; + case REFERENCE: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.REFERENCE); + break; + case COMPOSITE: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.COMPOSITE); + break; + case QUANTITY: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.QUANTITY); + break; + case URI: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.URI); + break; + case SPECIAL: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.SPECIAL); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertNoteType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.PaymentReconciliation.NoteTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case DISPLAY: - tgt.setValue(org.hl7.fhir.r5.model.PaymentReconciliation.NoteType.DISPLAY); - break; - case PRINT: - tgt.setValue(org.hl7.fhir.r5.model.PaymentReconciliation.NoteType.PRINT); - break; - case PRINTOPER: - tgt.setValue(org.hl7.fhir.r5.model.PaymentReconciliation.NoteType.PRINTOPER); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.PaymentReconciliation.NoteType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new PaymentReconciliation.NoteTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DISPLAY: + tgt.setValue(PaymentReconciliation.NoteType.DISPLAY); + break; + case PRINT: + tgt.setValue(PaymentReconciliation.NoteType.PRINT); + break; + case PRINTOPER: + tgt.setValue(PaymentReconciliation.NoteType.PRINTOPER); + break; + default: + tgt.setValue(PaymentReconciliation.NoteType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertNoteType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.NoteTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case DISPLAY: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.NoteType.DISPLAY); - break; - case PRINT: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.NoteType.PRINT); - break; - case PRINTOPER: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.NoteType.PRINTOPER); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.NoteType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.NoteTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DISPLAY: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.NoteType.DISPLAY); + break; + case PRINT: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.NoteType.PRINT); + break; + case PRINTOPER: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.NoteType.PRINTOPER); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.NoteType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertConceptMapRelationship(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationshipEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case RELATEDTO: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.RELATEDTO); - break; - case EQUIVALENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.EQUIVALENT); - break; - case EQUAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.EQUIVALENT); - break; - case WIDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.SOURCEISNARROWERTHANTARGET); - break; - case SUBSUMES: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.SOURCEISNARROWERTHANTARGET); - break; - case NARROWER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.SOURCEISBROADERTHANTARGET); - break; - case SPECIALIZES: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.SOURCEISBROADERTHANTARGET); - break; - case INEXACT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.RELATEDTO); - break; - case UNMATCHED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NULL); - break; - case DISJOINT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NOTRELATEDTO); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ConceptMapRelationshipEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case RELATEDTO: + tgt.setValue(Enumerations.ConceptMapRelationship.RELATEDTO); + break; + case EQUIVALENT: + tgt.setValue(Enumerations.ConceptMapRelationship.EQUIVALENT); + break; + case EQUAL: + tgt.setValue(Enumerations.ConceptMapRelationship.EQUIVALENT); + break; + case WIDER: + tgt.setValue(Enumerations.ConceptMapRelationship.SOURCEISNARROWERTHANTARGET); + break; + case SUBSUMES: + tgt.setValue(Enumerations.ConceptMapRelationship.SOURCEISNARROWERTHANTARGET); + break; + case NARROWER: + tgt.setValue(Enumerations.ConceptMapRelationship.SOURCEISBROADERTHANTARGET); + break; + case SPECIALIZES: + tgt.setValue(Enumerations.ConceptMapRelationship.SOURCEISBROADERTHANTARGET); + break; + case INEXACT: + tgt.setValue(Enumerations.ConceptMapRelationship.RELATEDTO); + break; + case UNMATCHED: + tgt.setValue(Enumerations.ConceptMapRelationship.NULL); + break; + case DISJOINT: + tgt.setValue(Enumerations.ConceptMapRelationship.NOTRELATEDTO); + break; + default: + tgt.setValue(Enumerations.ConceptMapRelationship.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertConceptMapEquivalence(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalenceEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case RELATEDTO: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.RELATEDTO); - break; - case EQUIVALENT: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.EQUIVALENT); - break; - case SOURCEISNARROWERTHANTARGET: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.WIDER); - break; - case SOURCEISBROADERTHANTARGET: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.NARROWER); - break; - case NOTRELATEDTO: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.DISJOINT); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalenceEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case RELATEDTO: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.RELATEDTO); + break; + case EQUIVALENT: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.EQUIVALENT); + break; + case SOURCEISNARROWERTHANTARGET: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.WIDER); + break; + case SOURCEISBROADERTHANTARGET: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.NARROWER); + break; + case NOTRELATEDTO: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.DISJOINT); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertDocumentReferenceStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case CURRENT: - tgt.setValue(org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceStatus.CURRENT); - break; - case SUPERSEDED: - tgt.setValue(org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceStatus.SUPERSEDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DocumentReference.DocumentReferenceStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CURRENT: + tgt.setValue(DocumentReference.DocumentReferenceStatus.CURRENT); + break; + case SUPERSEDED: + tgt.setValue(DocumentReference.DocumentReferenceStatus.SUPERSEDED); + break; + case ENTEREDINERROR: + tgt.setValue(DocumentReference.DocumentReferenceStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(DocumentReference.DocumentReferenceStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertDocumentReferenceStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case CURRENT: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.CURRENT); - break; - case SUPERSEDED: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.SUPERSEDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CURRENT: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.CURRENT); + break; + case SUPERSEDED: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.SUPERSEDED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertAdministrativeGender(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.AdministrativeGenderEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case MALE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.MALE); - break; - case FEMALE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.FEMALE); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.OTHER); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.AdministrativeGenderEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MALE: + tgt.setValue(Enumerations.AdministrativeGender.MALE); + break; + case FEMALE: + tgt.setValue(Enumerations.AdministrativeGender.FEMALE); + break; + case OTHER: + tgt.setValue(Enumerations.AdministrativeGender.OTHER); + break; + case UNKNOWN: + tgt.setValue(Enumerations.AdministrativeGender.UNKNOWN); + break; + default: + tgt.setValue(Enumerations.AdministrativeGender.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertAdministrativeGender(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.AdministrativeGenderEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case MALE: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.MALE); - break; - case FEMALE: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.FEMALE); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.OTHER); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.AdministrativeGenderEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MALE: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.MALE); + break; + case FEMALE: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.FEMALE); + break; + case OTHER: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.OTHER); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/EpisodeOfCare40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/EpisodeOfCare40_50.java index 2ad2c66768..b900083656 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/EpisodeOfCare40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/EpisodeOfCare40_50.java @@ -6,6 +6,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.general40_50.Period40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.EpisodeOfCare; /* Copyright (c) 2011+, HL7, Inc. @@ -99,71 +101,79 @@ public static org.hl7.fhir.r4.model.EpisodeOfCare convertEpisodeOfCare(org.hl7.f } static public org.hl7.fhir.r5.model.Enumeration convertEpisodeOfCareStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.PLANNED); - break; - case WAITLIST: - tgt.setValue(org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.WAITLIST); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.ONHOLD); - break; - case FINISHED: - tgt.setValue(org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.FINISHED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new EpisodeOfCare.EpisodeOfCareStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.PLANNED); + break; + case WAITLIST: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.WAITLIST); + break; + case ACTIVE: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.ONHOLD); + break; + case FINISHED: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.FINISHED); + break; + case CANCELLED: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertEpisodeOfCareStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.PLANNED); - break; - case WAITLIST: - tgt.setValue(org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.WAITLIST); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.ONHOLD); - break; - case FINISHED: - tgt.setValue(org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.FINISHED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.PLANNED); + break; + case WAITLIST: + tgt.setValue(org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.WAITLIST); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.ONHOLD); + break; + case FINISHED: + tgt.setValue(org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.FINISHED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent convertEpisodeOfCareStatusHistoryComponent(org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ExampleScenario40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ExampleScenario40_50.java index 0f8cb055ea..c96c3cbf0d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ExampleScenario40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ExampleScenario40_50.java @@ -9,8 +9,11 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.*; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.ExampleScenario; import org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType; import org.hl7.fhir.r4.model.StringType; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -197,41 +200,49 @@ public static org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioActorComponen } static public org.hl7.fhir.r5.model.Enumeration convertExampleScenarioActorType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ExampleScenarioActorTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PERSON: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ExampleScenarioActorType.PERSON); - break; - case ENTITY: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ExampleScenarioActorType.SYSTEM); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ExampleScenarioActorType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ExampleScenarioActorTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PERSON: + tgt.setValue(Enumerations.ExampleScenarioActorType.PERSON); + break; + case ENTITY: + tgt.setValue(Enumerations.ExampleScenarioActorType.SYSTEM); + break; + default: + tgt.setValue(Enumerations.ExampleScenarioActorType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertExampleScenarioActorType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioActorTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PERSON: - tgt.setValue(org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioActorType.PERSON); - break; - case SYSTEM: - tgt.setValue(org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioActorType.ENTITY); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioActorType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new ExampleScenario.ExampleScenarioActorTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PERSON: + tgt.setValue(ExampleScenario.ExampleScenarioActorType.PERSON); + break; + case SYSTEM: + tgt.setValue(ExampleScenario.ExampleScenarioActorType.ENTITY); + break; + default: + tgt.setValue(ExampleScenario.ExampleScenarioActorType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceComponent convertExampleScenarioInstanceComponent(org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ExplanationOfBenefit40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ExplanationOfBenefit40_50.java index f8042f2b97..b02068a21a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ExplanationOfBenefit40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ExplanationOfBenefit40_50.java @@ -16,6 +16,9 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; +import org.hl7.fhir.r5.model.ExplanationOfBenefit; /* Copyright (c) 2011+, HL7, Inc. @@ -237,147 +240,171 @@ public static org.hl7.fhir.r4.model.ExplanationOfBenefit convertExplanationOfBen } static public org.hl7.fhir.r5.model.Enumeration convertExplanationOfBenefitStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ExplanationOfBenefit.ExplanationOfBenefitStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.CANCELLED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ExplanationOfBenefit.ExplanationOfBenefitStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(ExplanationOfBenefit.ExplanationOfBenefitStatus.ACTIVE); + break; + case CANCELLED: + tgt.setValue(ExplanationOfBenefit.ExplanationOfBenefitStatus.CANCELLED); + break; + case DRAFT: + tgt.setValue(ExplanationOfBenefit.ExplanationOfBenefitStatus.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(ExplanationOfBenefit.ExplanationOfBenefitStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(ExplanationOfBenefit.ExplanationOfBenefitStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertExplanationOfBenefitStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ExplanationOfBenefit.ExplanationOfBenefitStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.CANCELLED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r4.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ExplanationOfBenefit.ExplanationOfBenefitStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.ACTIVE); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.CANCELLED); + break; + case DRAFT: + tgt.setValue(org.hl7.fhir.r4.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertUse(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.UseEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case CLAIM: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.Use.CLAIM); - break; - case PREAUTHORIZATION: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.Use.PREAUTHORIZATION); - break; - case PREDETERMINATION: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.Use.PREDETERMINATION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.Use.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.UseEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CLAIM: + tgt.setValue(Enumerations.Use.CLAIM); + break; + case PREAUTHORIZATION: + tgt.setValue(Enumerations.Use.PREAUTHORIZATION); + break; + case PREDETERMINATION: + tgt.setValue(Enumerations.Use.PREDETERMINATION); + break; + default: + tgt.setValue(Enumerations.Use.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertUse(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ExplanationOfBenefit.UseEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case CLAIM: - tgt.setValue(org.hl7.fhir.r4.model.ExplanationOfBenefit.Use.CLAIM); - break; - case PREAUTHORIZATION: - tgt.setValue(org.hl7.fhir.r4.model.ExplanationOfBenefit.Use.PREAUTHORIZATION); - break; - case PREDETERMINATION: - tgt.setValue(org.hl7.fhir.r4.model.ExplanationOfBenefit.Use.PREDETERMINATION); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ExplanationOfBenefit.Use.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ExplanationOfBenefit.UseEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CLAIM: + tgt.setValue(org.hl7.fhir.r4.model.ExplanationOfBenefit.Use.CLAIM); + break; + case PREAUTHORIZATION: + tgt.setValue(org.hl7.fhir.r4.model.ExplanationOfBenefit.Use.PREAUTHORIZATION); + break; + case PREDETERMINATION: + tgt.setValue(org.hl7.fhir.r4.model.ExplanationOfBenefit.Use.PREDETERMINATION); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.ExplanationOfBenefit.Use.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertRemittanceOutcome(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodesEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case QUEUED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.QUEUED); - break; - case COMPLETE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.COMPLETE); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.ERROR); - break; - case PARTIAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.PARTIAL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ClaimProcessingCodesEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case QUEUED: + tgt.setValue(Enumerations.ClaimProcessingCodes.QUEUED); + break; + case COMPLETE: + tgt.setValue(Enumerations.ClaimProcessingCodes.COMPLETE); + break; + case ERROR: + tgt.setValue(Enumerations.ClaimProcessingCodes.ERROR); + break; + case PARTIAL: + tgt.setValue(Enumerations.ClaimProcessingCodes.PARTIAL); + break; + default: + tgt.setValue(Enumerations.ClaimProcessingCodes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertRemittanceOutcome(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ExplanationOfBenefit.RemittanceOutcomeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case QUEUED: - tgt.setValue(org.hl7.fhir.r4.model.ExplanationOfBenefit.RemittanceOutcome.QUEUED); - break; - case COMPLETE: - tgt.setValue(org.hl7.fhir.r4.model.ExplanationOfBenefit.RemittanceOutcome.COMPLETE); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.r4.model.ExplanationOfBenefit.RemittanceOutcome.ERROR); - break; - case PARTIAL: - tgt.setValue(org.hl7.fhir.r4.model.ExplanationOfBenefit.RemittanceOutcome.PARTIAL); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ExplanationOfBenefit.RemittanceOutcome.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ExplanationOfBenefit.RemittanceOutcomeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case QUEUED: + tgt.setValue(org.hl7.fhir.r4.model.ExplanationOfBenefit.RemittanceOutcome.QUEUED); + break; + case COMPLETE: + tgt.setValue(org.hl7.fhir.r4.model.ExplanationOfBenefit.RemittanceOutcome.COMPLETE); + break; + case ERROR: + tgt.setValue(org.hl7.fhir.r4.model.ExplanationOfBenefit.RemittanceOutcome.ERROR); + break; + case PARTIAL: + tgt.setValue(org.hl7.fhir.r4.model.ExplanationOfBenefit.RemittanceOutcome.PARTIAL); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.ExplanationOfBenefit.RemittanceOutcome.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.ExplanationOfBenefit.RelatedClaimComponent convertRelatedClaimComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.RelatedClaimComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/FamilyMemberHistory40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/FamilyMemberHistory40_50.java index 32e4768934..423ea3ad73 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/FamilyMemberHistory40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/FamilyMemberHistory40_50.java @@ -12,6 +12,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.FamilyMemberHistory; /* Copyright (c) 2011+, HL7, Inc. @@ -133,53 +135,61 @@ public static org.hl7.fhir.r4.model.FamilyMemberHistory convertFamilyMemberHisto } static public org.hl7.fhir.r5.model.Enumeration convertFamilyHistoryStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PARTIAL: - tgt.setValue(org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus.PARTIAL); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus.ENTEREDINERROR); - break; - case HEALTHUNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus.HEALTHUNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new FamilyMemberHistory.FamilyHistoryStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PARTIAL: + tgt.setValue(FamilyMemberHistory.FamilyHistoryStatus.PARTIAL); + break; + case COMPLETED: + tgt.setValue(FamilyMemberHistory.FamilyHistoryStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(FamilyMemberHistory.FamilyHistoryStatus.ENTEREDINERROR); + break; + case HEALTHUNKNOWN: + tgt.setValue(FamilyMemberHistory.FamilyHistoryStatus.HEALTHUNKNOWN); + break; + default: + tgt.setValue(FamilyMemberHistory.FamilyHistoryStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertFamilyHistoryStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PARTIAL: - tgt.setValue(org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus.PARTIAL); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus.ENTEREDINERROR); - break; - case HEALTHUNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus.HEALTHUNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PARTIAL: + tgt.setValue(org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus.PARTIAL); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus.ENTEREDINERROR); + break; + case HEALTHUNKNOWN: + tgt.setValue(org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus.HEALTHUNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent convertFamilyMemberHistoryConditionComponent(org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Flag40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Flag40_50.java index 764ab604c8..75c1cae3ee 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Flag40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Flag40_50.java @@ -6,6 +6,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.general40_50.Period40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Flag; /* Copyright (c) 2011+, HL7, Inc. @@ -87,46 +89,54 @@ public static org.hl7.fhir.r4.model.Flag convertFlag(org.hl7.fhir.r5.model.Flag } static public org.hl7.fhir.r5.model.Enumeration convertFlagStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Flag.FlagStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Flag.FlagStatus.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Flag.FlagStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Flag.FlagStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Flag.FlagStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Flag.FlagStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Flag.FlagStatus.ACTIVE); + break; + case INACTIVE: + tgt.setValue(Flag.FlagStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(Flag.FlagStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Flag.FlagStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertFlagStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Flag.FlagStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Flag.FlagStatus.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Flag.FlagStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Flag.FlagStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Flag.FlagStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Flag.FlagStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4.model.Flag.FlagStatus.ACTIVE); + break; + case INACTIVE: + tgt.setValue(org.hl7.fhir.r4.model.Flag.FlagStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.Flag.FlagStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Flag.FlagStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Goal40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Goal40_50.java index 093e1109f2..bbb9a2e1e3 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Goal40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Goal40_50.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Goal; /* Copyright (c) 2011+, HL7, Inc. @@ -116,83 +118,91 @@ public static org.hl7.fhir.r4.model.Goal convertGoal(org.hl7.fhir.r5.model.Goal } static public org.hl7.fhir.r5.model.Enumeration convertGoalLifecycleStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Goal.GoalLifecycleStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSED: - tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.PROPOSED); - break; - case PLANNED: - tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.PLANNED); - break; - case ACCEPTED: - tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.ACCEPTED); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.ONHOLD); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.COMPLETED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.ENTEREDINERROR); - break; - case REJECTED: - tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.REJECTED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Goal.GoalLifecycleStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSED: + tgt.setValue(Goal.GoalLifecycleStatus.PROPOSED); + break; + case PLANNED: + tgt.setValue(Goal.GoalLifecycleStatus.PLANNED); + break; + case ACCEPTED: + tgt.setValue(Goal.GoalLifecycleStatus.ACCEPTED); + break; + case ACTIVE: + tgt.setValue(Goal.GoalLifecycleStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(Goal.GoalLifecycleStatus.ONHOLD); + break; + case COMPLETED: + tgt.setValue(Goal.GoalLifecycleStatus.COMPLETED); + break; + case CANCELLED: + tgt.setValue(Goal.GoalLifecycleStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(Goal.GoalLifecycleStatus.ENTEREDINERROR); + break; + case REJECTED: + tgt.setValue(Goal.GoalLifecycleStatus.REJECTED); + break; + default: + tgt.setValue(Goal.GoalLifecycleStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertGoalLifecycleStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Goal.GoalLifecycleStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSED: - tgt.setValue(org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.PROPOSED); - break; - case PLANNED: - tgt.setValue(org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.PLANNED); - break; - case ACCEPTED: - tgt.setValue(org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.ACCEPTED); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.ONHOLD); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.COMPLETED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.ENTEREDINERROR); - break; - case REJECTED: - tgt.setValue(org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.REJECTED); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Goal.GoalLifecycleStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSED: + tgt.setValue(org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.PROPOSED); + break; + case PLANNED: + tgt.setValue(org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.PLANNED); + break; + case ACCEPTED: + tgt.setValue(org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.ACCEPTED); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.ONHOLD); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.COMPLETED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.ENTEREDINERROR); + break; + case REJECTED: + tgt.setValue(org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.REJECTED); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Goal.GoalTargetComponent convertGoalTargetComponent(org.hl7.fhir.r4.model.Goal.GoalTargetComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Group40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Group40_50.java index 348c734612..aeb8b4c4c7 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Group40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Group40_50.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.UnsignedInt40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Group; import org.hl7.fhir.r5.model.Group.GroupMembershipBasis; /* @@ -99,53 +101,61 @@ public static org.hl7.fhir.r4.model.Group convertGroup(org.hl7.fhir.r5.model.Gro } static public org.hl7.fhir.r5.model.Enumeration convertGroupType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Group.GroupTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PERSON: - tgt.setValue(org.hl7.fhir.r5.model.Group.GroupType.PERSON); - break; - case ANIMAL: - tgt.setValue(org.hl7.fhir.r5.model.Group.GroupType.ANIMAL); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.r5.model.Group.GroupType.PRACTITIONER); - break; - case DEVICE: - tgt.setValue(org.hl7.fhir.r5.model.Group.GroupType.DEVICE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Group.GroupType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Group.GroupTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PERSON: + tgt.setValue(Group.GroupType.PERSON); + break; + case ANIMAL: + tgt.setValue(Group.GroupType.ANIMAL); + break; + case PRACTITIONER: + tgt.setValue(Group.GroupType.PRACTITIONER); + break; + case DEVICE: + tgt.setValue(Group.GroupType.DEVICE); + break; + default: + tgt.setValue(Group.GroupType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertGroupType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Group.GroupTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PERSON: - tgt.setValue(org.hl7.fhir.r4.model.Group.GroupType.PERSON); - break; - case ANIMAL: - tgt.setValue(org.hl7.fhir.r4.model.Group.GroupType.ANIMAL); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.r4.model.Group.GroupType.PRACTITIONER); - break; - case DEVICE: - tgt.setValue(org.hl7.fhir.r4.model.Group.GroupType.DEVICE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Group.GroupType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Group.GroupTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PERSON: + tgt.setValue(org.hl7.fhir.r4.model.Group.GroupType.PERSON); + break; + case ANIMAL: + tgt.setValue(org.hl7.fhir.r4.model.Group.GroupType.ANIMAL); + break; + case PRACTITIONER: + tgt.setValue(org.hl7.fhir.r4.model.Group.GroupType.PRACTITIONER); + break; + case DEVICE: + tgt.setValue(org.hl7.fhir.r4.model.Group.GroupType.DEVICE); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Group.GroupType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Group.GroupCharacteristicComponent convertGroupCharacteristicComponent(org.hl7.fhir.r4.model.Group.GroupCharacteristicComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/GuidanceResponse40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/GuidanceResponse40_50.java index 2ca237f6bf..b34d4b167b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/GuidanceResponse40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/GuidanceResponse40_50.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.GuidanceResponse; /* Copyright (c) 2011+, HL7, Inc. @@ -118,64 +120,72 @@ public static org.hl7.fhir.r4.model.GuidanceResponse convertGuidanceResponse(org } static public org.hl7.fhir.r5.model.Enumeration convertGuidanceResponseStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case SUCCESS: - tgt.setValue(org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatus.SUCCESS); - break; - case DATAREQUESTED: - tgt.setValue(org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatus.DATAREQUESTED); - break; - case DATAREQUIRED: - tgt.setValue(org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatus.DATAREQUIRED); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatus.INPROGRESS); - break; - case FAILURE: - tgt.setValue(org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatus.FAILURE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new GuidanceResponse.GuidanceResponseStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SUCCESS: + tgt.setValue(GuidanceResponse.GuidanceResponseStatus.SUCCESS); + break; + case DATAREQUESTED: + tgt.setValue(GuidanceResponse.GuidanceResponseStatus.DATAREQUESTED); + break; + case DATAREQUIRED: + tgt.setValue(GuidanceResponse.GuidanceResponseStatus.DATAREQUIRED); + break; + case INPROGRESS: + tgt.setValue(GuidanceResponse.GuidanceResponseStatus.INPROGRESS); + break; + case FAILURE: + tgt.setValue(GuidanceResponse.GuidanceResponseStatus.FAILURE); + break; + case ENTEREDINERROR: + tgt.setValue(GuidanceResponse.GuidanceResponseStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(GuidanceResponse.GuidanceResponseStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertGuidanceResponseStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case SUCCESS: - tgt.setValue(org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatus.SUCCESS); - break; - case DATAREQUESTED: - tgt.setValue(org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatus.DATAREQUESTED); - break; - case DATAREQUIRED: - tgt.setValue(org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatus.DATAREQUIRED); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatus.INPROGRESS); - break; - case FAILURE: - tgt.setValue(org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatus.FAILURE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SUCCESS: + tgt.setValue(org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatus.SUCCESS); + break; + case DATAREQUESTED: + tgt.setValue(org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatus.DATAREQUESTED); + break; + case DATAREQUIRED: + tgt.setValue(org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatus.DATAREQUIRED); + break; + case INPROGRESS: + tgt.setValue(org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatus.INPROGRESS); + break; + case FAILURE: + tgt.setValue(org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatus.FAILURE); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/HealthcareService40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/HealthcareService40_50.java index 4f1696d539..40a49f5870 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/HealthcareService40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/HealthcareService40_50.java @@ -10,6 +10,9 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.HealthcareService; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; import org.hl7.fhir.r5.model.ExtendedContactDetail; /* @@ -211,71 +214,79 @@ public static org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceEligibili // } static public org.hl7.fhir.r5.model.Enumeration convertDaysOfWeek(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.DaysOfWeekEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case MON: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.MON); - break; - case TUE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.TUE); - break; - case WED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.WED); - break; - case THU: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.THU); - break; - case FRI: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.FRI); - break; - case SAT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.SAT); - break; - case SUN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.SUN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.DaysOfWeekEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MON: + tgt.setValue(Enumerations.DaysOfWeek.MON); + break; + case TUE: + tgt.setValue(Enumerations.DaysOfWeek.TUE); + break; + case WED: + tgt.setValue(Enumerations.DaysOfWeek.WED); + break; + case THU: + tgt.setValue(Enumerations.DaysOfWeek.THU); + break; + case FRI: + tgt.setValue(Enumerations.DaysOfWeek.FRI); + break; + case SAT: + tgt.setValue(Enumerations.DaysOfWeek.SAT); + break; + case SUN: + tgt.setValue(Enumerations.DaysOfWeek.SUN); + break; + default: + tgt.setValue(Enumerations.DaysOfWeek.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertDaysOfWeek(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.HealthcareService.DaysOfWeekEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case MON: - tgt.setValue(org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.MON); - break; - case TUE: - tgt.setValue(org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.TUE); - break; - case WED: - tgt.setValue(org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.WED); - break; - case THU: - tgt.setValue(org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.THU); - break; - case FRI: - tgt.setValue(org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.FRI); - break; - case SAT: - tgt.setValue(org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.SAT); - break; - case SUN: - tgt.setValue(org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.SUN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new HealthcareService.DaysOfWeekEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MON: + tgt.setValue(HealthcareService.DaysOfWeek.MON); + break; + case TUE: + tgt.setValue(HealthcareService.DaysOfWeek.TUE); + break; + case WED: + tgt.setValue(HealthcareService.DaysOfWeek.WED); + break; + case THU: + tgt.setValue(HealthcareService.DaysOfWeek.THU); + break; + case FRI: + tgt.setValue(HealthcareService.DaysOfWeek.FRI); + break; + case SAT: + tgt.setValue(HealthcareService.DaysOfWeek.SAT); + break; + case SUN: + tgt.setValue(HealthcareService.DaysOfWeek.SUN); + break; + default: + tgt.setValue(HealthcareService.DaysOfWeek.NULL); + break; + } + } + return tgt; } // // public static org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceNotAvailableComponent convertHealthcareServiceNotAvailableComponent(org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceNotAvailableComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ImagingStudy40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ImagingStudy40_50.java index 08760a0809..8d79a3a5df 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ImagingStudy40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ImagingStudy40_50.java @@ -11,9 +11,7 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.UnsignedInt40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.r5.model.CodeableConcept; -import org.hl7.fhir.r5.model.CodeableReference; -import org.hl7.fhir.r5.model.Coding; +import org.hl7.fhir.r5.model.*; /* Copyright (c) 2011+, HL7, Inc. @@ -143,59 +141,67 @@ public static org.hl7.fhir.r4.model.ImagingStudy convertImagingStudy(org.hl7.fhi } static public org.hl7.fhir.r5.model.Enumeration convertImagingStudyStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyStatus.REGISTERED); - break; - case AVAILABLE: - tgt.setValue(org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyStatus.AVAILABLE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ImagingStudy.ImagingStudyStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(ImagingStudy.ImagingStudyStatus.REGISTERED); + break; + case AVAILABLE: + tgt.setValue(ImagingStudy.ImagingStudyStatus.AVAILABLE); + break; + case CANCELLED: + tgt.setValue(ImagingStudy.ImagingStudyStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(ImagingStudy.ImagingStudyStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(ImagingStudy.ImagingStudyStatus.UNKNOWN); + break; + default: + tgt.setValue(ImagingStudy.ImagingStudyStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertImagingStudyStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ImagingStudy.ImagingStudyStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.r4.model.ImagingStudy.ImagingStudyStatus.REGISTERED); - break; - case AVAILABLE: - tgt.setValue(org.hl7.fhir.r4.model.ImagingStudy.ImagingStudyStatus.AVAILABLE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.ImagingStudy.ImagingStudyStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.ImagingStudy.ImagingStudyStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.ImagingStudy.ImagingStudyStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ImagingStudy.ImagingStudyStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ImagingStudy.ImagingStudyStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(org.hl7.fhir.r4.model.ImagingStudy.ImagingStudyStatus.REGISTERED); + break; + case AVAILABLE: + tgt.setValue(org.hl7.fhir.r4.model.ImagingStudy.ImagingStudyStatus.AVAILABLE); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4.model.ImagingStudy.ImagingStudyStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.ImagingStudy.ImagingStudyStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4.model.ImagingStudy.ImagingStudyStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.ImagingStudy.ImagingStudyStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesComponent convertImagingStudySeriesComponent(org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Immunization40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Immunization40_50.java index 9bc7d5d116..c07f42d65e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Immunization40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Immunization40_50.java @@ -12,6 +12,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Immunization; /* Copyright (c) 2011+, HL7, Inc. @@ -173,47 +175,55 @@ public static org.hl7.fhir.r4.model.Immunization convertImmunization(org.hl7.fhi } static public org.hl7.fhir.r5.model.Enumeration convertImmunizationStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Immunization.ImmunizationStatusCodesEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.Immunization.ImmunizationStatusCodes.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Immunization.ImmunizationStatusCodes.ENTEREDINERROR); - break; - case NOTDONE: - tgt.setValue(org.hl7.fhir.r5.model.Immunization.ImmunizationStatusCodes.NOTDONE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Immunization.ImmunizationStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Immunization.ImmunizationStatusCodesEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case COMPLETED: + tgt.setValue(Immunization.ImmunizationStatusCodes.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(Immunization.ImmunizationStatusCodes.ENTEREDINERROR); + break; + case NOTDONE: + tgt.setValue(Immunization.ImmunizationStatusCodes.NOTDONE); + break; + default: + tgt.setValue(Immunization.ImmunizationStatusCodes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertImmunizationStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Immunization.ImmunizationStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.Immunization.ImmunizationStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Immunization.ImmunizationStatus.ENTEREDINERROR); - break; - case NOTDONE: - tgt.setValue(org.hl7.fhir.r4.model.Immunization.ImmunizationStatus.NOTDONE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Immunization.ImmunizationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Immunization.ImmunizationStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4.model.Immunization.ImmunizationStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.Immunization.ImmunizationStatus.ENTEREDINERROR); + break; + case NOTDONE: + tgt.setValue(org.hl7.fhir.r4.model.Immunization.ImmunizationStatus.NOTDONE); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Immunization.ImmunizationStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Immunization.ImmunizationPerformerComponent convertImmunizationPerformerComponent(org.hl7.fhir.r4.model.Immunization.ImmunizationPerformerComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ImmunizationEvaluation40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ImmunizationEvaluation40_50.java index 4869fb1f70..b2ff5ef94a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ImmunizationEvaluation40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ImmunizationEvaluation40_50.java @@ -7,6 +7,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.ImmunizationEvaluation; /* Copyright (c) 2011+, HL7, Inc. @@ -108,40 +110,48 @@ public static org.hl7.fhir.r4.model.ImmunizationEvaluation convertImmunizationEv } static public org.hl7.fhir.r5.model.Enumeration convertImmunizationEvaluationStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ImmunizationEvaluation.ImmunizationEvaluationStatusCodesEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.ImmunizationEvaluation.ImmunizationEvaluationStatusCodes.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.ImmunizationEvaluation.ImmunizationEvaluationStatusCodes.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ImmunizationEvaluation.ImmunizationEvaluationStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ImmunizationEvaluation.ImmunizationEvaluationStatusCodesEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case COMPLETED: + tgt.setValue(ImmunizationEvaluation.ImmunizationEvaluationStatusCodes.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(ImmunizationEvaluation.ImmunizationEvaluationStatusCodes.ENTEREDINERROR); + break; + default: + tgt.setValue(ImmunizationEvaluation.ImmunizationEvaluationStatusCodes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertImmunizationEvaluationStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ImmunizationEvaluation.ImmunizationEvaluationStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.ImmunizationEvaluation.ImmunizationEvaluationStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.ImmunizationEvaluation.ImmunizationEvaluationStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ImmunizationEvaluation.ImmunizationEvaluationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ImmunizationEvaluation.ImmunizationEvaluationStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4.model.ImmunizationEvaluation.ImmunizationEvaluationStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.ImmunizationEvaluation.ImmunizationEvaluationStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.ImmunizationEvaluation.ImmunizationEvaluationStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ImplementationGuide40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ImplementationGuide40_50.java index 852f1d153e..e99d7288e3 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ImplementationGuide40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ImplementationGuide40_50.java @@ -21,6 +21,7 @@ import org.hl7.fhir.r4.model.MarkdownType; import org.hl7.fhir.r4.model.UrlType; import org.hl7.fhir.r5.model.CanonicalType; +import org.hl7.fhir.r5.model.Enumeration; import org.hl7.fhir.r5.model.ImplementationGuide; import org.hl7.fhir.utilities.Utilities; @@ -415,53 +416,61 @@ public static org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefin } static public org.hl7.fhir.r5.model.Enumeration convertGuidePageGeneration(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ImplementationGuide.GuidePageGenerationEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case HTML: - tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.GuidePageGeneration.HTML); - break; - case MARKDOWN: - tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.GuidePageGeneration.MARKDOWN); - break; - case XML: - tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.GuidePageGeneration.XML); - break; - case GENERATED: - tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.GuidePageGeneration.GENERATED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.GuidePageGeneration.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ImplementationGuide.GuidePageGenerationEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case HTML: + tgt.setValue(ImplementationGuide.GuidePageGeneration.HTML); + break; + case MARKDOWN: + tgt.setValue(ImplementationGuide.GuidePageGeneration.MARKDOWN); + break; + case XML: + tgt.setValue(ImplementationGuide.GuidePageGeneration.XML); + break; + case GENERATED: + tgt.setValue(ImplementationGuide.GuidePageGeneration.GENERATED); + break; + default: + tgt.setValue(ImplementationGuide.GuidePageGeneration.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertGuidePageGeneration(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ImplementationGuide.GuidePageGenerationEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case HTML: - tgt.setValue(org.hl7.fhir.r4.model.ImplementationGuide.GuidePageGeneration.HTML); - break; - case MARKDOWN: - tgt.setValue(org.hl7.fhir.r4.model.ImplementationGuide.GuidePageGeneration.MARKDOWN); - break; - case XML: - tgt.setValue(org.hl7.fhir.r4.model.ImplementationGuide.GuidePageGeneration.XML); - break; - case GENERATED: - tgt.setValue(org.hl7.fhir.r4.model.ImplementationGuide.GuidePageGeneration.GENERATED); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ImplementationGuide.GuidePageGeneration.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ImplementationGuide.GuidePageGenerationEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case HTML: + tgt.setValue(org.hl7.fhir.r4.model.ImplementationGuide.GuidePageGeneration.HTML); + break; + case MARKDOWN: + tgt.setValue(org.hl7.fhir.r4.model.ImplementationGuide.GuidePageGeneration.MARKDOWN); + break; + case XML: + tgt.setValue(org.hl7.fhir.r4.model.ImplementationGuide.GuidePageGeneration.XML); + break; + case GENERATED: + tgt.setValue(org.hl7.fhir.r4.model.ImplementationGuide.GuidePageGeneration.GENERATED); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.ImplementationGuide.GuidePageGeneration.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionParameterComponent convertImplementationGuideDefinitionParameterComponent(org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionParameterComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Invoice40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Invoice40_50.java index 752fbd53eb..cea6f0d9d8 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Invoice40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Invoice40_50.java @@ -11,6 +11,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Invoice; /* Copyright (c) 2011+, HL7, Inc. @@ -122,59 +124,67 @@ public static org.hl7.fhir.r4.model.Invoice convertInvoice(org.hl7.fhir.r5.model } static public org.hl7.fhir.r5.model.Enumeration convertInvoiceStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Invoice.InvoiceStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.Invoice.InvoiceStatus.DRAFT); - break; - case ISSUED: - tgt.setValue(org.hl7.fhir.r5.model.Invoice.InvoiceStatus.ISSUED); - break; - case BALANCED: - tgt.setValue(org.hl7.fhir.r5.model.Invoice.InvoiceStatus.BALANCED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Invoice.InvoiceStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Invoice.InvoiceStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Invoice.InvoiceStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Invoice.InvoiceStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(Invoice.InvoiceStatus.DRAFT); + break; + case ISSUED: + tgt.setValue(Invoice.InvoiceStatus.ISSUED); + break; + case BALANCED: + tgt.setValue(Invoice.InvoiceStatus.BALANCED); + break; + case CANCELLED: + tgt.setValue(Invoice.InvoiceStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(Invoice.InvoiceStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Invoice.InvoiceStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertInvoiceStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Invoice.InvoiceStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r4.model.Invoice.InvoiceStatus.DRAFT); - break; - case ISSUED: - tgt.setValue(org.hl7.fhir.r4.model.Invoice.InvoiceStatus.ISSUED); - break; - case BALANCED: - tgt.setValue(org.hl7.fhir.r4.model.Invoice.InvoiceStatus.BALANCED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.Invoice.InvoiceStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Invoice.InvoiceStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Invoice.InvoiceStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Invoice.InvoiceStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(org.hl7.fhir.r4.model.Invoice.InvoiceStatus.DRAFT); + break; + case ISSUED: + tgt.setValue(org.hl7.fhir.r4.model.Invoice.InvoiceStatus.ISSUED); + break; + case BALANCED: + tgt.setValue(org.hl7.fhir.r4.model.Invoice.InvoiceStatus.BALANCED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4.model.Invoice.InvoiceStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.Invoice.InvoiceStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Invoice.InvoiceStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Invoice.InvoiceParticipantComponent convertInvoiceParticipantComponent(org.hl7.fhir.r4.model.Invoice.InvoiceParticipantComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Linkage40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Linkage40_50.java index 92bfc6a1dc..5b262a9042 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Linkage40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Linkage40_50.java @@ -4,6 +4,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Boolean40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Linkage; /* Copyright (c) 2011+, HL7, Inc. @@ -89,46 +91,54 @@ public static org.hl7.fhir.r4.model.Linkage.LinkageItemComponent convertLinkageI } static public org.hl7.fhir.r5.model.Enumeration convertLinkageType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Linkage.LinkageTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case SOURCE: - tgt.setValue(org.hl7.fhir.r5.model.Linkage.LinkageType.SOURCE); - break; - case ALTERNATE: - tgt.setValue(org.hl7.fhir.r5.model.Linkage.LinkageType.ALTERNATE); - break; - case HISTORICAL: - tgt.setValue(org.hl7.fhir.r5.model.Linkage.LinkageType.HISTORICAL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Linkage.LinkageType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Linkage.LinkageTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SOURCE: + tgt.setValue(Linkage.LinkageType.SOURCE); + break; + case ALTERNATE: + tgt.setValue(Linkage.LinkageType.ALTERNATE); + break; + case HISTORICAL: + tgt.setValue(Linkage.LinkageType.HISTORICAL); + break; + default: + tgt.setValue(Linkage.LinkageType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertLinkageType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Linkage.LinkageTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case SOURCE: - tgt.setValue(org.hl7.fhir.r4.model.Linkage.LinkageType.SOURCE); - break; - case ALTERNATE: - tgt.setValue(org.hl7.fhir.r4.model.Linkage.LinkageType.ALTERNATE); - break; - case HISTORICAL: - tgt.setValue(org.hl7.fhir.r4.model.Linkage.LinkageType.HISTORICAL); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Linkage.LinkageType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Linkage.LinkageTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SOURCE: + tgt.setValue(org.hl7.fhir.r4.model.Linkage.LinkageType.SOURCE); + break; + case ALTERNATE: + tgt.setValue(org.hl7.fhir.r4.model.Linkage.LinkageType.ALTERNATE); + break; + case HISTORICAL: + tgt.setValue(org.hl7.fhir.r4.model.Linkage.LinkageType.HISTORICAL); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Linkage.LinkageType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ListResource40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ListResource40_50.java index 656c0331fa..f1ecd3b781 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ListResource40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ListResource40_50.java @@ -9,6 +9,9 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; +import org.hl7.fhir.r5.model.ListResource; /* Copyright (c) 2011+, HL7, Inc. @@ -108,91 +111,107 @@ public static org.hl7.fhir.r4.model.ListResource convertListResource(org.hl7.fhi } static public org.hl7.fhir.r5.model.Enumeration convertListStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ListResource.ListStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case CURRENT: - tgt.setValue(org.hl7.fhir.r5.model.ListResource.ListStatus.CURRENT); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.r5.model.ListResource.ListStatus.RETIRED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.ListResource.ListStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ListResource.ListStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ListResource.ListStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CURRENT: + tgt.setValue(ListResource.ListStatus.CURRENT); + break; + case RETIRED: + tgt.setValue(ListResource.ListStatus.RETIRED); + break; + case ENTEREDINERROR: + tgt.setValue(ListResource.ListStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(ListResource.ListStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertListStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ListResource.ListStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case CURRENT: - tgt.setValue(org.hl7.fhir.r4.model.ListResource.ListStatus.CURRENT); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.r4.model.ListResource.ListStatus.RETIRED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.ListResource.ListStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ListResource.ListStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ListResource.ListStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CURRENT: + tgt.setValue(org.hl7.fhir.r4.model.ListResource.ListStatus.CURRENT); + break; + case RETIRED: + tgt.setValue(org.hl7.fhir.r4.model.ListResource.ListStatus.RETIRED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.ListResource.ListStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.ListResource.ListStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertListMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ListModeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case WORKING: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ListMode.WORKING); - break; - case SNAPSHOT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ListMode.SNAPSHOT); - break; - case CHANGES: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ListMode.CHANGES); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ListMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ListModeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case WORKING: + tgt.setValue(Enumerations.ListMode.WORKING); + break; + case SNAPSHOT: + tgt.setValue(Enumerations.ListMode.SNAPSHOT); + break; + case CHANGES: + tgt.setValue(Enumerations.ListMode.CHANGES); + break; + default: + tgt.setValue(Enumerations.ListMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertListMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ListResource.ListModeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case WORKING: - tgt.setValue(org.hl7.fhir.r4.model.ListResource.ListMode.WORKING); - break; - case SNAPSHOT: - tgt.setValue(org.hl7.fhir.r4.model.ListResource.ListMode.SNAPSHOT); - break; - case CHANGES: - tgt.setValue(org.hl7.fhir.r4.model.ListResource.ListMode.CHANGES); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ListResource.ListMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ListResource.ListModeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case WORKING: + tgt.setValue(org.hl7.fhir.r4.model.ListResource.ListMode.WORKING); + break; + case SNAPSHOT: + tgt.setValue(org.hl7.fhir.r4.model.ListResource.ListMode.SNAPSHOT); + break; + case CHANGES: + tgt.setValue(org.hl7.fhir.r4.model.ListResource.ListMode.CHANGES); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.ListResource.ListMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.ListResource.ListResourceEntryComponent convertListEntryComponent(org.hl7.fhir.r4.model.ListResource.ListEntryComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Location40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Location40_50.java index 229f46b723..7394358fe7 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Location40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Location40_50.java @@ -10,8 +10,7 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.r5.model.ContactPoint; -import org.hl7.fhir.r5.model.ExtendedContactDetail; +import org.hl7.fhir.r5.model.*; /* Copyright (c) 2011+, HL7, Inc. @@ -126,85 +125,101 @@ public static org.hl7.fhir.r4.model.Location convertLocation(org.hl7.fhir.r5.mod } static public org.hl7.fhir.r5.model.Enumeration convertLocationStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Location.LocationStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Location.LocationStatus.ACTIVE); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.r5.model.Location.LocationStatus.SUSPENDED); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Location.LocationStatus.INACTIVE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Location.LocationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Location.LocationStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Location.LocationStatus.ACTIVE); + break; + case SUSPENDED: + tgt.setValue(Location.LocationStatus.SUSPENDED); + break; + case INACTIVE: + tgt.setValue(Location.LocationStatus.INACTIVE); + break; + default: + tgt.setValue(Location.LocationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertLocationStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Location.LocationStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Location.LocationStatus.ACTIVE); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.r4.model.Location.LocationStatus.SUSPENDED); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Location.LocationStatus.INACTIVE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Location.LocationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Location.LocationStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4.model.Location.LocationStatus.ACTIVE); + break; + case SUSPENDED: + tgt.setValue(org.hl7.fhir.r4.model.Location.LocationStatus.SUSPENDED); + break; + case INACTIVE: + tgt.setValue(org.hl7.fhir.r4.model.Location.LocationStatus.INACTIVE); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Location.LocationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertLocationMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Location.LocationModeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.r5.model.Location.LocationMode.INSTANCE); - break; - case KIND: - tgt.setValue(org.hl7.fhir.r5.model.Location.LocationMode.KIND); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Location.LocationMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Location.LocationModeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(Location.LocationMode.INSTANCE); + break; + case KIND: + tgt.setValue(Location.LocationMode.KIND); + break; + default: + tgt.setValue(Location.LocationMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertLocationMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Location.LocationModeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.r4.model.Location.LocationMode.INSTANCE); - break; - case KIND: - tgt.setValue(org.hl7.fhir.r4.model.Location.LocationMode.KIND); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Location.LocationMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Location.LocationModeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(org.hl7.fhir.r4.model.Location.LocationMode.INSTANCE); + break; + case KIND: + tgt.setValue(org.hl7.fhir.r4.model.Location.LocationMode.KIND); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Location.LocationMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Location.LocationPositionComponent convertLocationPositionComponent(org.hl7.fhir.r4.model.Location.LocationPositionComponent src) throws FHIRException { @@ -270,70 +285,78 @@ public static org.hl7.fhir.r4.model.Location.LocationPositionComponent convertLo // } static public org.hl7.fhir.r5.model.Enumeration convertDaysOfWeek(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.DaysOfWeekEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case MON: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.MON); - break; - case TUE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.TUE); - break; - case WED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.WED); - break; - case THU: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.THU); - break; - case FRI: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.FRI); - break; - case SAT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.SAT); - break; - case SUN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.SUN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.DaysOfWeekEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MON: + tgt.setValue(Enumerations.DaysOfWeek.MON); + break; + case TUE: + tgt.setValue(Enumerations.DaysOfWeek.TUE); + break; + case WED: + tgt.setValue(Enumerations.DaysOfWeek.WED); + break; + case THU: + tgt.setValue(Enumerations.DaysOfWeek.THU); + break; + case FRI: + tgt.setValue(Enumerations.DaysOfWeek.FRI); + break; + case SAT: + tgt.setValue(Enumerations.DaysOfWeek.SAT); + break; + case SUN: + tgt.setValue(Enumerations.DaysOfWeek.SUN); + break; + default: + tgt.setValue(Enumerations.DaysOfWeek.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertDaysOfWeek(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Location.DaysOfWeekEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case MON: - tgt.setValue(org.hl7.fhir.r4.model.Location.DaysOfWeek.MON); - break; - case TUE: - tgt.setValue(org.hl7.fhir.r4.model.Location.DaysOfWeek.TUE); - break; - case WED: - tgt.setValue(org.hl7.fhir.r4.model.Location.DaysOfWeek.WED); - break; - case THU: - tgt.setValue(org.hl7.fhir.r4.model.Location.DaysOfWeek.THU); - break; - case FRI: - tgt.setValue(org.hl7.fhir.r4.model.Location.DaysOfWeek.FRI); - break; - case SAT: - tgt.setValue(org.hl7.fhir.r4.model.Location.DaysOfWeek.SAT); - break; - case SUN: - tgt.setValue(org.hl7.fhir.r4.model.Location.DaysOfWeek.SUN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Location.DaysOfWeek.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Location.DaysOfWeekEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MON: + tgt.setValue(org.hl7.fhir.r4.model.Location.DaysOfWeek.MON); + break; + case TUE: + tgt.setValue(org.hl7.fhir.r4.model.Location.DaysOfWeek.TUE); + break; + case WED: + tgt.setValue(org.hl7.fhir.r4.model.Location.DaysOfWeek.WED); + break; + case THU: + tgt.setValue(org.hl7.fhir.r4.model.Location.DaysOfWeek.THU); + break; + case FRI: + tgt.setValue(org.hl7.fhir.r4.model.Location.DaysOfWeek.FRI); + break; + case SAT: + tgt.setValue(org.hl7.fhir.r4.model.Location.DaysOfWeek.SAT); + break; + case SUN: + tgt.setValue(org.hl7.fhir.r4.model.Location.DaysOfWeek.SUN); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Location.DaysOfWeek.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/MeasureReport40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/MeasureReport40_50.java index 72731318af..f188e2241d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/MeasureReport40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/MeasureReport40_50.java @@ -10,6 +10,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Integer40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.MeasureReport; /* Copyright (c) 2011+, HL7, Inc. @@ -103,97 +105,113 @@ public static org.hl7.fhir.r4.model.MeasureReport convertMeasureReport(org.hl7.f } static public org.hl7.fhir.r5.model.Enumeration convertMeasureReportStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.MeasureReport.MeasureReportStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case COMPLETE: - tgt.setValue(org.hl7.fhir.r5.model.MeasureReport.MeasureReportStatus.COMPLETE); - break; - case PENDING: - tgt.setValue(org.hl7.fhir.r5.model.MeasureReport.MeasureReportStatus.PENDING); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.r5.model.MeasureReport.MeasureReportStatus.ERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.MeasureReport.MeasureReportStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new MeasureReport.MeasureReportStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case COMPLETE: + tgt.setValue(MeasureReport.MeasureReportStatus.COMPLETE); + break; + case PENDING: + tgt.setValue(MeasureReport.MeasureReportStatus.PENDING); + break; + case ERROR: + tgt.setValue(MeasureReport.MeasureReportStatus.ERROR); + break; + default: + tgt.setValue(MeasureReport.MeasureReportStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertMeasureReportStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MeasureReport.MeasureReportStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case COMPLETE: - tgt.setValue(org.hl7.fhir.r4.model.MeasureReport.MeasureReportStatus.COMPLETE); - break; - case PENDING: - tgt.setValue(org.hl7.fhir.r4.model.MeasureReport.MeasureReportStatus.PENDING); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.r4.model.MeasureReport.MeasureReportStatus.ERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.MeasureReport.MeasureReportStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MeasureReport.MeasureReportStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case COMPLETE: + tgt.setValue(org.hl7.fhir.r4.model.MeasureReport.MeasureReportStatus.COMPLETE); + break; + case PENDING: + tgt.setValue(org.hl7.fhir.r4.model.MeasureReport.MeasureReportStatus.PENDING); + break; + case ERROR: + tgt.setValue(org.hl7.fhir.r4.model.MeasureReport.MeasureReportStatus.ERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.MeasureReport.MeasureReportStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertMeasureReportType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.MeasureReport.MeasureReportTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case INDIVIDUAL: - tgt.setValue(org.hl7.fhir.r5.model.MeasureReport.MeasureReportType.INDIVIDUAL); - break; - case SUBJECTLIST: - tgt.setValue(org.hl7.fhir.r5.model.MeasureReport.MeasureReportType.SUBJECTLIST); - break; - case SUMMARY: - tgt.setValue(org.hl7.fhir.r5.model.MeasureReport.MeasureReportType.SUMMARY); - break; - case DATACOLLECTION: - tgt.setValue(org.hl7.fhir.r5.model.MeasureReport.MeasureReportType.DATAEXCHANGE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.MeasureReport.MeasureReportType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new MeasureReport.MeasureReportTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INDIVIDUAL: + tgt.setValue(MeasureReport.MeasureReportType.INDIVIDUAL); + break; + case SUBJECTLIST: + tgt.setValue(MeasureReport.MeasureReportType.SUBJECTLIST); + break; + case SUMMARY: + tgt.setValue(MeasureReport.MeasureReportType.SUMMARY); + break; + case DATACOLLECTION: + tgt.setValue(MeasureReport.MeasureReportType.DATAEXCHANGE); + break; + default: + tgt.setValue(MeasureReport.MeasureReportType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertMeasureReportType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MeasureReport.MeasureReportTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case INDIVIDUAL: - tgt.setValue(org.hl7.fhir.r4.model.MeasureReport.MeasureReportType.INDIVIDUAL); - break; - case SUBJECTLIST: - tgt.setValue(org.hl7.fhir.r4.model.MeasureReport.MeasureReportType.SUBJECTLIST); - break; - case SUMMARY: - tgt.setValue(org.hl7.fhir.r4.model.MeasureReport.MeasureReportType.SUMMARY); - break; - case DATAEXCHANGE: - tgt.setValue(org.hl7.fhir.r4.model.MeasureReport.MeasureReportType.DATACOLLECTION); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.MeasureReport.MeasureReportType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MeasureReport.MeasureReportTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INDIVIDUAL: + tgt.setValue(org.hl7.fhir.r4.model.MeasureReport.MeasureReportType.INDIVIDUAL); + break; + case SUBJECTLIST: + tgt.setValue(org.hl7.fhir.r4.model.MeasureReport.MeasureReportType.SUBJECTLIST); + break; + case SUMMARY: + tgt.setValue(org.hl7.fhir.r4.model.MeasureReport.MeasureReportType.SUMMARY); + break; + case DATAEXCHANGE: + tgt.setValue(org.hl7.fhir.r4.model.MeasureReport.MeasureReportType.DATACOLLECTION); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.MeasureReport.MeasureReportType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupComponent convertMeasureReportGroupComponent(org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Medication40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Medication40_50.java index eb85e41fe4..def325d755 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Medication40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Medication40_50.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Medication; /* Copyright (c) 2011+, HL7, Inc. @@ -90,47 +92,55 @@ public static org.hl7.fhir.r4.model.Medication convertMedication(org.hl7.fhir.r5 } static public org.hl7.fhir.r5.model.Enumeration convertMedicationStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Medication.MedicationStatusCodesEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Medication.MedicationStatusCodes.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Medication.MedicationStatusCodes.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Medication.MedicationStatusCodes.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Medication.MedicationStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Medication.MedicationStatusCodesEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Medication.MedicationStatusCodes.ACTIVE); + break; + case INACTIVE: + tgt.setValue(Medication.MedicationStatusCodes.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(Medication.MedicationStatusCodes.ENTEREDINERROR); + break; + default: + tgt.setValue(Medication.MedicationStatusCodes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertMedicationStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Medication.MedicationStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Medication.MedicationStatus.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Medication.MedicationStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Medication.MedicationStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Medication.MedicationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Medication.MedicationStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4.model.Medication.MedicationStatus.ACTIVE); + break; + case INACTIVE: + tgt.setValue(org.hl7.fhir.r4.model.Medication.MedicationStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.Medication.MedicationStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Medication.MedicationStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Medication.MedicationIngredientComponent convertMedicationIngredientComponent(org.hl7.fhir.r4.model.Medication.MedicationIngredientComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/MedicationAdministration40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/MedicationAdministration40_50.java index eb01a104f1..d8695718d7 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/MedicationAdministration40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/MedicationAdministration40_50.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.MedicationAdministration; /* Copyright (c) 2011+, HL7, Inc. @@ -134,73 +136,81 @@ public static org.hl7.fhir.r4.model.MedicationAdministration convertMedicationAd } private static org.hl7.fhir.r5.model.Enumeration convertMedicationAdministrationStatus(org.hl7.fhir.r4.model.Enumeration src) { - if (src == null) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationStatusCodesEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - // - switch (src.getValue()) { - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationStatusCodes.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationStatusCodes.ENTEREDINERROR); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationStatusCodes.INPROGRESS); - break; - case NOTDONE: - tgt.setValue(org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationStatusCodes.NOTDONE); - break; - case NULL: - tgt.setValue(org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationStatusCodes.NULL); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationStatusCodes.ONHOLD); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationStatusCodes.STOPPED); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationStatusCodes.UNKNOWN); - break; - } - return tgt; + if (src == null) + return null; + Enumeration tgt = new Enumeration<>(new MedicationAdministration.MedicationAdministrationStatusCodesEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + // + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case COMPLETED: + tgt.setValue(MedicationAdministration.MedicationAdministrationStatusCodes.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(MedicationAdministration.MedicationAdministrationStatusCodes.ENTEREDINERROR); + break; + case INPROGRESS: + tgt.setValue(MedicationAdministration.MedicationAdministrationStatusCodes.INPROGRESS); + break; + case NOTDONE: + tgt.setValue(MedicationAdministration.MedicationAdministrationStatusCodes.NOTDONE); + break; + case NULL: + tgt.setValue(MedicationAdministration.MedicationAdministrationStatusCodes.NULL); + break; + case ONHOLD: + tgt.setValue(MedicationAdministration.MedicationAdministrationStatusCodes.ONHOLD); + break; + case STOPPED: + tgt.setValue(MedicationAdministration.MedicationAdministrationStatusCodes.STOPPED); + break; + case UNKNOWN: + tgt.setValue(MedicationAdministration.MedicationAdministrationStatusCodes.UNKNOWN); + break; + } + } + return tgt; } private static org.hl7.fhir.r4.model.Enumeration convertMedicationAdministrationStatus(org.hl7.fhir.r5.model.Enumeration src) { - if (src == null) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - // - switch (src.getValue()) { - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationStatus.ENTEREDINERROR); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationStatus.INPROGRESS); - break; - case NOTDONE: - tgt.setValue(org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationStatus.NOTDONE); - break; - case NULL: - tgt.setValue(org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationStatus.NULL); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationStatus.ONHOLD); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationStatus.STOPPED); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationStatus.UNKNOWN); - break; - } - return tgt; + if (src == null) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + // + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationStatus.ENTEREDINERROR); + break; + case INPROGRESS: + tgt.setValue(org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationStatus.INPROGRESS); + break; + case NOTDONE: + tgt.setValue(org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationStatus.NOTDONE); + break; + case NULL: + tgt.setValue(org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationStatus.NULL); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationStatus.ONHOLD); + break; + case STOPPED: + tgt.setValue(org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationStatus.STOPPED); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationStatus.UNKNOWN); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationPerformerComponent convertMedicationAdministrationPerformerComponent(org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationPerformerComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/MedicationDispense40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/MedicationDispense40_50.java index 9b801d8476..4c345ea3aa 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/MedicationDispense40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/MedicationDispense40_50.java @@ -10,6 +10,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Dosage40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Enumeration; +import org.hl7.fhir.r4.model.MedicationDispense; import org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodesEnumFactory; /* @@ -158,83 +160,91 @@ public static org.hl7.fhir.r4.model.MedicationDispense convertMedicationDispense } private static org.hl7.fhir.r4.model.Enumeration convertStatus(org.hl7.fhir.r5.model.Enumeration src) { - if (src == null) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseStatus.CANCELLED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseStatus.COMPLETED); - break; - case DECLINED: - tgt.setValue(org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseStatus.DECLINED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseStatus.ENTEREDINERROR); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseStatus.INPROGRESS); - break; - case NULL: - tgt.setValue(org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseStatus.NULL); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseStatus.ONHOLD); - break; - case PREPARATION: - tgt.setValue(org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseStatus.PREPARATION); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseStatus.STOPPED); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseStatus.UNKNOWN); - break; - } - return tgt; + if (src == null) + return null; + Enumeration tgt = new Enumeration<>(new MedicationDispense.MedicationDispenseStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CANCELLED: + tgt.setValue(MedicationDispense.MedicationDispenseStatus.CANCELLED); + break; + case COMPLETED: + tgt.setValue(MedicationDispense.MedicationDispenseStatus.COMPLETED); + break; + case DECLINED: + tgt.setValue(MedicationDispense.MedicationDispenseStatus.DECLINED); + break; + case ENTEREDINERROR: + tgt.setValue(MedicationDispense.MedicationDispenseStatus.ENTEREDINERROR); + break; + case INPROGRESS: + tgt.setValue(MedicationDispense.MedicationDispenseStatus.INPROGRESS); + break; + case NULL: + tgt.setValue(MedicationDispense.MedicationDispenseStatus.NULL); + break; + case ONHOLD: + tgt.setValue(MedicationDispense.MedicationDispenseStatus.ONHOLD); + break; + case PREPARATION: + tgt.setValue(MedicationDispense.MedicationDispenseStatus.PREPARATION); + break; + case STOPPED: + tgt.setValue(MedicationDispense.MedicationDispenseStatus.STOPPED); + break; + case UNKNOWN: + tgt.setValue(MedicationDispense.MedicationDispenseStatus.UNKNOWN); + break; + } + } + return tgt; } private static org.hl7.fhir.r5.model.Enumeration convertMedicationStatus(org.hl7.fhir.r4.model.Enumeration src) { - if (src == null) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new MedicationDispenseStatusCodesEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.CANCELLED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.COMPLETED); - break; - case DECLINED: - tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.DECLINED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.ENTEREDINERROR); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.INPROGRESS); - break; - case NULL: - tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.NULL); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.ONHOLD); - break; - case PREPARATION: - tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.PREPARATION); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.STOPPED); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.UNKNOWN); - break; - } - return tgt; + if (src == null) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new MedicationDispenseStatusCodesEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CANCELLED: + tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.CANCELLED); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.COMPLETED); + break; + case DECLINED: + tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.DECLINED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.ENTEREDINERROR); + break; + case INPROGRESS: + tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.INPROGRESS); + break; + case NULL: + tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.NULL); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.ONHOLD); + break; + case PREPARATION: + tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.PREPARATION); + break; + case STOPPED: + tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.STOPPED); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.UNKNOWN); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.MedicationDispense.MedicationDispensePerformerComponent convertMedicationDispensePerformerComponent(org.hl7.fhir.r4.model.MedicationDispense.MedicationDispensePerformerComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/MedicationKnowledge40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/MedicationKnowledge40_50.java index 6847745f32..d33e9789c9 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/MedicationKnowledge40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/MedicationKnowledge40_50.java @@ -10,6 +10,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Enumeration; +import org.hl7.fhir.r4.model.MedicationKnowledge; import org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgePackagingComponent; import org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeStatusCodesEnumFactory; @@ -147,47 +149,55 @@ public static org.hl7.fhir.r4.model.MedicationKnowledge convertMedicationKnowled } private static org.hl7.fhir.r4.model.Enumeration convertMedicationKnowledgeStatus(org.hl7.fhir.r5.model.Enumeration src) { - if (src == null) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeStatus.ACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeStatus.ENTEREDINERROR); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeStatus.INACTIVE); - break; - case NULL: - tgt.setValue(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeStatus.NULL); - break; - } - return tgt; + if (src == null) + return null; + Enumeration tgt = new Enumeration<>(new MedicationKnowledge.MedicationKnowledgeStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(MedicationKnowledge.MedicationKnowledgeStatus.ACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(MedicationKnowledge.MedicationKnowledgeStatus.ENTEREDINERROR); + break; + case INACTIVE: + tgt.setValue(MedicationKnowledge.MedicationKnowledgeStatus.INACTIVE); + break; + case NULL: + tgt.setValue(MedicationKnowledge.MedicationKnowledgeStatus.NULL); + break; + } + } + return tgt; } private static org.hl7.fhir.r5.model.Enumeration convertMedicationKnowledgeStatus(org.hl7.fhir.r4.model.Enumeration src) { - if (src == null) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new MedicationKnowledgeStatusCodesEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeStatusCodes.ACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeStatusCodes.ENTEREDINERROR); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeStatusCodes.INACTIVE); - break; - case NULL: - tgt.setValue(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeStatusCodes.NULL); - break; - } - return tgt; + if (src == null) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new MedicationKnowledgeStatusCodesEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeStatusCodes.ACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeStatusCodes.ENTEREDINERROR); + break; + case INACTIVE: + tgt.setValue(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeStatusCodes.INACTIVE); + break; + case NULL: + tgt.setValue(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeStatusCodes.NULL); + break; + } + } + return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/MedicationRequest40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/MedicationRequest40_50.java index 26f4f4d1fd..601769ac99 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/MedicationRequest40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/MedicationRequest40_50.java @@ -13,6 +13,9 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Dosage40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; +import org.hl7.fhir.r5.model.MedicationRequest; /* Copyright (c) 2011+, HL7, Inc. @@ -194,201 +197,225 @@ public static org.hl7.fhir.r4.model.MedicationRequest convertMedicationRequest(o } static public org.hl7.fhir.r5.model.Enumeration convertMedicationRequestStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.ONHOLD); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.CANCELLED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.ENTEREDINERROR); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.STOPPED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.DRAFT); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new MedicationRequest.MedicationrequestStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(MedicationRequest.MedicationrequestStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(MedicationRequest.MedicationrequestStatus.ONHOLD); + break; + case CANCELLED: + tgt.setValue(MedicationRequest.MedicationrequestStatus.CANCELLED); + break; + case COMPLETED: + tgt.setValue(MedicationRequest.MedicationrequestStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(MedicationRequest.MedicationrequestStatus.ENTEREDINERROR); + break; + case STOPPED: + tgt.setValue(MedicationRequest.MedicationrequestStatus.STOPPED); + break; + case DRAFT: + tgt.setValue(MedicationRequest.MedicationrequestStatus.DRAFT); + break; + case UNKNOWN: + tgt.setValue(MedicationRequest.MedicationrequestStatus.UNKNOWN); + break; + default: + tgt.setValue(MedicationRequest.MedicationrequestStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertMedicationRequestStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.ONHOLD); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.CANCELLED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.ENTEREDINERROR); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.STOPPED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.DRAFT); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.ONHOLD); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.CANCELLED); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.ENTEREDINERROR); + break; + case STOPPED: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.STOPPED); + break; + case DRAFT: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.DRAFT); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertMedicationRequestIntent(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntentEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSAL: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.PROPOSAL); - break; - case PLAN: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.PLAN); - break; - case ORDER: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.ORDER); - break; - case ORIGINALORDER: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.ORIGINALORDER); - break; - case REFLEXORDER: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.REFLEXORDER); - break; - case FILLERORDER: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.FILLERORDER); - break; - case INSTANCEORDER: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.INSTANCEORDER); - break; - case OPTION: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.OPTION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new MedicationRequest.MedicationRequestIntentEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSAL: + tgt.setValue(MedicationRequest.MedicationRequestIntent.PROPOSAL); + break; + case PLAN: + tgt.setValue(MedicationRequest.MedicationRequestIntent.PLAN); + break; + case ORDER: + tgt.setValue(MedicationRequest.MedicationRequestIntent.ORDER); + break; + case ORIGINALORDER: + tgt.setValue(MedicationRequest.MedicationRequestIntent.ORIGINALORDER); + break; + case REFLEXORDER: + tgt.setValue(MedicationRequest.MedicationRequestIntent.REFLEXORDER); + break; + case FILLERORDER: + tgt.setValue(MedicationRequest.MedicationRequestIntent.FILLERORDER); + break; + case INSTANCEORDER: + tgt.setValue(MedicationRequest.MedicationRequestIntent.INSTANCEORDER); + break; + case OPTION: + tgt.setValue(MedicationRequest.MedicationRequestIntent.OPTION); + break; + default: + tgt.setValue(MedicationRequest.MedicationRequestIntent.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertMedicationRequestIntent(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntentEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSAL: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.PROPOSAL); - break; - case PLAN: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.PLAN); - break; - case ORDER: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.ORDER); - break; - case ORIGINALORDER: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.ORIGINALORDER); - break; - case REFLEXORDER: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.REFLEXORDER); - break; - case FILLERORDER: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.FILLERORDER); - break; - case INSTANCEORDER: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.INSTANCEORDER); - break; - case OPTION: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.OPTION); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntentEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSAL: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.PROPOSAL); + break; + case PLAN: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.PLAN); + break; + case ORDER: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.ORDER); + break; + case ORIGINALORDER: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.ORIGINALORDER); + break; + case REFLEXORDER: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.REFLEXORDER); + break; + case FILLERORDER: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.FILLERORDER); + break; + case INSTANCEORDER: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.INSTANCEORDER); + break; + case OPTION: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.OPTION); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertMedicationRequestPriority(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestPriorityEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP); - break; - case STAT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.RequestPriorityEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(Enumerations.RequestPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(Enumerations.RequestPriority.URGENT); + break; + case ASAP: + tgt.setValue(Enumerations.RequestPriority.ASAP); + break; + case STAT: + tgt.setValue(Enumerations.RequestPriority.STAT); + break; + default: + tgt.setValue(Enumerations.RequestPriority.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertMedicationRequestPriority(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriorityEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority.URGENT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority.ASAP); - break; - case STAT: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority.STAT); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriorityEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority.URGENT); + break; + case ASAP: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority.ASAP); + break; + case STAT: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority.STAT); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestDispenseRequestComponent convertMedicationRequestDispenseRequestComponent(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestDispenseRequestComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/MedicationStatement40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/MedicationStatement40_50.java index d450f8dbd9..2ee2bc7a81 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/MedicationStatement40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/MedicationStatement40_50.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.MedicationStatement; /* Copyright (c) 2011+, HL7, Inc. @@ -128,57 +130,64 @@ public static org.hl7.fhir.r4.model.MedicationStatement convertMedicationStateme } static public org.hl7.fhir.r5.model.Enumeration convertMedicationStatementStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodesEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodes.RECORDED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodes.RECORDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodes.ENTEREDINERROR); - break; - case INTENDED: - tgt.setValue(org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodes.RECORDED); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodes.RECORDED); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodes.RECORDED); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodes.RECORDED); - break; - case NOTTAKEN: - tgt.setValue(org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodes.RECORDED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new MedicationStatement.MedicationStatementStatusCodesEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(MedicationStatement.MedicationStatementStatusCodes.RECORDED); + break; + case COMPLETED: + tgt.setValue(MedicationStatement.MedicationStatementStatusCodes.RECORDED); + break; + case ENTEREDINERROR: + tgt.setValue(MedicationStatement.MedicationStatementStatusCodes.ENTEREDINERROR); + break; + case INTENDED: + tgt.setValue(MedicationStatement.MedicationStatementStatusCodes.RECORDED); + break; + case STOPPED: + tgt.setValue(MedicationStatement.MedicationStatementStatusCodes.RECORDED); + break; + case ONHOLD: + tgt.setValue(MedicationStatement.MedicationStatementStatusCodes.RECORDED); + break; + case UNKNOWN: + tgt.setValue(MedicationStatement.MedicationStatementStatusCodes.RECORDED); + break; + case NOTTAKEN: + tgt.setValue(MedicationStatement.MedicationStatementStatusCodes.RECORDED); + break; + default: + tgt.setValue(MedicationStatement.MedicationStatementStatusCodes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertMedicationStatementStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { -// case ACTIVE: + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + // case ACTIVE: // tgt.setValue(org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.ACTIVE); // break; - case RECORDED: - tgt.setValue(org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.ENTEREDINERROR); - break; + case RECORDED: + tgt.setValue(org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.ENTEREDINERROR); + break; // case UNKNOWN: // tgt.setValue(org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.INTENDED); // break; @@ -188,16 +197,17 @@ static public org.hl7.fhir.r4.model.Enumeration convertMessageSignificanceCategory(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.MessageDefinition.MessageSignificanceCategoryEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case CONSEQUENCE: - tgt.setValue(org.hl7.fhir.r5.model.MessageDefinition.MessageSignificanceCategory.CONSEQUENCE); - break; - case CURRENCY: - tgt.setValue(org.hl7.fhir.r5.model.MessageDefinition.MessageSignificanceCategory.CURRENCY); - break; - case NOTIFICATION: - tgt.setValue(org.hl7.fhir.r5.model.MessageDefinition.MessageSignificanceCategory.NOTIFICATION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.MessageDefinition.MessageSignificanceCategory.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new MessageDefinition.MessageSignificanceCategoryEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CONSEQUENCE: + tgt.setValue(MessageDefinition.MessageSignificanceCategory.CONSEQUENCE); + break; + case CURRENCY: + tgt.setValue(MessageDefinition.MessageSignificanceCategory.CURRENCY); + break; + case NOTIFICATION: + tgt.setValue(MessageDefinition.MessageSignificanceCategory.NOTIFICATION); + break; + default: + tgt.setValue(MessageDefinition.MessageSignificanceCategory.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertMessageSignificanceCategory(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MessageDefinition.MessageSignificanceCategoryEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case CONSEQUENCE: - tgt.setValue(org.hl7.fhir.r4.model.MessageDefinition.MessageSignificanceCategory.CONSEQUENCE); - break; - case CURRENCY: - tgt.setValue(org.hl7.fhir.r4.model.MessageDefinition.MessageSignificanceCategory.CURRENCY); - break; - case NOTIFICATION: - tgt.setValue(org.hl7.fhir.r4.model.MessageDefinition.MessageSignificanceCategory.NOTIFICATION); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.MessageDefinition.MessageSignificanceCategory.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MessageDefinition.MessageSignificanceCategoryEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CONSEQUENCE: + tgt.setValue(org.hl7.fhir.r4.model.MessageDefinition.MessageSignificanceCategory.CONSEQUENCE); + break; + case CURRENCY: + tgt.setValue(org.hl7.fhir.r4.model.MessageDefinition.MessageSignificanceCategory.CURRENCY); + break; + case NOTIFICATION: + tgt.setValue(org.hl7.fhir.r4.model.MessageDefinition.MessageSignificanceCategory.NOTIFICATION); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.MessageDefinition.MessageSignificanceCategory.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertMessageheaderResponseRequest(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.MessageDefinition.MessageheaderResponseRequestEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ALWAYS: - tgt.setValue(org.hl7.fhir.r5.model.MessageDefinition.MessageheaderResponseRequest.ALWAYS); - break; - case ONERROR: - tgt.setValue(org.hl7.fhir.r5.model.MessageDefinition.MessageheaderResponseRequest.ONERROR); - break; - case NEVER: - tgt.setValue(org.hl7.fhir.r5.model.MessageDefinition.MessageheaderResponseRequest.NEVER); - break; - case ONSUCCESS: - tgt.setValue(org.hl7.fhir.r5.model.MessageDefinition.MessageheaderResponseRequest.ONSUCCESS); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.MessageDefinition.MessageheaderResponseRequest.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new MessageDefinition.MessageheaderResponseRequestEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ALWAYS: + tgt.setValue(MessageDefinition.MessageheaderResponseRequest.ALWAYS); + break; + case ONERROR: + tgt.setValue(MessageDefinition.MessageheaderResponseRequest.ONERROR); + break; + case NEVER: + tgt.setValue(MessageDefinition.MessageheaderResponseRequest.NEVER); + break; + case ONSUCCESS: + tgt.setValue(MessageDefinition.MessageheaderResponseRequest.ONSUCCESS); + break; + default: + tgt.setValue(MessageDefinition.MessageheaderResponseRequest.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertMessageheaderResponseRequest(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MessageDefinition.MessageheaderResponseRequestEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ALWAYS: - tgt.setValue(org.hl7.fhir.r4.model.MessageDefinition.MessageheaderResponseRequest.ALWAYS); - break; - case ONERROR: - tgt.setValue(org.hl7.fhir.r4.model.MessageDefinition.MessageheaderResponseRequest.ONERROR); - break; - case NEVER: - tgt.setValue(org.hl7.fhir.r4.model.MessageDefinition.MessageheaderResponseRequest.NEVER); - break; - case ONSUCCESS: - tgt.setValue(org.hl7.fhir.r4.model.MessageDefinition.MessageheaderResponseRequest.ONSUCCESS); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.MessageDefinition.MessageheaderResponseRequest.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MessageDefinition.MessageheaderResponseRequestEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ALWAYS: + tgt.setValue(org.hl7.fhir.r4.model.MessageDefinition.MessageheaderResponseRequest.ALWAYS); + break; + case ONERROR: + tgt.setValue(org.hl7.fhir.r4.model.MessageDefinition.MessageheaderResponseRequest.ONERROR); + break; + case NEVER: + tgt.setValue(org.hl7.fhir.r4.model.MessageDefinition.MessageheaderResponseRequest.NEVER); + break; + case ONSUCCESS: + tgt.setValue(org.hl7.fhir.r4.model.MessageDefinition.MessageheaderResponseRequest.ONSUCCESS); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.MessageDefinition.MessageheaderResponseRequest.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.MessageDefinition.MessageDefinitionFocusComponent convertMessageDefinitionFocusComponent(org.hl7.fhir.r4.model.MessageDefinition.MessageDefinitionFocusComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/MessageHeader40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/MessageHeader40_50.java index 9339f66895..9c5f317fcb 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/MessageHeader40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/MessageHeader40_50.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Url40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.MessageHeader; /* Copyright (c) 2011+, HL7, Inc. @@ -203,46 +205,54 @@ public static org.hl7.fhir.r4.model.MessageHeader.MessageHeaderResponseComponent } static public org.hl7.fhir.r5.model.Enumeration convertResponseType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.MessageHeader.ResponseTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case OK: - tgt.setValue(org.hl7.fhir.r5.model.MessageHeader.ResponseType.OK); - break; - case TRANSIENTERROR: - tgt.setValue(org.hl7.fhir.r5.model.MessageHeader.ResponseType.TRANSIENTERROR); - break; - case FATALERROR: - tgt.setValue(org.hl7.fhir.r5.model.MessageHeader.ResponseType.FATALERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.MessageHeader.ResponseType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new MessageHeader.ResponseTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OK: + tgt.setValue(MessageHeader.ResponseType.OK); + break; + case TRANSIENTERROR: + tgt.setValue(MessageHeader.ResponseType.TRANSIENTERROR); + break; + case FATALERROR: + tgt.setValue(MessageHeader.ResponseType.FATALERROR); + break; + default: + tgt.setValue(MessageHeader.ResponseType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertResponseType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MessageHeader.ResponseTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case OK: - tgt.setValue(org.hl7.fhir.r4.model.MessageHeader.ResponseType.OK); - break; - case TRANSIENTERROR: - tgt.setValue(org.hl7.fhir.r4.model.MessageHeader.ResponseType.TRANSIENTERROR); - break; - case FATALERROR: - tgt.setValue(org.hl7.fhir.r4.model.MessageHeader.ResponseType.FATALERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.MessageHeader.ResponseType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MessageHeader.ResponseTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OK: + tgt.setValue(org.hl7.fhir.r4.model.MessageHeader.ResponseType.OK); + break; + case TRANSIENTERROR: + tgt.setValue(org.hl7.fhir.r4.model.MessageHeader.ResponseType.TRANSIENTERROR); + break; + case FATALERROR: + tgt.setValue(org.hl7.fhir.r4.model.MessageHeader.ResponseType.FATALERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.MessageHeader.ResponseType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/NamingSystem40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/NamingSystem40_50.java index 8af7884016..b13f6e0674 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/NamingSystem40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/NamingSystem40_50.java @@ -15,6 +15,8 @@ import org.hl7.fhir.r4.model.Extension; import org.hl7.fhir.r4.model.StringType; import org.hl7.fhir.r4.model.UriType; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.NamingSystem; /* Copyright (c) 2011+, HL7, Inc. @@ -136,47 +138,55 @@ public static org.hl7.fhir.r4.model.NamingSystem convertNamingSystem(org.hl7.fhi } static public org.hl7.fhir.r5.model.Enumeration convertNamingSystemType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.NamingSystem.NamingSystemTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case CODESYSTEM: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemType.CODESYSTEM); - break; - case IDENTIFIER: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemType.IDENTIFIER); - break; - case ROOT: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemType.ROOT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new NamingSystem.NamingSystemTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CODESYSTEM: + tgt.setValue(NamingSystem.NamingSystemType.CODESYSTEM); + break; + case IDENTIFIER: + tgt.setValue(NamingSystem.NamingSystemType.IDENTIFIER); + break; + case ROOT: + tgt.setValue(NamingSystem.NamingSystemType.ROOT); + break; + default: + tgt.setValue(NamingSystem.NamingSystemType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertNamingSystemType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.NamingSystem.NamingSystemTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case CODESYSTEM: - tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemType.CODESYSTEM); - break; - case IDENTIFIER: - tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemType.IDENTIFIER); - break; - case ROOT: - tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemType.ROOT); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.NamingSystem.NamingSystemTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CODESYSTEM: + tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemType.CODESYSTEM); + break; + case IDENTIFIER: + tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemType.IDENTIFIER); + break; + case ROOT: + tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemType.ROOT); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.NamingSystem.NamingSystemUniqueIdComponent convertNamingSystemUniqueIdComponent(org.hl7.fhir.r4.model.NamingSystem.NamingSystemUniqueIdComponent src) throws FHIRException { @@ -216,52 +226,60 @@ public static org.hl7.fhir.r4.model.NamingSystem.NamingSystemUniqueIdComponent c } static public org.hl7.fhir.r5.model.Enumeration convertNamingSystemIdentifierType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case OID: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierType.OID); - break; - case UUID: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierType.UUID); - break; - case URI: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierType.URI); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierType.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new NamingSystem.NamingSystemIdentifierTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OID: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.OID); + break; + case UUID: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.UUID); + break; + case URI: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.URI); + break; + case OTHER: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.OTHER); + break; + default: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertNamingSystemIdentifierType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case OID: - tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.OID); - break; - case UUID: - tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.UUID); - break; - case URI: - tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.URI); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OID: + tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.OID); + break; + case UUID: + tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.UUID); + break; + case URI: + tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.URI); + break; + case OTHER: + tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.OTHER); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.NamingSystem.NamingSystemIdentifierType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/NutritionOrder40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/NutritionOrder40_50.java index acb5f4709a..c36962fd7e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/NutritionOrder40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/NutritionOrder40_50.java @@ -12,6 +12,9 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Uri40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.NutritionOrder; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -125,151 +128,167 @@ public static org.hl7.fhir.r4.model.NutritionOrder convertNutritionOrder(org.hl7 } static public org.hl7.fhir.r5.model.Enumeration convertNutritionOrderStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ONHOLD); - break; - case REVOKED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.REVOKED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.RequestStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(Enumerations.RequestStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(Enumerations.RequestStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(Enumerations.RequestStatus.ONHOLD); + break; + case REVOKED: + tgt.setValue(Enumerations.RequestStatus.REVOKED); + break; + case COMPLETED: + tgt.setValue(Enumerations.RequestStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.RequestStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Enumerations.RequestStatus.UNKNOWN); + break; + default: + tgt.setValue(Enumerations.RequestStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertNutritionOrderStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderStatus.ONHOLD); - break; - case REVOKED: - tgt.setValue(org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderStatus.REVOKED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new NutritionOrder.NutritionOrderStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(NutritionOrder.NutritionOrderStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(NutritionOrder.NutritionOrderStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(NutritionOrder.NutritionOrderStatus.ONHOLD); + break; + case REVOKED: + tgt.setValue(NutritionOrder.NutritionOrderStatus.REVOKED); + break; + case COMPLETED: + tgt.setValue(NutritionOrder.NutritionOrderStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(NutritionOrder.NutritionOrderStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(NutritionOrder.NutritionOrderStatus.UNKNOWN); + break; + default: + tgt.setValue(NutritionOrder.NutritionOrderStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertNutritiionOrderIntent(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestIntentEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.PROPOSAL); - break; - case PLAN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.PLAN); - break; - case DIRECTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.DIRECTIVE); - break; - case ORDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORDER); - break; - case ORIGINALORDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORIGINALORDER); - break; - case REFLEXORDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.REFLEXORDER); - break; - case FILLERORDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.FILLERORDER); - break; - case INSTANCEORDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.INSTANCEORDER); - break; - case OPTION: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.OPTION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.RequestIntentEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSAL: + tgt.setValue(Enumerations.RequestIntent.PROPOSAL); + break; + case PLAN: + tgt.setValue(Enumerations.RequestIntent.PLAN); + break; + case DIRECTIVE: + tgt.setValue(Enumerations.RequestIntent.DIRECTIVE); + break; + case ORDER: + tgt.setValue(Enumerations.RequestIntent.ORDER); + break; + case ORIGINALORDER: + tgt.setValue(Enumerations.RequestIntent.ORIGINALORDER); + break; + case REFLEXORDER: + tgt.setValue(Enumerations.RequestIntent.REFLEXORDER); + break; + case FILLERORDER: + tgt.setValue(Enumerations.RequestIntent.FILLERORDER); + break; + case INSTANCEORDER: + tgt.setValue(Enumerations.RequestIntent.INSTANCEORDER); + break; + case OPTION: + tgt.setValue(Enumerations.RequestIntent.OPTION); + break; + default: + tgt.setValue(Enumerations.RequestIntent.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertNutritiionOrderIntent(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.NutritionOrder.NutritiionOrderIntentEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSAL: - tgt.setValue(org.hl7.fhir.r4.model.NutritionOrder.NutritiionOrderIntent.PROPOSAL); - break; - case PLAN: - tgt.setValue(org.hl7.fhir.r4.model.NutritionOrder.NutritiionOrderIntent.PLAN); - break; - case DIRECTIVE: - tgt.setValue(org.hl7.fhir.r4.model.NutritionOrder.NutritiionOrderIntent.DIRECTIVE); - break; - case ORDER: - tgt.setValue(org.hl7.fhir.r4.model.NutritionOrder.NutritiionOrderIntent.ORDER); - break; - case ORIGINALORDER: - tgt.setValue(org.hl7.fhir.r4.model.NutritionOrder.NutritiionOrderIntent.ORIGINALORDER); - break; - case REFLEXORDER: - tgt.setValue(org.hl7.fhir.r4.model.NutritionOrder.NutritiionOrderIntent.REFLEXORDER); - break; - case FILLERORDER: - tgt.setValue(org.hl7.fhir.r4.model.NutritionOrder.NutritiionOrderIntent.FILLERORDER); - break; - case INSTANCEORDER: - tgt.setValue(org.hl7.fhir.r4.model.NutritionOrder.NutritiionOrderIntent.INSTANCEORDER); - break; - case OPTION: - tgt.setValue(org.hl7.fhir.r4.model.NutritionOrder.NutritiionOrderIntent.OPTION); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.NutritionOrder.NutritiionOrderIntent.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new NutritionOrder.NutritiionOrderIntentEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSAL: + tgt.setValue(NutritionOrder.NutritiionOrderIntent.PROPOSAL); + break; + case PLAN: + tgt.setValue(NutritionOrder.NutritiionOrderIntent.PLAN); + break; + case DIRECTIVE: + tgt.setValue(NutritionOrder.NutritiionOrderIntent.DIRECTIVE); + break; + case ORDER: + tgt.setValue(NutritionOrder.NutritiionOrderIntent.ORDER); + break; + case ORIGINALORDER: + tgt.setValue(NutritionOrder.NutritiionOrderIntent.ORIGINALORDER); + break; + case REFLEXORDER: + tgt.setValue(NutritionOrder.NutritiionOrderIntent.REFLEXORDER); + break; + case FILLERORDER: + tgt.setValue(NutritionOrder.NutritiionOrderIntent.FILLERORDER); + break; + case INSTANCEORDER: + tgt.setValue(NutritionOrder.NutritiionOrderIntent.INSTANCEORDER); + break; + case OPTION: + tgt.setValue(NutritionOrder.NutritiionOrderIntent.OPTION); + break; + default: + tgt.setValue(NutritionOrder.NutritiionOrderIntent.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietComponent convertNutritionOrderOralDietComponent(org.hl7.fhir.r4.model.NutritionOrder.NutritionOrderOralDietComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Observation40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Observation40_50.java index 8f84383400..960f66ed56 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Observation40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Observation40_50.java @@ -10,6 +10,9 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Observation; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -146,77 +149,85 @@ public static org.hl7.fhir.r4.model.Observation convertObservation(org.hl7.fhir. } static public org.hl7.fhir.r5.model.Enumeration convertObservationStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ObservationStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.REGISTERED); - break; - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.AMENDED); - break; - case CORRECTED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.CORRECTED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ObservationStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(Enumerations.ObservationStatus.REGISTERED); + break; + case PRELIMINARY: + tgt.setValue(Enumerations.ObservationStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(Enumerations.ObservationStatus.FINAL); + break; + case AMENDED: + tgt.setValue(Enumerations.ObservationStatus.AMENDED); + break; + case CORRECTED: + tgt.setValue(Enumerations.ObservationStatus.CORRECTED); + break; + case CANCELLED: + tgt.setValue(Enumerations.ObservationStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.ObservationStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Enumerations.ObservationStatus.UNKNOWN); + break; + default: + tgt.setValue(Enumerations.ObservationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertObservationStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Observation.ObservationStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.REGISTERED); - break; - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.AMENDED); - break; - case CORRECTED: - tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.CORRECTED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Observation.ObservationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new Observation.ObservationStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(Observation.ObservationStatus.REGISTERED); + break; + case PRELIMINARY: + tgt.setValue(Observation.ObservationStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(Observation.ObservationStatus.FINAL); + break; + case AMENDED: + tgt.setValue(Observation.ObservationStatus.AMENDED); + break; + case CORRECTED: + tgt.setValue(Observation.ObservationStatus.CORRECTED); + break; + case CANCELLED: + tgt.setValue(Observation.ObservationStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(Observation.ObservationStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Observation.ObservationStatus.UNKNOWN); + break; + default: + tgt.setValue(Observation.ObservationStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Observation.ObservationReferenceRangeComponent convertObservationReferenceRangeComponent(org.hl7.fhir.r4.model.Observation.ObservationReferenceRangeComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ObservationDefinition40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ObservationDefinition40_50.java index eb7eb15b83..5efedbdd04 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ObservationDefinition40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ObservationDefinition40_50.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Boolean40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.ObservationDefinition; /* Copyright (c) 2011+, HL7, Inc. @@ -115,95 +117,103 @@ public static org.hl7.fhir.r4.model.ObservationDefinition convertObservationDefi } static public org.hl7.fhir.r5.model.Enumeration convertObservationDataType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case QUANTITY: - tgt.setValue(org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.QUANTITY); - break; - case CODEABLECONCEPT: - tgt.setValue(org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.CODEABLECONCEPT); - break; - case STRING: - tgt.setValue(org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.STRING); - break; - case BOOLEAN: - tgt.setValue(org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.BOOLEAN); - break; - case INTEGER: - tgt.setValue(org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.INTEGER); - break; - case RANGE: - tgt.setValue(org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.RANGE); - break; - case RATIO: - tgt.setValue(org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.RATIO); - break; - case SAMPLEDDATA: - tgt.setValue(org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.SAMPLEDDATA); - break; - case TIME: - tgt.setValue(org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.TIME); - break; - case DATETIME: - tgt.setValue(org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.DATETIME); - break; - case PERIOD: - tgt.setValue(org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.PERIOD); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ObservationDefinition.ObservationDataTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case QUANTITY: + tgt.setValue(ObservationDefinition.ObservationDataType.QUANTITY); + break; + case CODEABLECONCEPT: + tgt.setValue(ObservationDefinition.ObservationDataType.CODEABLECONCEPT); + break; + case STRING: + tgt.setValue(ObservationDefinition.ObservationDataType.STRING); + break; + case BOOLEAN: + tgt.setValue(ObservationDefinition.ObservationDataType.BOOLEAN); + break; + case INTEGER: + tgt.setValue(ObservationDefinition.ObservationDataType.INTEGER); + break; + case RANGE: + tgt.setValue(ObservationDefinition.ObservationDataType.RANGE); + break; + case RATIO: + tgt.setValue(ObservationDefinition.ObservationDataType.RATIO); + break; + case SAMPLEDDATA: + tgt.setValue(ObservationDefinition.ObservationDataType.SAMPLEDDATA); + break; + case TIME: + tgt.setValue(ObservationDefinition.ObservationDataType.TIME); + break; + case DATETIME: + tgt.setValue(ObservationDefinition.ObservationDataType.DATETIME); + break; + case PERIOD: + tgt.setValue(ObservationDefinition.ObservationDataType.PERIOD); + break; + default: + tgt.setValue(ObservationDefinition.ObservationDataType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertObservationDataType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case QUANTITY: - tgt.setValue(org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.QUANTITY); - break; - case CODEABLECONCEPT: - tgt.setValue(org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.CODEABLECONCEPT); - break; - case STRING: - tgt.setValue(org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.STRING); - break; - case BOOLEAN: - tgt.setValue(org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.BOOLEAN); - break; - case INTEGER: - tgt.setValue(org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.INTEGER); - break; - case RANGE: - tgt.setValue(org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.RANGE); - break; - case RATIO: - tgt.setValue(org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.RATIO); - break; - case SAMPLEDDATA: - tgt.setValue(org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.SAMPLEDDATA); - break; - case TIME: - tgt.setValue(org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.TIME); - break; - case DATETIME: - tgt.setValue(org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.DATETIME); - break; - case PERIOD: - tgt.setValue(org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.PERIOD); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case QUANTITY: + tgt.setValue(org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.QUANTITY); + break; + case CODEABLECONCEPT: + tgt.setValue(org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.CODEABLECONCEPT); + break; + case STRING: + tgt.setValue(org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.STRING); + break; + case BOOLEAN: + tgt.setValue(org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.BOOLEAN); + break; + case INTEGER: + tgt.setValue(org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.INTEGER); + break; + case RANGE: + tgt.setValue(org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.RANGE); + break; + case RATIO: + tgt.setValue(org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.RATIO); + break; + case SAMPLEDDATA: + tgt.setValue(org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.SAMPLEDDATA); + break; + case TIME: + tgt.setValue(org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.TIME); + break; + case DATETIME: + tgt.setValue(org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.DATETIME); + break; + case PERIOD: + tgt.setValue(org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.PERIOD); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.ObservationDefinition.ObservationDataType.NULL); + break; + } + } + return tgt; } @@ -254,46 +264,54 @@ static public org.hl7.fhir.r4.model.Enumeration convertObservationRangeCategory(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ObservationDefinition.ObservationRangeCategoryEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case REFERENCE: - tgt.setValue(org.hl7.fhir.r5.model.ObservationDefinition.ObservationRangeCategory.REFERENCE); - break; - case CRITICAL: - tgt.setValue(org.hl7.fhir.r5.model.ObservationDefinition.ObservationRangeCategory.CRITICAL); - break; - case ABSOLUTE: - tgt.setValue(org.hl7.fhir.r5.model.ObservationDefinition.ObservationRangeCategory.ABSOLUTE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ObservationDefinition.ObservationRangeCategory.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ObservationDefinition.ObservationRangeCategoryEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REFERENCE: + tgt.setValue(ObservationDefinition.ObservationRangeCategory.REFERENCE); + break; + case CRITICAL: + tgt.setValue(ObservationDefinition.ObservationRangeCategory.CRITICAL); + break; + case ABSOLUTE: + tgt.setValue(ObservationDefinition.ObservationRangeCategory.ABSOLUTE); + break; + default: + tgt.setValue(ObservationDefinition.ObservationRangeCategory.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertObservationRangeCategory(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ObservationDefinition.ObservationRangeCategoryEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case REFERENCE: - tgt.setValue(org.hl7.fhir.r4.model.ObservationDefinition.ObservationRangeCategory.REFERENCE); - break; - case CRITICAL: - tgt.setValue(org.hl7.fhir.r4.model.ObservationDefinition.ObservationRangeCategory.CRITICAL); - break; - case ABSOLUTE: - tgt.setValue(org.hl7.fhir.r4.model.ObservationDefinition.ObservationRangeCategory.ABSOLUTE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ObservationDefinition.ObservationRangeCategory.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ObservationDefinition.ObservationRangeCategoryEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REFERENCE: + tgt.setValue(org.hl7.fhir.r4.model.ObservationDefinition.ObservationRangeCategory.REFERENCE); + break; + case CRITICAL: + tgt.setValue(org.hl7.fhir.r4.model.ObservationDefinition.ObservationRangeCategory.CRITICAL); + break; + case ABSOLUTE: + tgt.setValue(org.hl7.fhir.r4.model.ObservationDefinition.ObservationRangeCategory.ABSOLUTE); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.ObservationDefinition.ObservationRangeCategory.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/OperationDefinition40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/OperationDefinition40_50.java index 70b0c29d46..572f408bf3 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/OperationDefinition40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/OperationDefinition40_50.java @@ -15,8 +15,10 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Uri40_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; import org.hl7.fhir.r5.model.Enumerations.VersionIndependentResourceTypesAll; import org.hl7.fhir.r5.model.Enumerations.VersionIndependentResourceTypesAllEnumFactory; +import org.hl7.fhir.r5.model.OperationDefinition; /* Copyright (c) 2011+, HL7, Inc. @@ -168,41 +170,49 @@ public static org.hl7.fhir.r4.model.OperationDefinition convertOperationDefiniti } static public org.hl7.fhir.r5.model.Enumeration convertOperationKind(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.OperationDefinition.OperationKindEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case OPERATION: - tgt.setValue(org.hl7.fhir.r5.model.OperationDefinition.OperationKind.OPERATION); - break; - case QUERY: - tgt.setValue(org.hl7.fhir.r5.model.OperationDefinition.OperationKind.QUERY); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.OperationDefinition.OperationKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new OperationDefinition.OperationKindEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OPERATION: + tgt.setValue(OperationDefinition.OperationKind.OPERATION); + break; + case QUERY: + tgt.setValue(OperationDefinition.OperationKind.QUERY); + break; + default: + tgt.setValue(OperationDefinition.OperationKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertOperationKind(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.OperationDefinition.OperationKindEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case OPERATION: - tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationKind.OPERATION); - break; - case QUERY: - tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationKind.QUERY); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.OperationDefinition.OperationKindEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OPERATION: + tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationKind.OPERATION); + break; + case QUERY: + tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationKind.QUERY); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationKind.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterComponent convertOperationDefinitionParameterComponent(org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterComponent src) throws FHIRException { @@ -268,41 +278,49 @@ public static org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParam } static public org.hl7.fhir.r5.model.Enumeration convertOperationParameterUse(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.OperationParameterUseEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case IN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.OperationParameterUse.IN); - break; - case OUT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.OperationParameterUse.OUT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.OperationParameterUse.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.OperationParameterUseEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case IN: + tgt.setValue(Enumerations.OperationParameterUse.IN); + break; + case OUT: + tgt.setValue(Enumerations.OperationParameterUse.OUT); + break; + default: + tgt.setValue(Enumerations.OperationParameterUse.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertOperationParameterUse(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUseEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case IN: - tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUse.IN); - break; - case OUT: - tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUse.OUT); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUse.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUseEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case IN: + tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUse.IN); + break; + case OUT: + tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUse.OUT); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.OperationDefinition.OperationParameterUse.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterBindingComponent convertOperationDefinitionParameterBindingComponent(org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterBindingComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/OperationOutcome40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/OperationOutcome40_50.java index b021e5f629..583c62cd19 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/OperationOutcome40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/OperationOutcome40_50.java @@ -4,6 +4,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.general40_50.CodeableConcept40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.OperationOutcome; /* Copyright (c) 2011+, HL7, Inc. @@ -95,264 +97,280 @@ public static org.hl7.fhir.r4.model.OperationOutcome.OperationOutcomeIssueCompon } static public org.hl7.fhir.r5.model.Enumeration convertIssueSeverity(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.OperationOutcome.IssueSeverityEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case FATAL: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.FATAL); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.ERROR); - break; - case WARNING: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.WARNING); - break; - case INFORMATION: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.INFORMATION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new OperationOutcome.IssueSeverityEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FATAL: + tgt.setValue(OperationOutcome.IssueSeverity.FATAL); + break; + case ERROR: + tgt.setValue(OperationOutcome.IssueSeverity.ERROR); + break; + case WARNING: + tgt.setValue(OperationOutcome.IssueSeverity.WARNING); + break; + case INFORMATION: + tgt.setValue(OperationOutcome.IssueSeverity.INFORMATION); + break; + default: + tgt.setValue(OperationOutcome.IssueSeverity.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertIssueSeverity(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.OperationOutcome.IssueSeverityEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case FATAL: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.FATAL); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.ERROR); - break; - case WARNING: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.WARNING); - break; - case INFORMATION: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.INFORMATION); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.OperationOutcome.IssueSeverityEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FATAL: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.FATAL); + break; + case ERROR: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.ERROR); + break; + case WARNING: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.WARNING); + break; + case INFORMATION: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.INFORMATION); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertIssueType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.OperationOutcome.IssueTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case INVALID: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.INVALID); - break; - case STRUCTURE: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.STRUCTURE); - break; - case REQUIRED: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.REQUIRED); - break; - case VALUE: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.VALUE); - break; - case INVARIANT: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.INVARIANT); - break; - case SECURITY: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.SECURITY); - break; - case LOGIN: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.LOGIN); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.UNKNOWN); - break; - case EXPIRED: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.EXPIRED); - break; - case FORBIDDEN: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.FORBIDDEN); - break; - case SUPPRESSED: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.SUPPRESSED); - break; - case PROCESSING: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.PROCESSING); - break; - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.NOTSUPPORTED); - break; - case DUPLICATE: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.DUPLICATE); - break; - case MULTIPLEMATCHES: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.MULTIPLEMATCHES); - break; - case NOTFOUND: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.NOTFOUND); - break; - case DELETED: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.DELETED); - break; - case TOOLONG: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.TOOLONG); - break; - case CODEINVALID: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.CODEINVALID); - break; - case EXTENSION: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.EXTENSION); - break; - case TOOCOSTLY: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.TOOCOSTLY); - break; - case BUSINESSRULE: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.BUSINESSRULE); - break; - case CONFLICT: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.CONFLICT); - break; - case TRANSIENT: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.TRANSIENT); - break; - case LOCKERROR: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.LOCKERROR); - break; - case NOSTORE: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.NOSTORE); - break; - case EXCEPTION: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.EXCEPTION); - break; - case TIMEOUT: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.TIMEOUT); - break; - case INCOMPLETE: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.INCOMPLETE); - break; - case THROTTLED: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.THROTTLED); - break; - case INFORMATIONAL: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.INFORMATIONAL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new OperationOutcome.IssueTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INVALID: + tgt.setValue(OperationOutcome.IssueType.INVALID); + break; + case STRUCTURE: + tgt.setValue(OperationOutcome.IssueType.STRUCTURE); + break; + case REQUIRED: + tgt.setValue(OperationOutcome.IssueType.REQUIRED); + break; + case VALUE: + tgt.setValue(OperationOutcome.IssueType.VALUE); + break; + case INVARIANT: + tgt.setValue(OperationOutcome.IssueType.INVARIANT); + break; + case SECURITY: + tgt.setValue(OperationOutcome.IssueType.SECURITY); + break; + case LOGIN: + tgt.setValue(OperationOutcome.IssueType.LOGIN); + break; + case UNKNOWN: + tgt.setValue(OperationOutcome.IssueType.UNKNOWN); + break; + case EXPIRED: + tgt.setValue(OperationOutcome.IssueType.EXPIRED); + break; + case FORBIDDEN: + tgt.setValue(OperationOutcome.IssueType.FORBIDDEN); + break; + case SUPPRESSED: + tgt.setValue(OperationOutcome.IssueType.SUPPRESSED); + break; + case PROCESSING: + tgt.setValue(OperationOutcome.IssueType.PROCESSING); + break; + case NOTSUPPORTED: + tgt.setValue(OperationOutcome.IssueType.NOTSUPPORTED); + break; + case DUPLICATE: + tgt.setValue(OperationOutcome.IssueType.DUPLICATE); + break; + case MULTIPLEMATCHES: + tgt.setValue(OperationOutcome.IssueType.MULTIPLEMATCHES); + break; + case NOTFOUND: + tgt.setValue(OperationOutcome.IssueType.NOTFOUND); + break; + case DELETED: + tgt.setValue(OperationOutcome.IssueType.DELETED); + break; + case TOOLONG: + tgt.setValue(OperationOutcome.IssueType.TOOLONG); + break; + case CODEINVALID: + tgt.setValue(OperationOutcome.IssueType.CODEINVALID); + break; + case EXTENSION: + tgt.setValue(OperationOutcome.IssueType.EXTENSION); + break; + case TOOCOSTLY: + tgt.setValue(OperationOutcome.IssueType.TOOCOSTLY); + break; + case BUSINESSRULE: + tgt.setValue(OperationOutcome.IssueType.BUSINESSRULE); + break; + case CONFLICT: + tgt.setValue(OperationOutcome.IssueType.CONFLICT); + break; + case TRANSIENT: + tgt.setValue(OperationOutcome.IssueType.TRANSIENT); + break; + case LOCKERROR: + tgt.setValue(OperationOutcome.IssueType.LOCKERROR); + break; + case NOSTORE: + tgt.setValue(OperationOutcome.IssueType.NOSTORE); + break; + case EXCEPTION: + tgt.setValue(OperationOutcome.IssueType.EXCEPTION); + break; + case TIMEOUT: + tgt.setValue(OperationOutcome.IssueType.TIMEOUT); + break; + case INCOMPLETE: + tgt.setValue(OperationOutcome.IssueType.INCOMPLETE); + break; + case THROTTLED: + tgt.setValue(OperationOutcome.IssueType.THROTTLED); + break; + case INFORMATIONAL: + tgt.setValue(OperationOutcome.IssueType.INFORMATIONAL); + break; + default: + tgt.setValue(OperationOutcome.IssueType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertIssueType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.OperationOutcome.IssueTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case INVALID: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.INVALID); - break; - case STRUCTURE: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.STRUCTURE); - break; - case REQUIRED: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.REQUIRED); - break; - case VALUE: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.VALUE); - break; - case INVARIANT: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.INVARIANT); - break; - case SECURITY: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.SECURITY); - break; - case LOGIN: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.LOGIN); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.UNKNOWN); - break; - case EXPIRED: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.EXPIRED); - break; - case FORBIDDEN: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.FORBIDDEN); - break; - case SUPPRESSED: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.SUPPRESSED); - break; - case PROCESSING: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.PROCESSING); - break; - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.NOTSUPPORTED); - break; - case DUPLICATE: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.DUPLICATE); - break; - case MULTIPLEMATCHES: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.MULTIPLEMATCHES); - break; - case NOTFOUND: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.NOTFOUND); - break; - case DELETED: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.DELETED); - break; - case TOOLONG: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.TOOLONG); - break; - case CODEINVALID: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.CODEINVALID); - break; - case EXTENSION: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.EXTENSION); - break; - case TOOCOSTLY: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.TOOCOSTLY); - break; - case BUSINESSRULE: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.BUSINESSRULE); - break; - case CONFLICT: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.CONFLICT); - break; - case TRANSIENT: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.TRANSIENT); - break; - case LOCKERROR: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.LOCKERROR); - break; - case NOSTORE: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.NOSTORE); - break; - case EXCEPTION: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.EXCEPTION); - break; - case TIMEOUT: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.TIMEOUT); - break; - case INCOMPLETE: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.INCOMPLETE); - break; - case THROTTLED: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.THROTTLED); - break; - case INFORMATIONAL: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.INFORMATIONAL); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.OperationOutcome.IssueTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INVALID: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.INVALID); + break; + case STRUCTURE: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.STRUCTURE); + break; + case REQUIRED: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.REQUIRED); + break; + case VALUE: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.VALUE); + break; + case INVARIANT: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.INVARIANT); + break; + case SECURITY: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.SECURITY); + break; + case LOGIN: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.LOGIN); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.UNKNOWN); + break; + case EXPIRED: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.EXPIRED); + break; + case FORBIDDEN: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.FORBIDDEN); + break; + case SUPPRESSED: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.SUPPRESSED); + break; + case PROCESSING: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.PROCESSING); + break; + case NOTSUPPORTED: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.NOTSUPPORTED); + break; + case DUPLICATE: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.DUPLICATE); + break; + case MULTIPLEMATCHES: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.MULTIPLEMATCHES); + break; + case NOTFOUND: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.NOTFOUND); + break; + case DELETED: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.DELETED); + break; + case TOOLONG: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.TOOLONG); + break; + case CODEINVALID: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.CODEINVALID); + break; + case EXTENSION: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.EXTENSION); + break; + case TOOCOSTLY: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.TOOCOSTLY); + break; + case BUSINESSRULE: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.BUSINESSRULE); + break; + case CONFLICT: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.CONFLICT); + break; + case TRANSIENT: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.TRANSIENT); + break; + case LOCKERROR: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.LOCKERROR); + break; + case NOSTORE: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.NOSTORE); + break; + case EXCEPTION: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.EXCEPTION); + break; + case TIMEOUT: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.TIMEOUT); + break; + case INCOMPLETE: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.INCOMPLETE); + break; + case THROTTLED: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.THROTTLED); + break; + case INFORMATIONAL: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.INFORMATIONAL); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.OperationOutcome.IssueType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Patient40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Patient40_50.java index 0b35c3a1cd..646641e914 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Patient40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Patient40_50.java @@ -12,6 +12,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Date40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Patient; /* Copyright (c) 2011+, HL7, Inc. @@ -211,52 +213,60 @@ public static org.hl7.fhir.r4.model.Patient.PatientLinkComponent convertPatientL } static public org.hl7.fhir.r5.model.Enumeration convertLinkType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Patient.LinkTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case REPLACEDBY: - tgt.setValue(org.hl7.fhir.r5.model.Patient.LinkType.REPLACEDBY); - break; - case REPLACES: - tgt.setValue(org.hl7.fhir.r5.model.Patient.LinkType.REPLACES); - break; - case REFER: - tgt.setValue(org.hl7.fhir.r5.model.Patient.LinkType.REFER); - break; - case SEEALSO: - tgt.setValue(org.hl7.fhir.r5.model.Patient.LinkType.SEEALSO); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Patient.LinkType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Patient.LinkTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REPLACEDBY: + tgt.setValue(Patient.LinkType.REPLACEDBY); + break; + case REPLACES: + tgt.setValue(Patient.LinkType.REPLACES); + break; + case REFER: + tgt.setValue(Patient.LinkType.REFER); + break; + case SEEALSO: + tgt.setValue(Patient.LinkType.SEEALSO); + break; + default: + tgt.setValue(Patient.LinkType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertLinkType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Patient.LinkTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case REPLACEDBY: - tgt.setValue(org.hl7.fhir.r4.model.Patient.LinkType.REPLACEDBY); - break; - case REPLACES: - tgt.setValue(org.hl7.fhir.r4.model.Patient.LinkType.REPLACES); - break; - case REFER: - tgt.setValue(org.hl7.fhir.r4.model.Patient.LinkType.REFER); - break; - case SEEALSO: - tgt.setValue(org.hl7.fhir.r4.model.Patient.LinkType.SEEALSO); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Patient.LinkType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Patient.LinkTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REPLACEDBY: + tgt.setValue(org.hl7.fhir.r4.model.Patient.LinkType.REPLACEDBY); + break; + case REPLACES: + tgt.setValue(org.hl7.fhir.r4.model.Patient.LinkType.REPLACES); + break; + case REFER: + tgt.setValue(org.hl7.fhir.r4.model.Patient.LinkType.REFER); + break; + case SEEALSO: + tgt.setValue(org.hl7.fhir.r4.model.Patient.LinkType.SEEALSO); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Patient.LinkType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/PaymentNotice40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/PaymentNotice40_50.java index 0d8fc7461e..3b52bf7709 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/PaymentNotice40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/PaymentNotice40_50.java @@ -8,6 +8,9 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.DateTime40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.PaymentNotice; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -105,52 +108,60 @@ public static org.hl7.fhir.r4.model.PaymentNotice convertPaymentNotice(org.hl7.f } static public org.hl7.fhir.r5.model.Enumeration convertPaymentNoticeStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodesEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.CANCELLED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.FinancialResourceStatusCodesEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.ACTIVE); + break; + case CANCELLED: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.CANCELLED); + break; + case DRAFT: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); + break; + default: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertPaymentNoticeStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.PaymentNotice.PaymentNoticeStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.PaymentNotice.PaymentNoticeStatus.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.PaymentNotice.PaymentNoticeStatus.CANCELLED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r4.model.PaymentNotice.PaymentNoticeStatus.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.PaymentNotice.PaymentNoticeStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.PaymentNotice.PaymentNoticeStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new PaymentNotice.PaymentNoticeStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(PaymentNotice.PaymentNoticeStatus.ACTIVE); + break; + case CANCELLED: + tgt.setValue(PaymentNotice.PaymentNoticeStatus.CANCELLED); + break; + case DRAFT: + tgt.setValue(PaymentNotice.PaymentNoticeStatus.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(PaymentNotice.PaymentNoticeStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(PaymentNotice.PaymentNoticeStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Person40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Person40_50.java index 4b902f8f64..15c7610205 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Person40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Person40_50.java @@ -10,6 +10,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Date40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Person; /* Copyright (c) 2011+, HL7, Inc. @@ -117,52 +119,60 @@ public static org.hl7.fhir.r4.model.Person.PersonLinkComponent convertPersonLink } static public org.hl7.fhir.r5.model.Enumeration convertIdentityAssuranceLevel(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Person.IdentityAssuranceLevelEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case LEVEL1: - tgt.setValue(org.hl7.fhir.r5.model.Person.IdentityAssuranceLevel.LEVEL1); - break; - case LEVEL2: - tgt.setValue(org.hl7.fhir.r5.model.Person.IdentityAssuranceLevel.LEVEL2); - break; - case LEVEL3: - tgt.setValue(org.hl7.fhir.r5.model.Person.IdentityAssuranceLevel.LEVEL3); - break; - case LEVEL4: - tgt.setValue(org.hl7.fhir.r5.model.Person.IdentityAssuranceLevel.LEVEL4); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Person.IdentityAssuranceLevel.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Person.IdentityAssuranceLevelEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case LEVEL1: + tgt.setValue(Person.IdentityAssuranceLevel.LEVEL1); + break; + case LEVEL2: + tgt.setValue(Person.IdentityAssuranceLevel.LEVEL2); + break; + case LEVEL3: + tgt.setValue(Person.IdentityAssuranceLevel.LEVEL3); + break; + case LEVEL4: + tgt.setValue(Person.IdentityAssuranceLevel.LEVEL4); + break; + default: + tgt.setValue(Person.IdentityAssuranceLevel.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertIdentityAssuranceLevel(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Person.IdentityAssuranceLevelEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case LEVEL1: - tgt.setValue(org.hl7.fhir.r4.model.Person.IdentityAssuranceLevel.LEVEL1); - break; - case LEVEL2: - tgt.setValue(org.hl7.fhir.r4.model.Person.IdentityAssuranceLevel.LEVEL2); - break; - case LEVEL3: - tgt.setValue(org.hl7.fhir.r4.model.Person.IdentityAssuranceLevel.LEVEL3); - break; - case LEVEL4: - tgt.setValue(org.hl7.fhir.r4.model.Person.IdentityAssuranceLevel.LEVEL4); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Person.IdentityAssuranceLevel.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Person.IdentityAssuranceLevelEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case LEVEL1: + tgt.setValue(org.hl7.fhir.r4.model.Person.IdentityAssuranceLevel.LEVEL1); + break; + case LEVEL2: + tgt.setValue(org.hl7.fhir.r4.model.Person.IdentityAssuranceLevel.LEVEL2); + break; + case LEVEL3: + tgt.setValue(org.hl7.fhir.r4.model.Person.IdentityAssuranceLevel.LEVEL3); + break; + case LEVEL4: + tgt.setValue(org.hl7.fhir.r4.model.Person.IdentityAssuranceLevel.LEVEL4); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Person.IdentityAssuranceLevel.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/PlanDefinition40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/PlanDefinition40_50.java index aa8833f2c5..ea52e3bac3 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/PlanDefinition40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/PlanDefinition40_50.java @@ -20,7 +20,10 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Uri40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.PlanDefinition; import org.hl7.fhir.r5.model.DataRequirement; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; import org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionInputComponent; import org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionOutputComponent; @@ -397,279 +400,327 @@ public static org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionComponent } static public org.hl7.fhir.r5.model.Enumeration convertRequestPriority(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestPriorityEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP); - break; - case STAT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.RequestPriorityEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(Enumerations.RequestPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(Enumerations.RequestPriority.URGENT); + break; + case ASAP: + tgt.setValue(Enumerations.RequestPriority.ASAP); + break; + case STAT: + tgt.setValue(Enumerations.RequestPriority.STAT); + break; + default: + tgt.setValue(Enumerations.RequestPriority.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertRequestPriority(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.PlanDefinition.RequestPriorityEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.RequestPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.RequestPriority.URGENT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.RequestPriority.ASAP); - break; - case STAT: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.RequestPriority.STAT); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.RequestPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new PlanDefinition.RequestPriorityEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(PlanDefinition.RequestPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(PlanDefinition.RequestPriority.URGENT); + break; + case ASAP: + tgt.setValue(PlanDefinition.RequestPriority.ASAP); + break; + case STAT: + tgt.setValue(PlanDefinition.RequestPriority.STAT); + break; + default: + tgt.setValue(PlanDefinition.RequestPriority.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertActionGroupingBehavior(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehaviorEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case VISUALGROUP: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior.VISUALGROUP); - break; - case LOGICALGROUP: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior.LOGICALGROUP); - break; - case SENTENCEGROUP: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior.SENTENCEGROUP); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ActionGroupingBehaviorEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case VISUALGROUP: + tgt.setValue(Enumerations.ActionGroupingBehavior.VISUALGROUP); + break; + case LOGICALGROUP: + tgt.setValue(Enumerations.ActionGroupingBehavior.LOGICALGROUP); + break; + case SENTENCEGROUP: + tgt.setValue(Enumerations.ActionGroupingBehavior.SENTENCEGROUP); + break; + default: + tgt.setValue(Enumerations.ActionGroupingBehavior.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertActionGroupingBehavior(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.PlanDefinition.ActionGroupingBehaviorEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case VISUALGROUP: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionGroupingBehavior.VISUALGROUP); - break; - case LOGICALGROUP: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionGroupingBehavior.LOGICALGROUP); - break; - case SENTENCEGROUP: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionGroupingBehavior.SENTENCEGROUP); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionGroupingBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new PlanDefinition.ActionGroupingBehaviorEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case VISUALGROUP: + tgt.setValue(PlanDefinition.ActionGroupingBehavior.VISUALGROUP); + break; + case LOGICALGROUP: + tgt.setValue(PlanDefinition.ActionGroupingBehavior.LOGICALGROUP); + break; + case SENTENCEGROUP: + tgt.setValue(PlanDefinition.ActionGroupingBehavior.SENTENCEGROUP); + break; + default: + tgt.setValue(PlanDefinition.ActionGroupingBehavior.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertActionSelectionBehavior(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehaviorEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ANY: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.ANY); - break; - case ALL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.ALL); - break; - case ALLORNONE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.ALLORNONE); - break; - case EXACTLYONE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.EXACTLYONE); - break; - case ATMOSTONE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.ATMOSTONE); - break; - case ONEORMORE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.ONEORMORE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ActionSelectionBehaviorEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ANY: + tgt.setValue(Enumerations.ActionSelectionBehavior.ANY); + break; + case ALL: + tgt.setValue(Enumerations.ActionSelectionBehavior.ALL); + break; + case ALLORNONE: + tgt.setValue(Enumerations.ActionSelectionBehavior.ALLORNONE); + break; + case EXACTLYONE: + tgt.setValue(Enumerations.ActionSelectionBehavior.EXACTLYONE); + break; + case ATMOSTONE: + tgt.setValue(Enumerations.ActionSelectionBehavior.ATMOSTONE); + break; + case ONEORMORE: + tgt.setValue(Enumerations.ActionSelectionBehavior.ONEORMORE); + break; + default: + tgt.setValue(Enumerations.ActionSelectionBehavior.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertActionSelectionBehavior(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehaviorEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ANY: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior.ANY); - break; - case ALL: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior.ALL); - break; - case ALLORNONE: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior.ALLORNONE); - break; - case EXACTLYONE: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior.EXACTLYONE); - break; - case ATMOSTONE: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior.ATMOSTONE); - break; - case ONEORMORE: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior.ONEORMORE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new PlanDefinition.ActionSelectionBehaviorEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ANY: + tgt.setValue(PlanDefinition.ActionSelectionBehavior.ANY); + break; + case ALL: + tgt.setValue(PlanDefinition.ActionSelectionBehavior.ALL); + break; + case ALLORNONE: + tgt.setValue(PlanDefinition.ActionSelectionBehavior.ALLORNONE); + break; + case EXACTLYONE: + tgt.setValue(PlanDefinition.ActionSelectionBehavior.EXACTLYONE); + break; + case ATMOSTONE: + tgt.setValue(PlanDefinition.ActionSelectionBehavior.ATMOSTONE); + break; + case ONEORMORE: + tgt.setValue(PlanDefinition.ActionSelectionBehavior.ONEORMORE); + break; + default: + tgt.setValue(PlanDefinition.ActionSelectionBehavior.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertActionRequiredBehavior(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehaviorEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case MUST: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior.MUST); - break; - case COULD: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior.COULD); - break; - case MUSTUNLESSDOCUMENTED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior.MUSTUNLESSDOCUMENTED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ActionRequiredBehaviorEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MUST: + tgt.setValue(Enumerations.ActionRequiredBehavior.MUST); + break; + case COULD: + tgt.setValue(Enumerations.ActionRequiredBehavior.COULD); + break; + case MUSTUNLESSDOCUMENTED: + tgt.setValue(Enumerations.ActionRequiredBehavior.MUSTUNLESSDOCUMENTED); + break; + default: + tgt.setValue(Enumerations.ActionRequiredBehavior.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertActionRequiredBehavior(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.PlanDefinition.ActionRequiredBehaviorEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case MUST: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRequiredBehavior.MUST); - break; - case COULD: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRequiredBehavior.COULD); - break; - case MUSTUNLESSDOCUMENTED: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRequiredBehavior.MUSTUNLESSDOCUMENTED); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRequiredBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new PlanDefinition.ActionRequiredBehaviorEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MUST: + tgt.setValue(PlanDefinition.ActionRequiredBehavior.MUST); + break; + case COULD: + tgt.setValue(PlanDefinition.ActionRequiredBehavior.COULD); + break; + case MUSTUNLESSDOCUMENTED: + tgt.setValue(PlanDefinition.ActionRequiredBehavior.MUSTUNLESSDOCUMENTED); + break; + default: + tgt.setValue(PlanDefinition.ActionRequiredBehavior.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertActionPrecheckBehavior(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ActionPrecheckBehaviorEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case YES: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionPrecheckBehavior.YES); - break; - case NO: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionPrecheckBehavior.NO); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionPrecheckBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ActionPrecheckBehaviorEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case YES: + tgt.setValue(Enumerations.ActionPrecheckBehavior.YES); + break; + case NO: + tgt.setValue(Enumerations.ActionPrecheckBehavior.NO); + break; + default: + tgt.setValue(Enumerations.ActionPrecheckBehavior.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertActionPrecheckBehavior(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.PlanDefinition.ActionPrecheckBehaviorEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case YES: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionPrecheckBehavior.YES); - break; - case NO: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionPrecheckBehavior.NO); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionPrecheckBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new PlanDefinition.ActionPrecheckBehaviorEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case YES: + tgt.setValue(PlanDefinition.ActionPrecheckBehavior.YES); + break; + case NO: + tgt.setValue(PlanDefinition.ActionPrecheckBehavior.NO); + break; + default: + tgt.setValue(PlanDefinition.ActionPrecheckBehavior.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertActionCardinalityBehavior(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ActionCardinalityBehaviorEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case SINGLE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionCardinalityBehavior.SINGLE); - break; - case MULTIPLE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionCardinalityBehavior.MULTIPLE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionCardinalityBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ActionCardinalityBehaviorEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SINGLE: + tgt.setValue(Enumerations.ActionCardinalityBehavior.SINGLE); + break; + case MULTIPLE: + tgt.setValue(Enumerations.ActionCardinalityBehavior.MULTIPLE); + break; + default: + tgt.setValue(Enumerations.ActionCardinalityBehavior.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertActionCardinalityBehavior(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.PlanDefinition.ActionCardinalityBehaviorEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case SINGLE: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionCardinalityBehavior.SINGLE); - break; - case MULTIPLE: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionCardinalityBehavior.MULTIPLE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionCardinalityBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new PlanDefinition.ActionCardinalityBehaviorEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SINGLE: + tgt.setValue(PlanDefinition.ActionCardinalityBehavior.SINGLE); + break; + case MULTIPLE: + tgt.setValue(PlanDefinition.ActionCardinalityBehavior.MULTIPLE); + break; + default: + tgt.setValue(PlanDefinition.ActionCardinalityBehavior.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionConditionComponent convertPlanDefinitionActionConditionComponent(org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionConditionComponent src) throws FHIRException { @@ -697,47 +748,55 @@ public static org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionCondition } static public org.hl7.fhir.r5.model.Enumeration convertActionConditionKind(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ActionConditionKindEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case APPLICABILITY: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionConditionKind.APPLICABILITY); - break; - case START: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionConditionKind.START); - break; - case STOP: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionConditionKind.STOP); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionConditionKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ActionConditionKindEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case APPLICABILITY: + tgt.setValue(Enumerations.ActionConditionKind.APPLICABILITY); + break; + case START: + tgt.setValue(Enumerations.ActionConditionKind.START); + break; + case STOP: + tgt.setValue(Enumerations.ActionConditionKind.STOP); + break; + default: + tgt.setValue(Enumerations.ActionConditionKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertActionConditionKind(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.PlanDefinition.ActionConditionKindEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case APPLICABILITY: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionConditionKind.APPLICABILITY); - break; - case START: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionConditionKind.START); - break; - case STOP: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionConditionKind.STOP); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionConditionKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new PlanDefinition.ActionConditionKindEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case APPLICABILITY: + tgt.setValue(PlanDefinition.ActionConditionKind.APPLICABILITY); + break; + case START: + tgt.setValue(PlanDefinition.ActionConditionKind.START); + break; + case STOP: + tgt.setValue(PlanDefinition.ActionConditionKind.STOP); + break; + default: + tgt.setValue(PlanDefinition.ActionConditionKind.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent convertPlanDefinitionActionRelatedActionComponent(org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent src) throws FHIRException { @@ -769,83 +828,91 @@ public static org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionRelatedAc } static public org.hl7.fhir.r5.model.Enumeration convertActionRelationshipType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ActionRelationshipTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case BEFORESTART: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.BEFORESTART); - break; - case BEFORE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.BEFORE); - break; - case BEFOREEND: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.BEFOREEND); - break; - case CONCURRENTWITHSTART: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.CONCURRENTWITHSTART); - break; - case CONCURRENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.CONCURRENT); - break; - case CONCURRENTWITHEND: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.CONCURRENTWITHEND); - break; - case AFTERSTART: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.AFTERSTART); - break; - case AFTER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.AFTER); - break; - case AFTEREND: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.AFTEREND); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ActionRelationshipTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case BEFORESTART: + tgt.setValue(Enumerations.ActionRelationshipType.BEFORESTART); + break; + case BEFORE: + tgt.setValue(Enumerations.ActionRelationshipType.BEFORE); + break; + case BEFOREEND: + tgt.setValue(Enumerations.ActionRelationshipType.BEFOREEND); + break; + case CONCURRENTWITHSTART: + tgt.setValue(Enumerations.ActionRelationshipType.CONCURRENTWITHSTART); + break; + case CONCURRENT: + tgt.setValue(Enumerations.ActionRelationshipType.CONCURRENT); + break; + case CONCURRENTWITHEND: + tgt.setValue(Enumerations.ActionRelationshipType.CONCURRENTWITHEND); + break; + case AFTERSTART: + tgt.setValue(Enumerations.ActionRelationshipType.AFTERSTART); + break; + case AFTER: + tgt.setValue(Enumerations.ActionRelationshipType.AFTER); + break; + case AFTEREND: + tgt.setValue(Enumerations.ActionRelationshipType.AFTEREND); + break; + default: + tgt.setValue(Enumerations.ActionRelationshipType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertActionRelationshipType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case BEFORESTART: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.BEFORESTART); - break; - case BEFORE: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.BEFORE); - break; - case BEFOREEND: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.BEFOREEND); - break; - case CONCURRENTWITHSTART: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.CONCURRENTWITHSTART); - break; - case CONCURRENT: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.CONCURRENT); - break; - case CONCURRENTWITHEND: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.CONCURRENTWITHEND); - break; - case AFTERSTART: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.AFTERSTART); - break; - case AFTER: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.AFTER); - break; - case AFTEREND: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.AFTEREND); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new PlanDefinition.ActionRelationshipTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case BEFORESTART: + tgt.setValue(PlanDefinition.ActionRelationshipType.BEFORESTART); + break; + case BEFORE: + tgt.setValue(PlanDefinition.ActionRelationshipType.BEFORE); + break; + case BEFOREEND: + tgt.setValue(PlanDefinition.ActionRelationshipType.BEFOREEND); + break; + case CONCURRENTWITHSTART: + tgt.setValue(PlanDefinition.ActionRelationshipType.CONCURRENTWITHSTART); + break; + case CONCURRENT: + tgt.setValue(PlanDefinition.ActionRelationshipType.CONCURRENT); + break; + case CONCURRENTWITHEND: + tgt.setValue(PlanDefinition.ActionRelationshipType.CONCURRENTWITHEND); + break; + case AFTERSTART: + tgt.setValue(PlanDefinition.ActionRelationshipType.AFTERSTART); + break; + case AFTER: + tgt.setValue(PlanDefinition.ActionRelationshipType.AFTER); + break; + case AFTEREND: + tgt.setValue(PlanDefinition.ActionRelationshipType.AFTEREND); + break; + default: + tgt.setValue(PlanDefinition.ActionRelationshipType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionParticipantComponent convertPlanDefinitionActionParticipantComponent(org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionParticipantComponent src) throws FHIRException { @@ -873,53 +940,61 @@ public static org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionParticipa } static public org.hl7.fhir.r5.model.Enumeration convertActionParticipantType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ActionParticipantTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PATIENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.PATIENT); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.PRACTITIONER); - break; - case RELATEDPERSON: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.RELATEDPERSON); - break; - case DEVICE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.DEVICE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ActionParticipantTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PATIENT: + tgt.setValue(Enumerations.ActionParticipantType.PATIENT); + break; + case PRACTITIONER: + tgt.setValue(Enumerations.ActionParticipantType.PRACTITIONER); + break; + case RELATEDPERSON: + tgt.setValue(Enumerations.ActionParticipantType.RELATEDPERSON); + break; + case DEVICE: + tgt.setValue(Enumerations.ActionParticipantType.DEVICE); + break; + default: + tgt.setValue(Enumerations.ActionParticipantType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertActionParticipantType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.PlanDefinition.ActionParticipantTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PATIENT: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionParticipantType.PATIENT); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionParticipantType.PRACTITIONER); - break; - case RELATEDPERSON: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionParticipantType.RELATEDPERSON); - break; - case DEVICE: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionParticipantType.DEVICE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionParticipantType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new PlanDefinition.ActionParticipantTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PATIENT: + tgt.setValue(PlanDefinition.ActionParticipantType.PATIENT); + break; + case PRACTITIONER: + tgt.setValue(PlanDefinition.ActionParticipantType.PRACTITIONER); + break; + case RELATEDPERSON: + tgt.setValue(PlanDefinition.ActionParticipantType.RELATEDPERSON); + break; + case DEVICE: + tgt.setValue(PlanDefinition.ActionParticipantType.DEVICE); + break; + default: + tgt.setValue(PlanDefinition.ActionParticipantType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent convertPlanDefinitionActionDynamicValueComponent(org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Procedure40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Procedure40_50.java index 64981e88f2..c1a7c4fb21 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Procedure40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Procedure40_50.java @@ -8,7 +8,10 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Uri40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Procedure; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -170,77 +173,85 @@ public static org.hl7.fhir.r4.model.Procedure convertProcedure(org.hl7.fhir.r5.m } static public org.hl7.fhir.r5.model.Enumeration convertProcedureStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.EventStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PREPARATION: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.PREPARATION); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.INPROGRESS); - break; - case NOTDONE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.NOTDONE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.ONHOLD); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.STOPPED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.EventStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PREPARATION: + tgt.setValue(Enumerations.EventStatus.PREPARATION); + break; + case INPROGRESS: + tgt.setValue(Enumerations.EventStatus.INPROGRESS); + break; + case NOTDONE: + tgt.setValue(Enumerations.EventStatus.NOTDONE); + break; + case ONHOLD: + tgt.setValue(Enumerations.EventStatus.ONHOLD); + break; + case STOPPED: + tgt.setValue(Enumerations.EventStatus.STOPPED); + break; + case COMPLETED: + tgt.setValue(Enumerations.EventStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.EventStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Enumerations.EventStatus.UNKNOWN); + break; + default: + tgt.setValue(Enumerations.EventStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertProcedureStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Procedure.ProcedureStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PREPARATION: - tgt.setValue(org.hl7.fhir.r4.model.Procedure.ProcedureStatus.PREPARATION); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r4.model.Procedure.ProcedureStatus.INPROGRESS); - break; - case NOTDONE: - tgt.setValue(org.hl7.fhir.r4.model.Procedure.ProcedureStatus.NOTDONE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r4.model.Procedure.ProcedureStatus.ONHOLD); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r4.model.Procedure.ProcedureStatus.STOPPED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.Procedure.ProcedureStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Procedure.ProcedureStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.Procedure.ProcedureStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Procedure.ProcedureStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new Procedure.ProcedureStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PREPARATION: + tgt.setValue(Procedure.ProcedureStatus.PREPARATION); + break; + case INPROGRESS: + tgt.setValue(Procedure.ProcedureStatus.INPROGRESS); + break; + case NOTDONE: + tgt.setValue(Procedure.ProcedureStatus.NOTDONE); + break; + case ONHOLD: + tgt.setValue(Procedure.ProcedureStatus.ONHOLD); + break; + case STOPPED: + tgt.setValue(Procedure.ProcedureStatus.STOPPED); + break; + case COMPLETED: + tgt.setValue(Procedure.ProcedureStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(Procedure.ProcedureStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Procedure.ProcedureStatus.UNKNOWN); + break; + default: + tgt.setValue(Procedure.ProcedureStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Procedure.ProcedurePerformerComponent convertProcedurePerformerComponent(org.hl7.fhir.r4.model.Procedure.ProcedurePerformerComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Provenance40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Provenance40_50.java index 65bd04a536..1dee38deec 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Provenance40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Provenance40_50.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Provenance; /* Copyright (c) 2011+, HL7, Inc. @@ -152,58 +154,66 @@ public static org.hl7.fhir.r4.model.Provenance.ProvenanceEntityComponent convert } static public org.hl7.fhir.r5.model.Enumeration convertProvenanceEntityRole(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRoleEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case DERIVATION: - tgt.setValue(org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRole.INSTANTIATES); - break; - case REVISION: - tgt.setValue(org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRole.REVISION); - break; - case QUOTATION: - tgt.setValue(org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRole.QUOTATION); - break; - case SOURCE: - tgt.setValue(org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRole.SOURCE); - break; - case REMOVAL: - tgt.setValue(org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRole.REMOVAL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRole.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Provenance.ProvenanceEntityRoleEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DERIVATION: + tgt.setValue(Provenance.ProvenanceEntityRole.INSTANTIATES); + break; + case REVISION: + tgt.setValue(Provenance.ProvenanceEntityRole.REVISION); + break; + case QUOTATION: + tgt.setValue(Provenance.ProvenanceEntityRole.QUOTATION); + break; + case SOURCE: + tgt.setValue(Provenance.ProvenanceEntityRole.SOURCE); + break; + case REMOVAL: + tgt.setValue(Provenance.ProvenanceEntityRole.REMOVAL); + break; + default: + tgt.setValue(Provenance.ProvenanceEntityRole.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertProvenanceEntityRole(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Provenance.ProvenanceEntityRoleEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANTIATES: - tgt.setValue(org.hl7.fhir.r4.model.Provenance.ProvenanceEntityRole.DERIVATION); - break; - case REVISION: - tgt.setValue(org.hl7.fhir.r4.model.Provenance.ProvenanceEntityRole.REVISION); - break; - case QUOTATION: - tgt.setValue(org.hl7.fhir.r4.model.Provenance.ProvenanceEntityRole.QUOTATION); - break; - case SOURCE: - tgt.setValue(org.hl7.fhir.r4.model.Provenance.ProvenanceEntityRole.SOURCE); - break; - case REMOVAL: - tgt.setValue(org.hl7.fhir.r4.model.Provenance.ProvenanceEntityRole.REMOVAL); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Provenance.ProvenanceEntityRole.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Provenance.ProvenanceEntityRoleEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANTIATES: + tgt.setValue(org.hl7.fhir.r4.model.Provenance.ProvenanceEntityRole.DERIVATION); + break; + case REVISION: + tgt.setValue(org.hl7.fhir.r4.model.Provenance.ProvenanceEntityRole.REVISION); + break; + case QUOTATION: + tgt.setValue(org.hl7.fhir.r4.model.Provenance.ProvenanceEntityRole.QUOTATION); + break; + case SOURCE: + tgt.setValue(org.hl7.fhir.r4.model.Provenance.ProvenanceEntityRole.SOURCE); + break; + case REMOVAL: + tgt.setValue(org.hl7.fhir.r4.model.Provenance.ProvenanceEntityRole.REMOVAL); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Provenance.ProvenanceEntityRole.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Questionnaire40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Questionnaire40_50.java index 680f314181..c8cbf9ce6f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Questionnaire40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Questionnaire40_50.java @@ -20,6 +20,8 @@ import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType; import org.hl7.fhir.r5.model.CodeType; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Questionnaire; import org.hl7.fhir.r5.model.Questionnaire.QuestionnaireAnswerConstraint; /* @@ -239,68 +241,72 @@ public static org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemComponent con } static public org.hl7.fhir.r5.model.Enumeration convertQuestionnaireItemType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - tgt.addExtension(VersionConvertorConstants.EXT_QUESTIONNAIRE_ITEM_TYPE_ORIGINAL, new CodeType(src.getValueAsString())); - switch (src.getValue()) { - case GROUP: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.GROUP); - break; - case DISPLAY: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.DISPLAY); - break; - case QUESTION: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.GROUP); - break; - case BOOLEAN: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.BOOLEAN); - break; - case DECIMAL: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.DECIMAL); - break; - case INTEGER: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.INTEGER); - break; - case DATE: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.DATE); - break; - case DATETIME: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.DATETIME); - break; - case TIME: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.TIME); - break; - case STRING: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.STRING); - break; - case TEXT: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.TEXT); - break; - case URL: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.URL); - break; - case CHOICE: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.CODING); - break; - case OPENCHOICE: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.CODING); - break; - case ATTACHMENT: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.ATTACHMENT); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.REFERENCE); - break; - case QUANTITY: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.QUANTITY); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Questionnaire.QuestionnaireItemTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + tgt.addExtension(VersionConvertorConstants.EXT_QUESTIONNAIRE_ITEM_TYPE_ORIGINAL, new CodeType(src.getValueAsString())); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case GROUP: + tgt.setValue(Questionnaire.QuestionnaireItemType.GROUP); + break; + case DISPLAY: + tgt.setValue(Questionnaire.QuestionnaireItemType.DISPLAY); + break; + case QUESTION: + tgt.setValue(Questionnaire.QuestionnaireItemType.GROUP); + break; + case BOOLEAN: + tgt.setValue(Questionnaire.QuestionnaireItemType.BOOLEAN); + break; + case DECIMAL: + tgt.setValue(Questionnaire.QuestionnaireItemType.DECIMAL); + break; + case INTEGER: + tgt.setValue(Questionnaire.QuestionnaireItemType.INTEGER); + break; + case DATE: + tgt.setValue(Questionnaire.QuestionnaireItemType.DATE); + break; + case DATETIME: + tgt.setValue(Questionnaire.QuestionnaireItemType.DATETIME); + break; + case TIME: + tgt.setValue(Questionnaire.QuestionnaireItemType.TIME); + break; + case STRING: + tgt.setValue(Questionnaire.QuestionnaireItemType.STRING); + break; + case TEXT: + tgt.setValue(Questionnaire.QuestionnaireItemType.TEXT); + break; + case URL: + tgt.setValue(Questionnaire.QuestionnaireItemType.URL); + break; + case CHOICE: + tgt.setValue(Questionnaire.QuestionnaireItemType.CODING); + break; + case OPENCHOICE: + tgt.setValue(Questionnaire.QuestionnaireItemType.CODING); + break; + case ATTACHMENT: + tgt.setValue(Questionnaire.QuestionnaireItemType.ATTACHMENT); + break; + case REFERENCE: + tgt.setValue(Questionnaire.QuestionnaireItemType.REFERENCE); + break; + case QUANTITY: + tgt.setValue(Questionnaire.QuestionnaireItemType.QUANTITY); + break; + default: + tgt.setValue(Questionnaire.QuestionnaireItemType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertQuestionnaireItemType(org.hl7.fhir.r5.model.Enumeration src, QuestionnaireAnswerConstraint constraint) throws FHIRException { @@ -311,100 +317,112 @@ static public org.hl7.fhir.r4.model.Enumeration convertEnableWhenBehavior(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Questionnaire.EnableWhenBehaviorEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ALL: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.EnableWhenBehavior.ALL); - break; - case ANY: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.EnableWhenBehavior.ANY); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.EnableWhenBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Questionnaire.EnableWhenBehaviorEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ALL: + tgt.setValue(Questionnaire.EnableWhenBehavior.ALL); + break; + case ANY: + tgt.setValue(Questionnaire.EnableWhenBehavior.ANY); + break; + default: + tgt.setValue(Questionnaire.EnableWhenBehavior.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertEnableWhenBehavior(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Questionnaire.EnableWhenBehaviorEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ALL: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.EnableWhenBehavior.ALL); - break; - case ANY: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.EnableWhenBehavior.ANY); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.EnableWhenBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Questionnaire.EnableWhenBehaviorEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ALL: + tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.EnableWhenBehavior.ALL); + break; + case ANY: + tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.EnableWhenBehavior.ANY); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.EnableWhenBehavior.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemEnableWhenComponent convertQuestionnaireItemEnableWhenComponent(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemEnableWhenComponent src) throws FHIRException { @@ -436,71 +454,79 @@ public static org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemEnableWhenCom } static public org.hl7.fhir.r5.model.Enumeration convertQuestionnaireItemOperator(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemOperatorEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case EXISTS: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemOperator.EXISTS); - break; - case EQUAL: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemOperator.EQUAL); - break; - case NOT_EQUAL: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemOperator.NOT_EQUAL); - break; - case GREATER_THAN: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemOperator.GREATER_THAN); - break; - case LESS_THAN: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemOperator.LESS_THAN); - break; - case GREATER_OR_EQUAL: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemOperator.GREATER_OR_EQUAL); - break; - case LESS_OR_EQUAL: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemOperator.LESS_OR_EQUAL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemOperator.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Questionnaire.QuestionnaireItemOperatorEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EXISTS: + tgt.setValue(Questionnaire.QuestionnaireItemOperator.EXISTS); + break; + case EQUAL: + tgt.setValue(Questionnaire.QuestionnaireItemOperator.EQUAL); + break; + case NOT_EQUAL: + tgt.setValue(Questionnaire.QuestionnaireItemOperator.NOT_EQUAL); + break; + case GREATER_THAN: + tgt.setValue(Questionnaire.QuestionnaireItemOperator.GREATER_THAN); + break; + case LESS_THAN: + tgt.setValue(Questionnaire.QuestionnaireItemOperator.LESS_THAN); + break; + case GREATER_OR_EQUAL: + tgt.setValue(Questionnaire.QuestionnaireItemOperator.GREATER_OR_EQUAL); + break; + case LESS_OR_EQUAL: + tgt.setValue(Questionnaire.QuestionnaireItemOperator.LESS_OR_EQUAL); + break; + default: + tgt.setValue(Questionnaire.QuestionnaireItemOperator.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertQuestionnaireItemOperator(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperatorEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case EXISTS: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator.EXISTS); - break; - case EQUAL: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator.EQUAL); - break; - case NOT_EQUAL: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator.NOT_EQUAL); - break; - case GREATER_THAN: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator.GREATER_THAN); - break; - case LESS_THAN: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator.LESS_THAN); - break; - case GREATER_OR_EQUAL: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator.GREATER_OR_EQUAL); - break; - case LESS_OR_EQUAL: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator.LESS_OR_EQUAL); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperatorEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EXISTS: + tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator.EXISTS); + break; + case EQUAL: + tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator.EQUAL); + break; + case NOT_EQUAL: + tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator.NOT_EQUAL); + break; + case GREATER_THAN: + tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator.GREATER_THAN); + break; + case LESS_THAN: + tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator.LESS_THAN); + break; + case GREATER_OR_EQUAL: + tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator.GREATER_OR_EQUAL); + break; + case LESS_OR_EQUAL: + tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator.LESS_OR_EQUAL); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemAnswerOptionComponent convertQuestionnaireItemAnswerOptionComponent(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemAnswerOptionComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/QuestionnaireResponse40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/QuestionnaireResponse40_50.java index 8f5af17d07..bb3239f3e2 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/QuestionnaireResponse40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/QuestionnaireResponse40_50.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Uri40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.QuestionnaireResponse; /* Copyright (c) 2011+, HL7, Inc. @@ -97,59 +99,67 @@ public static org.hl7.fhir.r4.model.QuestionnaireResponse convertQuestionnaireRe } static public org.hl7.fhir.r5.model.Enumeration convertQuestionnaireResponseStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.ENTEREDINERROR); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.STOPPED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED); + break; + case AMENDED: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED); + break; + case ENTEREDINERROR: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.ENTEREDINERROR); + break; + case STOPPED: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.STOPPED); + break; + default: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertQuestionnaireResponseStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.ENTEREDINERROR); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.STOPPED); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED); + break; + case AMENDED: + tgt.setValue(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.ENTEREDINERROR); + break; + case STOPPED: + tgt.setValue(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.STOPPED); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent convertQuestionnaireResponseItemComponent(org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/RiskAssessment40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/RiskAssessment40_50.java index 2f0e895d69..8d19f4cfaf 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/RiskAssessment40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/RiskAssessment40_50.java @@ -8,7 +8,10 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.RiskAssessment; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -124,77 +127,85 @@ public static org.hl7.fhir.r4.model.RiskAssessment convertRiskAssessment(org.hl7 } static public org.hl7.fhir.r5.model.Enumeration convertRiskAssessmentStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ObservationStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.REGISTERED); - break; - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.AMENDED); - break; - case CORRECTED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.CORRECTED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ObservationStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(Enumerations.ObservationStatus.REGISTERED); + break; + case PRELIMINARY: + tgt.setValue(Enumerations.ObservationStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(Enumerations.ObservationStatus.FINAL); + break; + case AMENDED: + tgt.setValue(Enumerations.ObservationStatus.AMENDED); + break; + case CORRECTED: + tgt.setValue(Enumerations.ObservationStatus.CORRECTED); + break; + case CANCELLED: + tgt.setValue(Enumerations.ObservationStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.ObservationStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Enumerations.ObservationStatus.UNKNOWN); + break; + default: + tgt.setValue(Enumerations.ObservationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertRiskAssessmentStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.REGISTERED); - break; - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.AMENDED); - break; - case CORRECTED: - tgt.setValue(org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.CORRECTED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new RiskAssessment.RiskAssessmentStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(RiskAssessment.RiskAssessmentStatus.REGISTERED); + break; + case PRELIMINARY: + tgt.setValue(RiskAssessment.RiskAssessmentStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(RiskAssessment.RiskAssessmentStatus.FINAL); + break; + case AMENDED: + tgt.setValue(RiskAssessment.RiskAssessmentStatus.AMENDED); + break; + case CORRECTED: + tgt.setValue(RiskAssessment.RiskAssessmentStatus.CORRECTED); + break; + case CANCELLED: + tgt.setValue(RiskAssessment.RiskAssessmentStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(RiskAssessment.RiskAssessmentStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(RiskAssessment.RiskAssessmentStatus.UNKNOWN); + break; + default: + tgt.setValue(RiskAssessment.RiskAssessmentStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.RiskAssessment.RiskAssessmentPredictionComponent convertRiskAssessmentPredictionComponent(org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentPredictionComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/SearchParameter40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/SearchParameter40_50.java index 06455d23a6..11ddd8c70a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/SearchParameter40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/SearchParameter40_50.java @@ -15,8 +15,10 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Uri40_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; import org.hl7.fhir.r5.model.Enumerations.VersionIndependentResourceTypesAll; import org.hl7.fhir.r5.model.Enumerations.VersionIndependentResourceTypesAllEnumFactory; +import org.hl7.fhir.r5.model.SearchParameter; /* Copyright (c) 2011+, HL7, Inc. @@ -168,231 +170,255 @@ public static org.hl7.fhir.r4.model.SearchParameter convertSearchParameter(org.h } static public org.hl7.fhir.r5.model.Enumeration convertXPathUsageType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case NORMAL: - tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.NORMAL); - break; - case PHONETIC: - tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.PHONETIC); - break; - case NEARBY: - tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.OTHER); - break; - case DISTANCE: - tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.OTHER); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new SearchParameter.SearchProcessingModeTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NORMAL: + tgt.setValue(SearchParameter.SearchProcessingModeType.NORMAL); + break; + case PHONETIC: + tgt.setValue(SearchParameter.SearchProcessingModeType.PHONETIC); + break; + case NEARBY: + tgt.setValue(SearchParameter.SearchProcessingModeType.OTHER); + break; + case DISTANCE: + tgt.setValue(SearchParameter.SearchProcessingModeType.OTHER); + break; + case OTHER: + tgt.setValue(SearchParameter.SearchProcessingModeType.OTHER); + break; + default: + tgt.setValue(SearchParameter.SearchProcessingModeType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertXPathUsageType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.SearchParameter.XPathUsageTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case NORMAL: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.NORMAL); - break; - case PHONETIC: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.PHONETIC); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.SearchParameter.XPathUsageTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NORMAL: + tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.NORMAL); + break; + case PHONETIC: + tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.PHONETIC); + break; + case OTHER: + tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.OTHER); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertSearchComparator(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.SearchComparatorEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case EQ: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchComparator.EQ); - break; - case NE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchComparator.NE); - break; - case GT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchComparator.GT); - break; - case LT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchComparator.LT); - break; - case GE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchComparator.GE); - break; - case LE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchComparator.LE); - break; - case SA: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchComparator.SA); - break; - case EB: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchComparator.EB); - break; - case AP: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchComparator.AP); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchComparator.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.SearchComparatorEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQ: + tgt.setValue(Enumerations.SearchComparator.EQ); + break; + case NE: + tgt.setValue(Enumerations.SearchComparator.NE); + break; + case GT: + tgt.setValue(Enumerations.SearchComparator.GT); + break; + case LT: + tgt.setValue(Enumerations.SearchComparator.LT); + break; + case GE: + tgt.setValue(Enumerations.SearchComparator.GE); + break; + case LE: + tgt.setValue(Enumerations.SearchComparator.LE); + break; + case SA: + tgt.setValue(Enumerations.SearchComparator.SA); + break; + case EB: + tgt.setValue(Enumerations.SearchComparator.EB); + break; + case AP: + tgt.setValue(Enumerations.SearchComparator.AP); + break; + default: + tgt.setValue(Enumerations.SearchComparator.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertSearchComparator(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.SearchParameter.SearchComparatorEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case EQ: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.EQ); - break; - case NE: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.NE); - break; - case GT: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.GT); - break; - case LT: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.LT); - break; - case GE: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.GE); - break; - case LE: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.LE); - break; - case SA: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.SA); - break; - case EB: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.EB); - break; - case AP: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.AP); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.SearchParameter.SearchComparatorEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQ: + tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.EQ); + break; + case NE: + tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.NE); + break; + case GT: + tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.GT); + break; + case LT: + tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.LT); + break; + case GE: + tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.GE); + break; + case LE: + tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.LE); + break; + case SA: + tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.SA); + break; + case EB: + tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.EB); + break; + case AP: + tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.AP); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertSearchModifierCode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.SearchModifierCodeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case MISSING: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.MISSING); - break; - case EXACT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.EXACT); - break; - case CONTAINS: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.CONTAINS); - break; - case NOT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.NOT); - break; - case TEXT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.TEXT); - break; - case IN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.NOTIN); - break; - case BELOW: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.BELOW); - break; - case ABOVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.ABOVE); - break; - case TYPE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.TYPE); - break; - case IDENTIFIER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.IDENTIFIER); - break; - case OFTYPE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.OFTYPE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.SearchModifierCodeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MISSING: + tgt.setValue(Enumerations.SearchModifierCode.MISSING); + break; + case EXACT: + tgt.setValue(Enumerations.SearchModifierCode.EXACT); + break; + case CONTAINS: + tgt.setValue(Enumerations.SearchModifierCode.CONTAINS); + break; + case NOT: + tgt.setValue(Enumerations.SearchModifierCode.NOT); + break; + case TEXT: + tgt.setValue(Enumerations.SearchModifierCode.TEXT); + break; + case IN: + tgt.setValue(Enumerations.SearchModifierCode.IN); + break; + case NOTIN: + tgt.setValue(Enumerations.SearchModifierCode.NOTIN); + break; + case BELOW: + tgt.setValue(Enumerations.SearchModifierCode.BELOW); + break; + case ABOVE: + tgt.setValue(Enumerations.SearchModifierCode.ABOVE); + break; + case TYPE: + tgt.setValue(Enumerations.SearchModifierCode.TYPE); + break; + case IDENTIFIER: + tgt.setValue(Enumerations.SearchModifierCode.IDENTIFIER); + break; + case OFTYPE: + tgt.setValue(Enumerations.SearchModifierCode.OFTYPE); + break; + default: + tgt.setValue(Enumerations.SearchModifierCode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertSearchModifierCode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.SearchParameter.SearchModifierCodeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case MISSING: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.MISSING); - break; - case EXACT: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.EXACT); - break; - case CONTAINS: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.CONTAINS); - break; - case NOT: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.NOT); - break; - case TEXT: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.TEXT); - break; - case IN: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.NOTIN); - break; - case BELOW: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.BELOW); - break; - case ABOVE: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.ABOVE); - break; - case TYPE: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.TYPE); - break; - case IDENTIFIER: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.IDENTIFIER); - break; - case OFTYPE: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.OFTYPE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.SearchParameter.SearchModifierCodeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MISSING: + tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.MISSING); + break; + case EXACT: + tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.EXACT); + break; + case CONTAINS: + tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.CONTAINS); + break; + case NOT: + tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.NOT); + break; + case TEXT: + tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.TEXT); + break; + case IN: + tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.IN); + break; + case NOTIN: + tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.NOTIN); + break; + case BELOW: + tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.BELOW); + break; + case ABOVE: + tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.ABOVE); + break; + case TYPE: + tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.TYPE); + break; + case IDENTIFIER: + tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.IDENTIFIER); + break; + case OFTYPE: + tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.OFTYPE); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.SearchParameter.SearchParameterComponentComponent convertSearchParameterComponentComponent(org.hl7.fhir.r4.model.SearchParameter.SearchParameterComponentComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ServiceRequest40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ServiceRequest40_50.java index d750ffef27..651f215ff6 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ServiceRequest40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ServiceRequest40_50.java @@ -11,7 +11,10 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Uri40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.ServiceRequest; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; import org.hl7.fhir.r5.model.ServiceRequest.ServiceRequestOrderDetailComponent; /* @@ -190,200 +193,224 @@ public static org.hl7.fhir.r4.model.ServiceRequest convertServiceRequest(org.hl7 } static public org.hl7.fhir.r5.model.Enumeration convertServiceRequestStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ONHOLD); - break; - case REVOKED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.REVOKED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.RequestStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(Enumerations.RequestStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(Enumerations.RequestStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(Enumerations.RequestStatus.ONHOLD); + break; + case REVOKED: + tgt.setValue(Enumerations.RequestStatus.REVOKED); + break; + case COMPLETED: + tgt.setValue(Enumerations.RequestStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.RequestStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Enumerations.RequestStatus.UNKNOWN); + break; + default: + tgt.setValue(Enumerations.RequestStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertServiceRequestStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus.ONHOLD); - break; - case REVOKED: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus.REVOKED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new ServiceRequest.ServiceRequestStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(ServiceRequest.ServiceRequestStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(ServiceRequest.ServiceRequestStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(ServiceRequest.ServiceRequestStatus.ONHOLD); + break; + case REVOKED: + tgt.setValue(ServiceRequest.ServiceRequestStatus.REVOKED); + break; + case COMPLETED: + tgt.setValue(ServiceRequest.ServiceRequestStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(ServiceRequest.ServiceRequestStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(ServiceRequest.ServiceRequestStatus.UNKNOWN); + break; + default: + tgt.setValue(ServiceRequest.ServiceRequestStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertServiceRequestIntent(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestIntentEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.PROPOSAL); - break; - case PLAN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.PLAN); - break; - case DIRECTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.DIRECTIVE); - break; - case ORDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORDER); - break; - case ORIGINALORDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORIGINALORDER); - break; - case REFLEXORDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.REFLEXORDER); - break; - case FILLERORDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.FILLERORDER); - break; - case INSTANCEORDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.INSTANCEORDER); - break; - case OPTION: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.OPTION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.RequestIntentEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSAL: + tgt.setValue(Enumerations.RequestIntent.PROPOSAL); + break; + case PLAN: + tgt.setValue(Enumerations.RequestIntent.PLAN); + break; + case DIRECTIVE: + tgt.setValue(Enumerations.RequestIntent.DIRECTIVE); + break; + case ORDER: + tgt.setValue(Enumerations.RequestIntent.ORDER); + break; + case ORIGINALORDER: + tgt.setValue(Enumerations.RequestIntent.ORIGINALORDER); + break; + case REFLEXORDER: + tgt.setValue(Enumerations.RequestIntent.REFLEXORDER); + break; + case FILLERORDER: + tgt.setValue(Enumerations.RequestIntent.FILLERORDER); + break; + case INSTANCEORDER: + tgt.setValue(Enumerations.RequestIntent.INSTANCEORDER); + break; + case OPTION: + tgt.setValue(Enumerations.RequestIntent.OPTION); + break; + default: + tgt.setValue(Enumerations.RequestIntent.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertServiceRequestIntent(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntentEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSAL: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.PROPOSAL); - break; - case PLAN: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.PLAN); - break; - case DIRECTIVE: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.DIRECTIVE); - break; - case ORDER: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.ORDER); - break; - case ORIGINALORDER: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.ORIGINALORDER); - break; - case REFLEXORDER: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.REFLEXORDER); - break; - case FILLERORDER: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.FILLERORDER); - break; - case INSTANCEORDER: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.INSTANCEORDER); - break; - case OPTION: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.OPTION); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new ServiceRequest.ServiceRequestIntentEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSAL: + tgt.setValue(ServiceRequest.ServiceRequestIntent.PROPOSAL); + break; + case PLAN: + tgt.setValue(ServiceRequest.ServiceRequestIntent.PLAN); + break; + case DIRECTIVE: + tgt.setValue(ServiceRequest.ServiceRequestIntent.DIRECTIVE); + break; + case ORDER: + tgt.setValue(ServiceRequest.ServiceRequestIntent.ORDER); + break; + case ORIGINALORDER: + tgt.setValue(ServiceRequest.ServiceRequestIntent.ORIGINALORDER); + break; + case REFLEXORDER: + tgt.setValue(ServiceRequest.ServiceRequestIntent.REFLEXORDER); + break; + case FILLERORDER: + tgt.setValue(ServiceRequest.ServiceRequestIntent.FILLERORDER); + break; + case INSTANCEORDER: + tgt.setValue(ServiceRequest.ServiceRequestIntent.INSTANCEORDER); + break; + case OPTION: + tgt.setValue(ServiceRequest.ServiceRequestIntent.OPTION); + break; + default: + tgt.setValue(ServiceRequest.ServiceRequestIntent.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertServiceRequestPriority(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestPriorityEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP); - break; - case STAT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.RequestPriorityEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(Enumerations.RequestPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(Enumerations.RequestPriority.URGENT); + break; + case ASAP: + tgt.setValue(Enumerations.RequestPriority.ASAP); + break; + case STAT: + tgt.setValue(Enumerations.RequestPriority.STAT); + break; + default: + tgt.setValue(Enumerations.RequestPriority.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertServiceRequestPriority(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestPriorityEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestPriority.URGENT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestPriority.ASAP); - break; - case STAT: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestPriority.STAT); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new ServiceRequest.ServiceRequestPriorityEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(ServiceRequest.ServiceRequestPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(ServiceRequest.ServiceRequestPriority.URGENT); + break; + case ASAP: + tgt.setValue(ServiceRequest.ServiceRequestPriority.ASAP); + break; + case STAT: + tgt.setValue(ServiceRequest.ServiceRequestPriority.STAT); + break; + default: + tgt.setValue(ServiceRequest.ServiceRequestPriority.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Slot40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Slot40_50.java index d72838c8e3..d0ae0ed249 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Slot40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Slot40_50.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Slot; /* Copyright (c) 2011+, HL7, Inc. @@ -103,58 +105,66 @@ public static org.hl7.fhir.r4.model.Slot convertSlot(org.hl7.fhir.r5.model.Slot } static public org.hl7.fhir.r5.model.Enumeration convertSlotStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Slot.SlotStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case BUSY: - tgt.setValue(org.hl7.fhir.r5.model.Slot.SlotStatus.BUSY); - break; - case FREE: - tgt.setValue(org.hl7.fhir.r5.model.Slot.SlotStatus.FREE); - break; - case BUSYUNAVAILABLE: - tgt.setValue(org.hl7.fhir.r5.model.Slot.SlotStatus.BUSYUNAVAILABLE); - break; - case BUSYTENTATIVE: - tgt.setValue(org.hl7.fhir.r5.model.Slot.SlotStatus.BUSYTENTATIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Slot.SlotStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Slot.SlotStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Slot.SlotStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case BUSY: + tgt.setValue(Slot.SlotStatus.BUSY); + break; + case FREE: + tgt.setValue(Slot.SlotStatus.FREE); + break; + case BUSYUNAVAILABLE: + tgt.setValue(Slot.SlotStatus.BUSYUNAVAILABLE); + break; + case BUSYTENTATIVE: + tgt.setValue(Slot.SlotStatus.BUSYTENTATIVE); + break; + case ENTEREDINERROR: + tgt.setValue(Slot.SlotStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Slot.SlotStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertSlotStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Slot.SlotStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case BUSY: - tgt.setValue(org.hl7.fhir.r4.model.Slot.SlotStatus.BUSY); - break; - case FREE: - tgt.setValue(org.hl7.fhir.r4.model.Slot.SlotStatus.FREE); - break; - case BUSYUNAVAILABLE: - tgt.setValue(org.hl7.fhir.r4.model.Slot.SlotStatus.BUSYUNAVAILABLE); - break; - case BUSYTENTATIVE: - tgt.setValue(org.hl7.fhir.r4.model.Slot.SlotStatus.BUSYTENTATIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Slot.SlotStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Slot.SlotStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Slot.SlotStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case BUSY: + tgt.setValue(org.hl7.fhir.r4.model.Slot.SlotStatus.BUSY); + break; + case FREE: + tgt.setValue(org.hl7.fhir.r4.model.Slot.SlotStatus.FREE); + break; + case BUSYUNAVAILABLE: + tgt.setValue(org.hl7.fhir.r4.model.Slot.SlotStatus.BUSYUNAVAILABLE); + break; + case BUSYTENTATIVE: + tgt.setValue(org.hl7.fhir.r4.model.Slot.SlotStatus.BUSYTENTATIVE); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.Slot.SlotStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Slot.SlotStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Specimen40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Specimen40_50.java index 0c66e42fe3..950c2b7e67 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Specimen40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Specimen40_50.java @@ -10,6 +10,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Specimen; /* Copyright (c) 2011+, HL7, Inc. @@ -105,53 +107,61 @@ public static org.hl7.fhir.r4.model.Specimen convertSpecimen(org.hl7.fhir.r5.mod } static public org.hl7.fhir.r5.model.Enumeration convertSpecimenStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Specimen.SpecimenStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case AVAILABLE: - tgt.setValue(org.hl7.fhir.r5.model.Specimen.SpecimenStatus.AVAILABLE); - break; - case UNAVAILABLE: - tgt.setValue(org.hl7.fhir.r5.model.Specimen.SpecimenStatus.UNAVAILABLE); - break; - case UNSATISFACTORY: - tgt.setValue(org.hl7.fhir.r5.model.Specimen.SpecimenStatus.UNSATISFACTORY); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Specimen.SpecimenStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Specimen.SpecimenStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Specimen.SpecimenStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case AVAILABLE: + tgt.setValue(Specimen.SpecimenStatus.AVAILABLE); + break; + case UNAVAILABLE: + tgt.setValue(Specimen.SpecimenStatus.UNAVAILABLE); + break; + case UNSATISFACTORY: + tgt.setValue(Specimen.SpecimenStatus.UNSATISFACTORY); + break; + case ENTEREDINERROR: + tgt.setValue(Specimen.SpecimenStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Specimen.SpecimenStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertSpecimenStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Specimen.SpecimenStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case AVAILABLE: - tgt.setValue(org.hl7.fhir.r4.model.Specimen.SpecimenStatus.AVAILABLE); - break; - case UNAVAILABLE: - tgt.setValue(org.hl7.fhir.r4.model.Specimen.SpecimenStatus.UNAVAILABLE); - break; - case UNSATISFACTORY: - tgt.setValue(org.hl7.fhir.r4.model.Specimen.SpecimenStatus.UNSATISFACTORY); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Specimen.SpecimenStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Specimen.SpecimenStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Specimen.SpecimenStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case AVAILABLE: + tgt.setValue(org.hl7.fhir.r4.model.Specimen.SpecimenStatus.AVAILABLE); + break; + case UNAVAILABLE: + tgt.setValue(org.hl7.fhir.r4.model.Specimen.SpecimenStatus.UNAVAILABLE); + break; + case UNSATISFACTORY: + tgt.setValue(org.hl7.fhir.r4.model.Specimen.SpecimenStatus.UNSATISFACTORY); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.Specimen.SpecimenStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Specimen.SpecimenStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Specimen.SpecimenCollectionComponent convertSpecimenCollectionComponent(org.hl7.fhir.r4.model.Specimen.SpecimenCollectionComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/SpecimenDefinition40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/SpecimenDefinition40_50.java index 6b403b1e86..9296b9abe5 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/SpecimenDefinition40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/SpecimenDefinition40_50.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Boolean40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.SpecimenDefinition; /* Copyright (c) 2011+, HL7, Inc. @@ -130,41 +132,49 @@ public static org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenDefinitionTypeTes } static public org.hl7.fhir.r5.model.Enumeration convertSpecimenContainedPreference(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenContainedPreferenceEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PREFERRED: - tgt.setValue(org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenContainedPreference.PREFERRED); - break; - case ALTERNATE: - tgt.setValue(org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenContainedPreference.ALTERNATE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenContainedPreference.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new SpecimenDefinition.SpecimenContainedPreferenceEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PREFERRED: + tgt.setValue(SpecimenDefinition.SpecimenContainedPreference.PREFERRED); + break; + case ALTERNATE: + tgt.setValue(SpecimenDefinition.SpecimenContainedPreference.ALTERNATE); + break; + default: + tgt.setValue(SpecimenDefinition.SpecimenContainedPreference.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertSpecimenContainedPreference(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenContainedPreferenceEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PREFERRED: - tgt.setValue(org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenContainedPreference.PREFERRED); - break; - case ALTERNATE: - tgt.setValue(org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenContainedPreference.ALTERNATE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenContainedPreference.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenContainedPreferenceEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PREFERRED: + tgt.setValue(org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenContainedPreference.PREFERRED); + break; + case ALTERNATE: + tgt.setValue(org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenContainedPreference.ALTERNATE); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenContainedPreference.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerComponent convertSpecimenDefinitionTypeTestedContainerComponent(org.hl7.fhir.r4.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/StructureDefinition40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/StructureDefinition40_50.java index 603384d126..76135e03d5 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/StructureDefinition40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/StructureDefinition40_50.java @@ -15,6 +15,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Uri40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.ElementDefinition40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.StructureDefinition; /* Copyright (c) 2011+, HL7, Inc. @@ -170,91 +172,107 @@ public static org.hl7.fhir.r4.model.StructureDefinition convertStructureDefiniti } static public org.hl7.fhir.r5.model.Enumeration convertStructureDefinitionKind(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKindEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PRIMITIVETYPE: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind.PRIMITIVETYPE); - break; - case COMPLEXTYPE: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind.COMPLEXTYPE); - break; - case RESOURCE: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind.RESOURCE); - break; - case LOGICAL: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind.LOGICAL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureDefinition.StructureDefinitionKindEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRIMITIVETYPE: + tgt.setValue(StructureDefinition.StructureDefinitionKind.PRIMITIVETYPE); + break; + case COMPLEXTYPE: + tgt.setValue(StructureDefinition.StructureDefinitionKind.COMPLEXTYPE); + break; + case RESOURCE: + tgt.setValue(StructureDefinition.StructureDefinitionKind.RESOURCE); + break; + case LOGICAL: + tgt.setValue(StructureDefinition.StructureDefinitionKind.LOGICAL); + break; + default: + tgt.setValue(StructureDefinition.StructureDefinitionKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertStructureDefinitionKind(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKindEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PRIMITIVETYPE: - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind.PRIMITIVETYPE); - break; - case COMPLEXTYPE: - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind.COMPLEXTYPE); - break; - case RESOURCE: - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind.RESOURCE); - break; - case LOGICAL: - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind.LOGICAL); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKindEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRIMITIVETYPE: + tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind.PRIMITIVETYPE); + break; + case COMPLEXTYPE: + tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind.COMPLEXTYPE); + break; + case RESOURCE: + tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind.RESOURCE); + break; + case LOGICAL: + tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind.LOGICAL); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertTypeDerivationRule(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRuleEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case SPECIALIZATION: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule.SPECIALIZATION); - break; - case CONSTRAINT: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule.CONSTRAINT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureDefinition.TypeDerivationRuleEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SPECIALIZATION: + tgt.setValue(StructureDefinition.TypeDerivationRule.SPECIALIZATION); + break; + case CONSTRAINT: + tgt.setValue(StructureDefinition.TypeDerivationRule.CONSTRAINT); + break; + default: + tgt.setValue(StructureDefinition.TypeDerivationRule.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertTypeDerivationRule(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureDefinition.TypeDerivationRuleEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case SPECIALIZATION: - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.TypeDerivationRule.SPECIALIZATION); - break; - case CONSTRAINT: - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.TypeDerivationRule.CONSTRAINT); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.TypeDerivationRule.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureDefinition.TypeDerivationRuleEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SPECIALIZATION: + tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.TypeDerivationRule.SPECIALIZATION); + break; + case CONSTRAINT: + tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.TypeDerivationRule.CONSTRAINT); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.TypeDerivationRule.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionMappingComponent convertStructureDefinitionMappingComponent(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionMappingComponent src) throws FHIRException { @@ -314,47 +332,55 @@ public static org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionConte } static public org.hl7.fhir.r5.model.Enumeration convertExtensionContextType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case FHIRPATH: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextType.FHIRPATH); - break; - case ELEMENT: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextType.ELEMENT); - break; - case EXTENSION: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextType.EXTENSION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureDefinition.ExtensionContextTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FHIRPATH: + tgt.setValue(StructureDefinition.ExtensionContextType.FHIRPATH); + break; + case ELEMENT: + tgt.setValue(StructureDefinition.ExtensionContextType.ELEMENT); + break; + case EXTENSION: + tgt.setValue(StructureDefinition.ExtensionContextType.EXTENSION); + break; + default: + tgt.setValue(StructureDefinition.ExtensionContextType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertExtensionContextType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case FHIRPATH: - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextType.FHIRPATH); - break; - case ELEMENT: - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextType.ELEMENT); - break; - case EXTENSION: - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextType.EXTENSION); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FHIRPATH: + tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextType.FHIRPATH); + break; + case ELEMENT: + tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextType.ELEMENT); + break; + case EXTENSION: + tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextType.EXTENSION); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionSnapshotComponent convertStructureDefinitionSnapshotComponent(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionSnapshotComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/StructureMap40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/StructureMap40_50.java index 10c78837e7..572f13583f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/StructureMap40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/StructureMap40_50.java @@ -19,12 +19,7 @@ import org.hl7.fhir.r4.model.StructureMap.StructureMapGroupTypeMode; import org.hl7.fhir.r4.utils.ToolingExtensions; import org.hl7.fhir.r5.fhirpath.FHIRPathConstant; -import org.hl7.fhir.r5.model.BooleanType; -import org.hl7.fhir.r5.model.DataType; -import org.hl7.fhir.r5.model.DecimalType; -import org.hl7.fhir.r5.model.IdType; -import org.hl7.fhir.r5.model.IntegerType; -import org.hl7.fhir.r5.model.StringType; +import org.hl7.fhir.r5.model.*; import org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetParameterComponent; import org.hl7.fhir.utilities.Utilities; @@ -180,53 +175,61 @@ public static org.hl7.fhir.r4.model.StructureMap.StructureMapStructureComponent } static public org.hl7.fhir.r5.model.Enumeration convertStructureMapModelMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureMap.StructureMapModelModeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case SOURCE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapModelMode.SOURCE); - break; - case QUERIED: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapModelMode.QUERIED); - break; - case TARGET: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapModelMode.TARGET); - break; - case PRODUCED: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapModelMode.PRODUCED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapModelMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureMap.StructureMapModelModeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SOURCE: + tgt.setValue(StructureMap.StructureMapModelMode.SOURCE); + break; + case QUERIED: + tgt.setValue(StructureMap.StructureMapModelMode.QUERIED); + break; + case TARGET: + tgt.setValue(StructureMap.StructureMapModelMode.TARGET); + break; + case PRODUCED: + tgt.setValue(StructureMap.StructureMapModelMode.PRODUCED); + break; + default: + tgt.setValue(StructureMap.StructureMapModelMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertStructureMapModelMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureMap.StructureMapModelModeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case SOURCE: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode.SOURCE); - break; - case QUERIED: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode.QUERIED); - break; - case TARGET: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode.TARGET); - break; - case PRODUCED: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode.PRODUCED); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureMap.StructureMapModelModeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SOURCE: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode.SOURCE); + break; + case QUERIED: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode.QUERIED); + break; + case TARGET: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode.TARGET); + break; + case PRODUCED: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode.PRODUCED); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.StructureMap.StructureMapGroupComponent convertStructureMapGroupComponent(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupComponent src) throws FHIRException { @@ -273,45 +276,53 @@ public static org.hl7.fhir.r4.model.StructureMap.StructureMapGroupComponent conv } static public org.hl7.fhir.r5.model.Enumeration convertStructureMapGroupTypeMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureMap.StructureMapGroupTypeModeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case NONE: - return null; - case TYPES: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapGroupTypeMode.TYPES); - break; - case TYPEANDTYPES: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapGroupTypeMode.TYPEANDTYPES); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapGroupTypeMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureMap.StructureMapGroupTypeModeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NONE: + return null; + case TYPES: + tgt.setValue(StructureMap.StructureMapGroupTypeMode.TYPES); + break; + case TYPEANDTYPES: + tgt.setValue(StructureMap.StructureMapGroupTypeMode.TYPEANDTYPES); + break; + default: + tgt.setValue(StructureMap.StructureMapGroupTypeMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertStructureMapGroupTypeMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureMap.StructureMapGroupTypeModeEnumFactory()); - if (src == null || src.isEmpty()) { - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupTypeMode.NONE); + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureMap.StructureMapGroupTypeModeEnumFactory()); + if (src == null || src.isEmpty()) { + tgt.setValue(StructureMapGroupTypeMode.NONE); + return tgt; + } + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case TYPES: + tgt.setValue(StructureMapGroupTypeMode.TYPES); + break; + case TYPEANDTYPES: + tgt.setValue(StructureMapGroupTypeMode.TYPEANDTYPES); + break; + default: + tgt.setValue(StructureMapGroupTypeMode.NULL); + break; + } + } return tgt; - } - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case TYPES: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupTypeMode.TYPES); - break; - case TYPEANDTYPES: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupTypeMode.TYPEANDTYPES); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupTypeMode.NULL); - break; - } - return tgt; } public static org.hl7.fhir.r5.model.StructureMap.StructureMapGroupInputComponent convertStructureMapGroupInputComponent(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupInputComponent src) throws FHIRException { @@ -347,41 +358,49 @@ public static org.hl7.fhir.r4.model.StructureMap.StructureMapGroupInputComponent } static public org.hl7.fhir.r5.model.Enumeration convertStructureMapInputMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureMap.StructureMapInputModeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case SOURCE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapInputMode.SOURCE); - break; - case TARGET: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapInputMode.TARGET); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapInputMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureMap.StructureMapInputModeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SOURCE: + tgt.setValue(StructureMap.StructureMapInputMode.SOURCE); + break; + case TARGET: + tgt.setValue(StructureMap.StructureMapInputMode.TARGET); + break; + default: + tgt.setValue(StructureMap.StructureMapInputMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertStructureMapInputMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureMap.StructureMapInputModeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case SOURCE: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapInputMode.SOURCE); - break; - case TARGET: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapInputMode.TARGET); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapInputMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureMap.StructureMapInputModeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SOURCE: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapInputMode.SOURCE); + break; + case TARGET: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapInputMode.TARGET); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapInputMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleComponent convertStructureMapGroupRuleComponent(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleComponent src) throws FHIRException { @@ -485,59 +504,67 @@ public static org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleSourceComp } static public org.hl7.fhir.r5.model.Enumeration convertStructureMapSourceListMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListModeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case FIRST: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListMode.FIRST); - break; - case NOTFIRST: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListMode.NOTFIRST); - break; - case LAST: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListMode.LAST); - break; - case NOTLAST: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListMode.NOTLAST); - break; - case ONLYONE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListMode.ONLYONE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureMap.StructureMapSourceListModeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FIRST: + tgt.setValue(StructureMap.StructureMapSourceListMode.FIRST); + break; + case NOTFIRST: + tgt.setValue(StructureMap.StructureMapSourceListMode.NOTFIRST); + break; + case LAST: + tgt.setValue(StructureMap.StructureMapSourceListMode.LAST); + break; + case NOTLAST: + tgt.setValue(StructureMap.StructureMapSourceListMode.NOTLAST); + break; + case ONLYONE: + tgt.setValue(StructureMap.StructureMapSourceListMode.ONLYONE); + break; + default: + tgt.setValue(StructureMap.StructureMapSourceListMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertStructureMapSourceListMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListModeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case FIRST: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.FIRST); - break; - case NOTFIRST: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.NOTFIRST); - break; - case LAST: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.LAST); - break; - case NOTLAST: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.NOTLAST); - break; - case ONLYONE: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.ONLYONE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListModeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FIRST: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.FIRST); + break; + case NOTFIRST: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.NOTFIRST); + break; + case LAST: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.LAST); + break; + case NOTLAST: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.NOTLAST); + break; + case ONLYONE: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.ONLYONE); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetComponent convertStructureMapGroupRuleTargetComponent(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetComponent src) throws FHIRException { @@ -590,181 +617,197 @@ public static org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetComp } static public org.hl7.fhir.r5.model.Enumeration convertStructureMapTargetListMode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListModeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case FIRST: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListMode.FIRST); - break; - case SHARE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListMode.SHARE); - break; - case LAST: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListMode.LAST); - break; - case COLLATE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListMode.SINGLE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureMap.StructureMapTargetListModeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FIRST: + tgt.setValue(StructureMap.StructureMapTargetListMode.FIRST); + break; + case SHARE: + tgt.setValue(StructureMap.StructureMapTargetListMode.SHARE); + break; + case LAST: + tgt.setValue(StructureMap.StructureMapTargetListMode.LAST); + break; + case COLLATE: + tgt.setValue(StructureMap.StructureMapTargetListMode.SINGLE); + break; + default: + tgt.setValue(StructureMap.StructureMapTargetListMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertStructureMapTargetListMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListModeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case FIRST: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListMode.FIRST); - break; - case SHARE: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListMode.SHARE); - break; - case LAST: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListMode.LAST); - break; - case SINGLE: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListMode.COLLATE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListModeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FIRST: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListMode.FIRST); + break; + case SHARE: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListMode.SHARE); + break; + case LAST: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListMode.LAST); + break; + case SINGLE: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListMode.COLLATE); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertStructureMapTransform(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureMap.StructureMapTransformEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case CREATE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.CREATE); - break; - case COPY: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.COPY); - break; - case TRUNCATE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.TRUNCATE); - break; - case ESCAPE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.ESCAPE); - break; - case CAST: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.CAST); - break; - case APPEND: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.APPEND); - break; - case TRANSLATE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.TRANSLATE); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.REFERENCE); - break; - case DATEOP: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.DATEOP); - break; - case UUID: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.UUID); - break; - case POINTER: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.POINTER); - break; - case EVALUATE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.EVALUATE); - break; - case CC: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.CC); - break; - case C: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.C); - break; - case QTY: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.QTY); - break; - case ID: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.ID); - break; - case CP: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.CP); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureMap.StructureMapTransformEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CREATE: + tgt.setValue(StructureMap.StructureMapTransform.CREATE); + break; + case COPY: + tgt.setValue(StructureMap.StructureMapTransform.COPY); + break; + case TRUNCATE: + tgt.setValue(StructureMap.StructureMapTransform.TRUNCATE); + break; + case ESCAPE: + tgt.setValue(StructureMap.StructureMapTransform.ESCAPE); + break; + case CAST: + tgt.setValue(StructureMap.StructureMapTransform.CAST); + break; + case APPEND: + tgt.setValue(StructureMap.StructureMapTransform.APPEND); + break; + case TRANSLATE: + tgt.setValue(StructureMap.StructureMapTransform.TRANSLATE); + break; + case REFERENCE: + tgt.setValue(StructureMap.StructureMapTransform.REFERENCE); + break; + case DATEOP: + tgt.setValue(StructureMap.StructureMapTransform.DATEOP); + break; + case UUID: + tgt.setValue(StructureMap.StructureMapTransform.UUID); + break; + case POINTER: + tgt.setValue(StructureMap.StructureMapTransform.POINTER); + break; + case EVALUATE: + tgt.setValue(StructureMap.StructureMapTransform.EVALUATE); + break; + case CC: + tgt.setValue(StructureMap.StructureMapTransform.CC); + break; + case C: + tgt.setValue(StructureMap.StructureMapTransform.C); + break; + case QTY: + tgt.setValue(StructureMap.StructureMapTransform.QTY); + break; + case ID: + tgt.setValue(StructureMap.StructureMapTransform.ID); + break; + case CP: + tgt.setValue(StructureMap.StructureMapTransform.CP); + break; + default: + tgt.setValue(StructureMap.StructureMapTransform.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertStructureMapTransform(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureMap.StructureMapTransformEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case CREATE: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.CREATE); - break; - case COPY: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.COPY); - break; - case TRUNCATE: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.TRUNCATE); - break; - case ESCAPE: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.ESCAPE); - break; - case CAST: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.CAST); - break; - case APPEND: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.APPEND); - break; - case TRANSLATE: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.TRANSLATE); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.REFERENCE); - break; - case DATEOP: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.DATEOP); - break; - case UUID: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.UUID); - break; - case POINTER: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.POINTER); - break; - case EVALUATE: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.EVALUATE); - break; - case CC: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.CC); - break; - case C: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.C); - break; - case QTY: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.QTY); - break; - case ID: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.ID); - break; - case CP: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.CP); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureMap.StructureMapTransformEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CREATE: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.CREATE); + break; + case COPY: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.COPY); + break; + case TRUNCATE: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.TRUNCATE); + break; + case ESCAPE: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.ESCAPE); + break; + case CAST: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.CAST); + break; + case APPEND: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.APPEND); + break; + case TRANSLATE: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.TRANSLATE); + break; + case REFERENCE: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.REFERENCE); + break; + case DATEOP: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.DATEOP); + break; + case UUID: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.UUID); + break; + case POINTER: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.POINTER); + break; + case EVALUATE: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.EVALUATE); + break; + case CC: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.CC); + break; + case C: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.C); + break; + case QTY: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.QTY); + break; + case ID: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.ID); + break; + case CP: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.CP); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.NULL); + break; + } + } + return tgt; } //DIRTY diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Substance40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Substance40_50.java index d906c245ca..7c437171c6 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Substance40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Substance40_50.java @@ -8,7 +8,9 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.DateTime40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; import org.hl7.fhir.r5.model.Identifier; +import org.hl7.fhir.r5.model.Substance; /* Copyright (c) 2011+, HL7, Inc. @@ -87,47 +89,55 @@ public static org.hl7.fhir.r4.model.Substance convertSubstance(org.hl7.fhir.r5.m } static public org.hl7.fhir.r5.model.Enumeration convertFHIRSubstanceStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Substance.FHIRSubstanceStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Substance.FHIRSubstanceStatus.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Substance.FHIRSubstanceStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Substance.FHIRSubstanceStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Substance.FHIRSubstanceStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Substance.FHIRSubstanceStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Substance.FHIRSubstanceStatus.ACTIVE); + break; + case INACTIVE: + tgt.setValue(Substance.FHIRSubstanceStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(Substance.FHIRSubstanceStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Substance.FHIRSubstanceStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertFHIRSubstanceStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Substance.FHIRSubstanceStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Substance.FHIRSubstanceStatus.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.Substance.FHIRSubstanceStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Substance.FHIRSubstanceStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Substance.FHIRSubstanceStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Substance.FHIRSubstanceStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4.model.Substance.FHIRSubstanceStatus.ACTIVE); + break; + case INACTIVE: + tgt.setValue(org.hl7.fhir.r4.model.Substance.FHIRSubstanceStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.Substance.FHIRSubstanceStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Substance.FHIRSubstanceStatus.NULL); + break; + } + } + return tgt; } public static void convertSubstanceInstanceComponent(org.hl7.fhir.r4.model.Substance.SubstanceInstanceComponent src, org.hl7.fhir.r5.model.Substance tgt) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/SupplyDelivery40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/SupplyDelivery40_50.java index cb4ce28aaa..08bff2c190 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/SupplyDelivery40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/SupplyDelivery40_50.java @@ -6,6 +6,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.general40_50.SimpleQuantity40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.SupplyDelivery; /* Copyright (c) 2011+, HL7, Inc. @@ -93,53 +95,61 @@ public static org.hl7.fhir.r4.model.SupplyDelivery convertSupplyDelivery(org.hl7 } static public org.hl7.fhir.r5.model.Enumeration convertSupplyDeliveryStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus.COMPLETED); - break; - case ABANDONED: - tgt.setValue(org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus.ABANDONED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new SupplyDelivery.SupplyDeliveryStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(SupplyDelivery.SupplyDeliveryStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(SupplyDelivery.SupplyDeliveryStatus.COMPLETED); + break; + case ABANDONED: + tgt.setValue(SupplyDelivery.SupplyDeliveryStatus.ABANDONED); + break; + case ENTEREDINERROR: + tgt.setValue(SupplyDelivery.SupplyDeliveryStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(SupplyDelivery.SupplyDeliveryStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertSupplyDeliveryStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatus.COMPLETED); - break; - case ABANDONED: - tgt.setValue(org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatus.ABANDONED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatus.COMPLETED); + break; + case ABANDONED: + tgt.setValue(org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatus.ABANDONED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliveryStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliverySuppliedItemComponent convertSupplyDeliverySuppliedItemComponent(org.hl7.fhir.r4.model.SupplyDelivery.SupplyDeliverySuppliedItemComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/SupplyRequest40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/SupplyRequest40_50.java index 9b7f9e9c75..8eb13b023c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/SupplyRequest40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/SupplyRequest40_50.java @@ -8,6 +8,9 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; +import org.hl7.fhir.r5.model.SupplyRequest; /* Copyright (c) 2011+, HL7, Inc. @@ -127,121 +130,137 @@ public static org.hl7.fhir.r4.model.SupplyRequest convertSupplyRequest(org.hl7.f } static public org.hl7.fhir.r5.model.Enumeration convertSupplyRequestStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus.ACTIVE); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus.SUSPENDED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus.CANCELLED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new SupplyRequest.SupplyRequestStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(SupplyRequest.SupplyRequestStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(SupplyRequest.SupplyRequestStatus.ACTIVE); + break; + case SUSPENDED: + tgt.setValue(SupplyRequest.SupplyRequestStatus.SUSPENDED); + break; + case CANCELLED: + tgt.setValue(SupplyRequest.SupplyRequestStatus.CANCELLED); + break; + case COMPLETED: + tgt.setValue(SupplyRequest.SupplyRequestStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(SupplyRequest.SupplyRequestStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(SupplyRequest.SupplyRequestStatus.UNKNOWN); + break; + default: + tgt.setValue(SupplyRequest.SupplyRequestStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertSupplyRequestStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus.ACTIVE); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus.SUSPENDED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus.CANCELLED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus.ACTIVE); + break; + case SUSPENDED: + tgt.setValue(org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus.SUSPENDED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus.CANCELLED); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertRequestPriority(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestPriorityEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP); - break; - case STAT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.RequestPriorityEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(Enumerations.RequestPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(Enumerations.RequestPriority.URGENT); + break; + case ASAP: + tgt.setValue(Enumerations.RequestPriority.ASAP); + break; + case STAT: + tgt.setValue(Enumerations.RequestPriority.STAT); + break; + default: + tgt.setValue(Enumerations.RequestPriority.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertRequestPriority(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.SupplyRequest.RequestPriorityEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.r4.model.SupplyRequest.RequestPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.r4.model.SupplyRequest.RequestPriority.URGENT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.r4.model.SupplyRequest.RequestPriority.ASAP); - break; - case STAT: - tgt.setValue(org.hl7.fhir.r4.model.SupplyRequest.RequestPriority.STAT); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.SupplyRequest.RequestPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.SupplyRequest.RequestPriorityEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(org.hl7.fhir.r4.model.SupplyRequest.RequestPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(org.hl7.fhir.r4.model.SupplyRequest.RequestPriority.URGENT); + break; + case ASAP: + tgt.setValue(org.hl7.fhir.r4.model.SupplyRequest.RequestPriority.ASAP); + break; + case STAT: + tgt.setValue(org.hl7.fhir.r4.model.SupplyRequest.RequestPriority.STAT); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.SupplyRequest.RequestPriority.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestParameterComponent convertSupplyRequestParameterComponent(org.hl7.fhir.r4.model.SupplyRequest.SupplyRequestParameterComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Task40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Task40_50.java index 1593bfa7f4..a57e94319e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Task40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Task40_50.java @@ -13,6 +13,9 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; +import org.hl7.fhir.r5.model.Task; /* Copyright (c) 2011+, HL7, Inc. @@ -178,231 +181,255 @@ else if (t.hasReference()) } static public org.hl7.fhir.r5.model.Enumeration convertTaskStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Task.TaskStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskStatus.DRAFT); - break; - case REQUESTED: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskStatus.REQUESTED); - break; - case RECEIVED: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskStatus.RECEIVED); - break; - case ACCEPTED: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskStatus.ACCEPTED); - break; - case REJECTED: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskStatus.REJECTED); - break; - case READY: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskStatus.READY); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskStatus.CANCELLED); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskStatus.INPROGRESS); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskStatus.ONHOLD); - break; - case FAILED: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskStatus.FAILED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Task.TaskStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(Task.TaskStatus.DRAFT); + break; + case REQUESTED: + tgt.setValue(Task.TaskStatus.REQUESTED); + break; + case RECEIVED: + tgt.setValue(Task.TaskStatus.RECEIVED); + break; + case ACCEPTED: + tgt.setValue(Task.TaskStatus.ACCEPTED); + break; + case REJECTED: + tgt.setValue(Task.TaskStatus.REJECTED); + break; + case READY: + tgt.setValue(Task.TaskStatus.READY); + break; + case CANCELLED: + tgt.setValue(Task.TaskStatus.CANCELLED); + break; + case INPROGRESS: + tgt.setValue(Task.TaskStatus.INPROGRESS); + break; + case ONHOLD: + tgt.setValue(Task.TaskStatus.ONHOLD); + break; + case FAILED: + tgt.setValue(Task.TaskStatus.FAILED); + break; + case COMPLETED: + tgt.setValue(Task.TaskStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(Task.TaskStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Task.TaskStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertTaskStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Task.TaskStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r4.model.Task.TaskStatus.DRAFT); - break; - case REQUESTED: - tgt.setValue(org.hl7.fhir.r4.model.Task.TaskStatus.REQUESTED); - break; - case RECEIVED: - tgt.setValue(org.hl7.fhir.r4.model.Task.TaskStatus.RECEIVED); - break; - case ACCEPTED: - tgt.setValue(org.hl7.fhir.r4.model.Task.TaskStatus.ACCEPTED); - break; - case REJECTED: - tgt.setValue(org.hl7.fhir.r4.model.Task.TaskStatus.REJECTED); - break; - case READY: - tgt.setValue(org.hl7.fhir.r4.model.Task.TaskStatus.READY); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.Task.TaskStatus.CANCELLED); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r4.model.Task.TaskStatus.INPROGRESS); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r4.model.Task.TaskStatus.ONHOLD); - break; - case FAILED: - tgt.setValue(org.hl7.fhir.r4.model.Task.TaskStatus.FAILED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.Task.TaskStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.Task.TaskStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Task.TaskStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Task.TaskStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(org.hl7.fhir.r4.model.Task.TaskStatus.DRAFT); + break; + case REQUESTED: + tgt.setValue(org.hl7.fhir.r4.model.Task.TaskStatus.REQUESTED); + break; + case RECEIVED: + tgt.setValue(org.hl7.fhir.r4.model.Task.TaskStatus.RECEIVED); + break; + case ACCEPTED: + tgt.setValue(org.hl7.fhir.r4.model.Task.TaskStatus.ACCEPTED); + break; + case REJECTED: + tgt.setValue(org.hl7.fhir.r4.model.Task.TaskStatus.REJECTED); + break; + case READY: + tgt.setValue(org.hl7.fhir.r4.model.Task.TaskStatus.READY); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4.model.Task.TaskStatus.CANCELLED); + break; + case INPROGRESS: + tgt.setValue(org.hl7.fhir.r4.model.Task.TaskStatus.INPROGRESS); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.r4.model.Task.TaskStatus.ONHOLD); + break; + case FAILED: + tgt.setValue(org.hl7.fhir.r4.model.Task.TaskStatus.FAILED); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4.model.Task.TaskStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.Task.TaskStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Task.TaskStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertTaskIntent(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Task.TaskIntentEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskIntent.UNKNOWN); - break; - case PROPOSAL: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskIntent.PROPOSAL); - break; - case PLAN: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskIntent.PLAN); - break; - case ORDER: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskIntent.ORDER); - break; - case ORIGINALORDER: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskIntent.ORIGINALORDER); - break; - case REFLEXORDER: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskIntent.REFLEXORDER); - break; - case FILLERORDER: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskIntent.FILLERORDER); - break; - case INSTANCEORDER: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskIntent.INSTANCEORDER); - break; - case OPTION: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskIntent.OPTION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskIntent.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Task.TaskIntentEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case UNKNOWN: + tgt.setValue(Task.TaskIntent.UNKNOWN); + break; + case PROPOSAL: + tgt.setValue(Task.TaskIntent.PROPOSAL); + break; + case PLAN: + tgt.setValue(Task.TaskIntent.PLAN); + break; + case ORDER: + tgt.setValue(Task.TaskIntent.ORDER); + break; + case ORIGINALORDER: + tgt.setValue(Task.TaskIntent.ORIGINALORDER); + break; + case REFLEXORDER: + tgt.setValue(Task.TaskIntent.REFLEXORDER); + break; + case FILLERORDER: + tgt.setValue(Task.TaskIntent.FILLERORDER); + break; + case INSTANCEORDER: + tgt.setValue(Task.TaskIntent.INSTANCEORDER); + break; + case OPTION: + tgt.setValue(Task.TaskIntent.OPTION); + break; + default: + tgt.setValue(Task.TaskIntent.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertTaskIntent(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Task.TaskIntentEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4.model.Task.TaskIntent.UNKNOWN); - break; - case PROPOSAL: - tgt.setValue(org.hl7.fhir.r4.model.Task.TaskIntent.PROPOSAL); - break; - case PLAN: - tgt.setValue(org.hl7.fhir.r4.model.Task.TaskIntent.PLAN); - break; - case ORDER: - tgt.setValue(org.hl7.fhir.r4.model.Task.TaskIntent.ORDER); - break; - case ORIGINALORDER: - tgt.setValue(org.hl7.fhir.r4.model.Task.TaskIntent.ORIGINALORDER); - break; - case REFLEXORDER: - tgt.setValue(org.hl7.fhir.r4.model.Task.TaskIntent.REFLEXORDER); - break; - case FILLERORDER: - tgt.setValue(org.hl7.fhir.r4.model.Task.TaskIntent.FILLERORDER); - break; - case INSTANCEORDER: - tgt.setValue(org.hl7.fhir.r4.model.Task.TaskIntent.INSTANCEORDER); - break; - case OPTION: - tgt.setValue(org.hl7.fhir.r4.model.Task.TaskIntent.OPTION); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Task.TaskIntent.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Task.TaskIntentEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4.model.Task.TaskIntent.UNKNOWN); + break; + case PROPOSAL: + tgt.setValue(org.hl7.fhir.r4.model.Task.TaskIntent.PROPOSAL); + break; + case PLAN: + tgt.setValue(org.hl7.fhir.r4.model.Task.TaskIntent.PLAN); + break; + case ORDER: + tgt.setValue(org.hl7.fhir.r4.model.Task.TaskIntent.ORDER); + break; + case ORIGINALORDER: + tgt.setValue(org.hl7.fhir.r4.model.Task.TaskIntent.ORIGINALORDER); + break; + case REFLEXORDER: + tgt.setValue(org.hl7.fhir.r4.model.Task.TaskIntent.REFLEXORDER); + break; + case FILLERORDER: + tgt.setValue(org.hl7.fhir.r4.model.Task.TaskIntent.FILLERORDER); + break; + case INSTANCEORDER: + tgt.setValue(org.hl7.fhir.r4.model.Task.TaskIntent.INSTANCEORDER); + break; + case OPTION: + tgt.setValue(org.hl7.fhir.r4.model.Task.TaskIntent.OPTION); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Task.TaskIntent.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertTaskPriority(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestPriorityEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP); - break; - case STAT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.RequestPriorityEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(Enumerations.RequestPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(Enumerations.RequestPriority.URGENT); + break; + case ASAP: + tgt.setValue(Enumerations.RequestPriority.ASAP); + break; + case STAT: + tgt.setValue(Enumerations.RequestPriority.STAT); + break; + default: + tgt.setValue(Enumerations.RequestPriority.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertTaskPriority(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Task.TaskPriorityEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.r4.model.Task.TaskPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.r4.model.Task.TaskPriority.URGENT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.r4.model.Task.TaskPriority.ASAP); - break; - case STAT: - tgt.setValue(org.hl7.fhir.r4.model.Task.TaskPriority.STAT); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.Task.TaskPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Task.TaskPriorityEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(org.hl7.fhir.r4.model.Task.TaskPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(org.hl7.fhir.r4.model.Task.TaskPriority.URGENT); + break; + case ASAP: + tgt.setValue(org.hl7.fhir.r4.model.Task.TaskPriority.ASAP); + break; + case STAT: + tgt.setValue(org.hl7.fhir.r4.model.Task.TaskPriority.STAT); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.Task.TaskPriority.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Task.TaskRestrictionComponent convertTaskRestrictionComponent(org.hl7.fhir.r4.model.Task.TaskRestrictionComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/TerminologyCapabilities40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/TerminologyCapabilities40_50.java index 3f61a9bd69..2de13f3a45 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/TerminologyCapabilities40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/TerminologyCapabilities40_50.java @@ -14,7 +14,9 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Url40_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4.model.CodeType; +import org.hl7.fhir.r4.model.TerminologyCapabilities; import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; import org.hl7.fhir.r5.model.Enumerations.CommonLanguages; import org.hl7.fhir.r5.model.Enumerations.CommonLanguagesEnumFactory; @@ -162,85 +164,101 @@ public static org.hl7.fhir.r4.model.TerminologyCapabilities convertTerminologyCa } static public org.hl7.fhir.r5.model.Enumeration convertCapabilityStatementKind(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKindEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.INSTANCE); - break; - case CAPABILITY: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.CAPABILITY); - break; - case REQUIREMENTS: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.REQUIREMENTS); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.CapabilityStatementKindEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(Enumerations.CapabilityStatementKind.INSTANCE); + break; + case CAPABILITY: + tgt.setValue(Enumerations.CapabilityStatementKind.CAPABILITY); + break; + case REQUIREMENTS: + tgt.setValue(Enumerations.CapabilityStatementKind.REQUIREMENTS); + break; + default: + tgt.setValue(Enumerations.CapabilityStatementKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertCapabilityStatementKind(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TerminologyCapabilities.CapabilityStatementKindEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.r4.model.TerminologyCapabilities.CapabilityStatementKind.INSTANCE); - break; - case CAPABILITY: - tgt.setValue(org.hl7.fhir.r4.model.TerminologyCapabilities.CapabilityStatementKind.CAPABILITY); - break; - case REQUIREMENTS: - tgt.setValue(org.hl7.fhir.r4.model.TerminologyCapabilities.CapabilityStatementKind.REQUIREMENTS); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.TerminologyCapabilities.CapabilityStatementKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new TerminologyCapabilities.CapabilityStatementKindEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(TerminologyCapabilities.CapabilityStatementKind.INSTANCE); + break; + case CAPABILITY: + tgt.setValue(TerminologyCapabilities.CapabilityStatementKind.CAPABILITY); + break; + case REQUIREMENTS: + tgt.setValue(TerminologyCapabilities.CapabilityStatementKind.REQUIREMENTS); + break; + default: + tgt.setValue(TerminologyCapabilities.CapabilityStatementKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertCodeSearchSupport(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TerminologyCapabilities.CodeSearchSupportEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case EXPLICIT: - tgt.setValue(org.hl7.fhir.r5.model.TerminologyCapabilities.CodeSearchSupport.INCOMPOSE); - break; - case ALL: - tgt.setValue(org.hl7.fhir.r5.model.TerminologyCapabilities.CodeSearchSupport.INCOMPOSEOREXPANSION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.TerminologyCapabilities.CodeSearchSupport.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new org.hl7.fhir.r5.model.TerminologyCapabilities.CodeSearchSupportEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EXPLICIT: + tgt.setValue(org.hl7.fhir.r5.model.TerminologyCapabilities.CodeSearchSupport.INCOMPOSE); + break; + case ALL: + tgt.setValue(org.hl7.fhir.r5.model.TerminologyCapabilities.CodeSearchSupport.INCOMPOSEOREXPANSION); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.TerminologyCapabilities.CodeSearchSupport.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertCodeSearchSupport(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TerminologyCapabilities.CodeSearchSupportEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case INCOMPOSE: - tgt.setValue(org.hl7.fhir.r4.model.TerminologyCapabilities.CodeSearchSupport.EXPLICIT); - break; - case INCOMPOSEOREXPANSION: - tgt.setValue(org.hl7.fhir.r4.model.TerminologyCapabilities.CodeSearchSupport.ALL); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.TerminologyCapabilities.CodeSearchSupport.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new TerminologyCapabilities.CodeSearchSupportEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INCOMPOSE: + tgt.setValue(TerminologyCapabilities.CodeSearchSupport.EXPLICIT); + break; + case INCOMPOSEOREXPANSION: + tgt.setValue(TerminologyCapabilities.CodeSearchSupport.ALL); + break; + default: + tgt.setValue(TerminologyCapabilities.CodeSearchSupport.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesSoftwareComponent convertTerminologyCapabilitiesSoftwareComponent(org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesSoftwareComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/TestReport40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/TestReport40_50.java index 04dc556846..94ed538c8e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/TestReport40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/TestReport40_50.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Uri40_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4.model.Reference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.TestReport; /* Copyright (c) 2011+, HL7, Inc. @@ -106,103 +108,119 @@ public static org.hl7.fhir.r4.model.TestReport convertTestReport(org.hl7.fhir.r5 } static public org.hl7.fhir.r5.model.Enumeration convertTestReportStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TestReport.TestReportStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportStatus.COMPLETED); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportStatus.INPROGRESS); - break; - case WAITING: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportStatus.WAITING); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportStatus.STOPPED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new TestReport.TestReportStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case COMPLETED: + tgt.setValue(TestReport.TestReportStatus.COMPLETED); + break; + case INPROGRESS: + tgt.setValue(TestReport.TestReportStatus.INPROGRESS); + break; + case WAITING: + tgt.setValue(TestReport.TestReportStatus.WAITING); + break; + case STOPPED: + tgt.setValue(TestReport.TestReportStatus.STOPPED); + break; + case ENTEREDINERROR: + tgt.setValue(TestReport.TestReportStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(TestReport.TestReportStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertTestReportStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TestReport.TestReportStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportStatus.COMPLETED); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportStatus.INPROGRESS); - break; - case WAITING: - tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportStatus.WAITING); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportStatus.STOPPED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TestReport.TestReportStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportStatus.COMPLETED); + break; + case INPROGRESS: + tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportStatus.INPROGRESS); + break; + case WAITING: + tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportStatus.WAITING); + break; + case STOPPED: + tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportStatus.STOPPED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertTestReportResult(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TestReport.TestReportResultEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PASS: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportResult.PASS); - break; - case FAIL: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportResult.FAIL); - break; - case PENDING: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportResult.PENDING); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportResult.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new TestReport.TestReportResultEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PASS: + tgt.setValue(TestReport.TestReportResult.PASS); + break; + case FAIL: + tgt.setValue(TestReport.TestReportResult.FAIL); + break; + case PENDING: + tgt.setValue(TestReport.TestReportResult.PENDING); + break; + default: + tgt.setValue(TestReport.TestReportResult.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertTestReportResult(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TestReport.TestReportResultEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PASS: - tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportResult.PASS); - break; - case FAIL: - tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportResult.FAIL); - break; - case PENDING: - tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportResult.PENDING); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportResult.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TestReport.TestReportResultEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PASS: + tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportResult.PASS); + break; + case FAIL: + tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportResult.FAIL); + break; + case PENDING: + tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportResult.PENDING); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportResult.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.TestReport.TestReportParticipantComponent convertTestReportParticipantComponent(org.hl7.fhir.r4.model.TestReport.TestReportParticipantComponent src) throws FHIRException { @@ -234,47 +252,55 @@ public static org.hl7.fhir.r4.model.TestReport.TestReportParticipantComponent co } static public org.hl7.fhir.r5.model.Enumeration convertTestReportParticipantType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TestReport.TestReportParticipantTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case TESTENGINE: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportParticipantType.TESTENGINE); - break; - case CLIENT: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportParticipantType.CLIENT); - break; - case SERVER: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportParticipantType.SERVER); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportParticipantType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new TestReport.TestReportParticipantTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case TESTENGINE: + tgt.setValue(TestReport.TestReportParticipantType.TESTENGINE); + break; + case CLIENT: + tgt.setValue(TestReport.TestReportParticipantType.CLIENT); + break; + case SERVER: + tgt.setValue(TestReport.TestReportParticipantType.SERVER); + break; + default: + tgt.setValue(TestReport.TestReportParticipantType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertTestReportParticipantType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TestReport.TestReportParticipantTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case TESTENGINE: - tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportParticipantType.TESTENGINE); - break; - case CLIENT: - tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportParticipantType.CLIENT); - break; - case SERVER: - tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportParticipantType.SERVER); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportParticipantType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TestReport.TestReportParticipantTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case TESTENGINE: + tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportParticipantType.TESTENGINE); + break; + case CLIENT: + tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportParticipantType.CLIENT); + break; + case SERVER: + tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportParticipantType.SERVER); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportParticipantType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.TestReport.TestReportSetupComponent convertTestReportSetupComponent(org.hl7.fhir.r4.model.TestReport.TestReportSetupComponent src) throws FHIRException { @@ -350,59 +376,67 @@ public static org.hl7.fhir.r4.model.TestReport.SetupActionOperationComponent con } static public org.hl7.fhir.r5.model.Enumeration convertTestReportActionResult(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TestReport.TestReportActionResultEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PASS: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportActionResult.PASS); - break; - case SKIP: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportActionResult.SKIP); - break; - case FAIL: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportActionResult.FAIL); - break; - case WARNING: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportActionResult.WARNING); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportActionResult.ERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportActionResult.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new TestReport.TestReportActionResultEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PASS: + tgt.setValue(TestReport.TestReportActionResult.PASS); + break; + case SKIP: + tgt.setValue(TestReport.TestReportActionResult.SKIP); + break; + case FAIL: + tgt.setValue(TestReport.TestReportActionResult.FAIL); + break; + case WARNING: + tgt.setValue(TestReport.TestReportActionResult.WARNING); + break; + case ERROR: + tgt.setValue(TestReport.TestReportActionResult.ERROR); + break; + default: + tgt.setValue(TestReport.TestReportActionResult.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertTestReportActionResult(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TestReport.TestReportActionResultEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case PASS: - tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportActionResult.PASS); - break; - case SKIP: - tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportActionResult.SKIP); - break; - case FAIL: - tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportActionResult.FAIL); - break; - case WARNING: - tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportActionResult.WARNING); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportActionResult.ERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportActionResult.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TestReport.TestReportActionResultEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PASS: + tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportActionResult.PASS); + break; + case SKIP: + tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportActionResult.SKIP); + break; + case FAIL: + tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportActionResult.FAIL); + break; + case WARNING: + tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportActionResult.WARNING); + break; + case ERROR: + tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportActionResult.ERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportActionResult.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.TestReport.SetupActionAssertComponent convertSetupActionAssertComponent(org.hl7.fhir.r4.model.TestReport.SetupActionAssertComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/TestScript40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/TestScript40_50.java index 824eb9c1c4..3060ff1992 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/TestScript40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/TestScript40_50.java @@ -18,6 +18,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CanonicalType; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.TestScript; import org.hl7.fhir.r5.model.TestScript.TestScriptScopeComponent; /* @@ -534,71 +536,79 @@ public static org.hl7.fhir.r4.model.TestScript.SetupActionOperationComponent con } static public org.hl7.fhir.r5.model.Enumeration convertTestScriptRequestMethodCode(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCodeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case DELETE: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.DELETE); - break; - case GET: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.GET); - break; - case OPTIONS: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.OPTIONS); - break; - case PATCH: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.PATCH); - break; - case POST: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.POST); - break; - case PUT: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.PUT); - break; - case HEAD: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.HEAD); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new TestScript.TestScriptRequestMethodCodeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DELETE: + tgt.setValue(TestScript.TestScriptRequestMethodCode.DELETE); + break; + case GET: + tgt.setValue(TestScript.TestScriptRequestMethodCode.GET); + break; + case OPTIONS: + tgt.setValue(TestScript.TestScriptRequestMethodCode.OPTIONS); + break; + case PATCH: + tgt.setValue(TestScript.TestScriptRequestMethodCode.PATCH); + break; + case POST: + tgt.setValue(TestScript.TestScriptRequestMethodCode.POST); + break; + case PUT: + tgt.setValue(TestScript.TestScriptRequestMethodCode.PUT); + break; + case HEAD: + tgt.setValue(TestScript.TestScriptRequestMethodCode.HEAD); + break; + default: + tgt.setValue(TestScript.TestScriptRequestMethodCode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertTestScriptRequestMethodCode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCodeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case DELETE: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode.DELETE); - break; - case GET: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode.GET); - break; - case OPTIONS: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode.OPTIONS); - break; - case PATCH: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode.PATCH); - break; - case POST: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode.POST); - break; - case PUT: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode.PUT); - break; - case HEAD: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode.HEAD); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCodeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DELETE: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode.DELETE); + break; + case GET: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode.GET); + break; + case OPTIONS: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode.OPTIONS); + break; + case PATCH: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode.PATCH); + break; + case POST: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode.POST); + break; + case PUT: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode.PUT); + break; + case HEAD: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode.HEAD); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.TestScript.SetupActionOperationRequestHeaderComponent convertSetupActionOperationRequestHeaderComponent(org.hl7.fhir.r4.model.TestScript.SetupActionOperationRequestHeaderComponent src) throws FHIRException { @@ -730,231 +740,255 @@ public static org.hl7.fhir.r4.model.TestScript.SetupActionAssertComponent conver } static public org.hl7.fhir.r5.model.Enumeration convertAssertionDirectionType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TestScript.AssertionDirectionTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case RESPONSE: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionDirectionType.RESPONSE); - break; - case REQUEST: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionDirectionType.REQUEST); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionDirectionType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new TestScript.AssertionDirectionTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case RESPONSE: + tgt.setValue(TestScript.AssertionDirectionType.RESPONSE); + break; + case REQUEST: + tgt.setValue(TestScript.AssertionDirectionType.REQUEST); + break; + default: + tgt.setValue(TestScript.AssertionDirectionType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertAssertionDirectionType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TestScript.AssertionDirectionTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case RESPONSE: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionDirectionType.RESPONSE); - break; - case REQUEST: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionDirectionType.REQUEST); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionDirectionType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TestScript.AssertionDirectionTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case RESPONSE: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionDirectionType.RESPONSE); + break; + case REQUEST: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionDirectionType.REQUEST); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionDirectionType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertAssertionOperatorType(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TestScript.AssertionOperatorTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case EQUALS: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.EQUALS); - break; - case NOTEQUALS: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NOTEQUALS); - break; - case IN: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NOTIN); - break; - case GREATERTHAN: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.GREATERTHAN); - break; - case LESSTHAN: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.LESSTHAN); - break; - case EMPTY: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.EMPTY); - break; - case NOTEMPTY: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NOTEMPTY); - break; - case CONTAINS: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.CONTAINS); - break; - case NOTCONTAINS: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NOTCONTAINS); - break; - case EVAL: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.EVAL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new TestScript.AssertionOperatorTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUALS: + tgt.setValue(TestScript.AssertionOperatorType.EQUALS); + break; + case NOTEQUALS: + tgt.setValue(TestScript.AssertionOperatorType.NOTEQUALS); + break; + case IN: + tgt.setValue(TestScript.AssertionOperatorType.IN); + break; + case NOTIN: + tgt.setValue(TestScript.AssertionOperatorType.NOTIN); + break; + case GREATERTHAN: + tgt.setValue(TestScript.AssertionOperatorType.GREATERTHAN); + break; + case LESSTHAN: + tgt.setValue(TestScript.AssertionOperatorType.LESSTHAN); + break; + case EMPTY: + tgt.setValue(TestScript.AssertionOperatorType.EMPTY); + break; + case NOTEMPTY: + tgt.setValue(TestScript.AssertionOperatorType.NOTEMPTY); + break; + case CONTAINS: + tgt.setValue(TestScript.AssertionOperatorType.CONTAINS); + break; + case NOTCONTAINS: + tgt.setValue(TestScript.AssertionOperatorType.NOTCONTAINS); + break; + case EVAL: + tgt.setValue(TestScript.AssertionOperatorType.EVAL); + break; + default: + tgt.setValue(TestScript.AssertionOperatorType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertAssertionOperatorType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TestScript.AssertionOperatorTypeEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case EQUALS: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.EQUALS); - break; - case NOTEQUALS: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.NOTEQUALS); - break; - case IN: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.NOTIN); - break; - case GREATERTHAN: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.GREATERTHAN); - break; - case LESSTHAN: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.LESSTHAN); - break; - case EMPTY: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.EMPTY); - break; - case NOTEMPTY: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.NOTEMPTY); - break; - case CONTAINS: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.CONTAINS); - break; - case NOTCONTAINS: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.NOTCONTAINS); - break; - case EVAL: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.EVAL); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TestScript.AssertionOperatorTypeEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUALS: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.EQUALS); + break; + case NOTEQUALS: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.NOTEQUALS); + break; + case IN: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.IN); + break; + case NOTIN: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.NOTIN); + break; + case GREATERTHAN: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.GREATERTHAN); + break; + case LESSTHAN: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.LESSTHAN); + break; + case EMPTY: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.EMPTY); + break; + case NOTEMPTY: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.NOTEMPTY); + break; + case CONTAINS: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.CONTAINS); + break; + case NOTCONTAINS: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.NOTCONTAINS); + break; + case EVAL: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.EVAL); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionOperatorType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertAssertionResponseTypes(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TestScript.AssertionResponseTypesEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case OKAY: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.OKAY); - break; - case CREATED: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.CREATED); - break; - case NOCONTENT: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.NOCONTENT); - break; - case NOTMODIFIED: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.NOTMODIFIED); - break; - case BAD: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.BADREQUEST); - break; - case FORBIDDEN: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.FORBIDDEN); - break; - case NOTFOUND: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.NOTFOUND); - break; - case METHODNOTALLOWED: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.METHODNOTALLOWED); - break; - case CONFLICT: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.CONFLICT); - break; - case GONE: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.GONE); - break; - case PRECONDITIONFAILED: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.PRECONDITIONFAILED); - break; - case UNPROCESSABLE: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.UNPROCESSABLECONTENT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new TestScript.AssertionResponseTypesEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OKAY: + tgt.setValue(TestScript.AssertionResponseTypes.OKAY); + break; + case CREATED: + tgt.setValue(TestScript.AssertionResponseTypes.CREATED); + break; + case NOCONTENT: + tgt.setValue(TestScript.AssertionResponseTypes.NOCONTENT); + break; + case NOTMODIFIED: + tgt.setValue(TestScript.AssertionResponseTypes.NOTMODIFIED); + break; + case BAD: + tgt.setValue(TestScript.AssertionResponseTypes.BADREQUEST); + break; + case FORBIDDEN: + tgt.setValue(TestScript.AssertionResponseTypes.FORBIDDEN); + break; + case NOTFOUND: + tgt.setValue(TestScript.AssertionResponseTypes.NOTFOUND); + break; + case METHODNOTALLOWED: + tgt.setValue(TestScript.AssertionResponseTypes.METHODNOTALLOWED); + break; + case CONFLICT: + tgt.setValue(TestScript.AssertionResponseTypes.CONFLICT); + break; + case GONE: + tgt.setValue(TestScript.AssertionResponseTypes.GONE); + break; + case PRECONDITIONFAILED: + tgt.setValue(TestScript.AssertionResponseTypes.PRECONDITIONFAILED); + break; + case UNPROCESSABLE: + tgt.setValue(TestScript.AssertionResponseTypes.UNPROCESSABLECONTENT); + break; + default: + tgt.setValue(TestScript.AssertionResponseTypes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertAssertionResponseTypes(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TestScript.AssertionResponseTypesEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case OKAY: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.OKAY); - break; - case CREATED: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.CREATED); - break; - case NOCONTENT: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.NOCONTENT); - break; - case NOTMODIFIED: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.NOTMODIFIED); - break; - case BADREQUEST: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.BAD); - break; - case FORBIDDEN: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.FORBIDDEN); - break; - case NOTFOUND: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.NOTFOUND); - break; - case METHODNOTALLOWED: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.METHODNOTALLOWED); - break; - case CONFLICT: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.CONFLICT); - break; - case GONE: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.GONE); - break; - case PRECONDITIONFAILED: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.PRECONDITIONFAILED); - break; - case UNPROCESSABLECONTENT: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.UNPROCESSABLE); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TestScript.AssertionResponseTypesEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OKAY: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.OKAY); + break; + case CREATED: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.CREATED); + break; + case NOCONTENT: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.NOCONTENT); + break; + case NOTMODIFIED: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.NOTMODIFIED); + break; + case BADREQUEST: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.BAD); + break; + case FORBIDDEN: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.FORBIDDEN); + break; + case NOTFOUND: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.NOTFOUND); + break; + case METHODNOTALLOWED: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.METHODNOTALLOWED); + break; + case CONFLICT: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.CONFLICT); + break; + case GONE: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.GONE); + break; + case PRECONDITIONFAILED: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.PRECONDITIONFAILED); + break; + case UNPROCESSABLECONTENT: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.UNPROCESSABLE); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.TestScript.TestScriptTestComponent convertTestScriptTestComponent(org.hl7.fhir.r4.model.TestScript.TestScriptTestComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ValueSet40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ValueSet40_50.java index fe263f9c12..2fc2ae0297 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ValueSet40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ValueSet40_50.java @@ -16,6 +16,9 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Uri40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.ValueSet; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; import org.hl7.fhir.r5.model.ValueSet.ConceptPropertyComponent; import org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionPropertyComponent; @@ -291,83 +294,91 @@ public static org.hl7.fhir.r4.model.ValueSet.ConceptSetFilterComponent convertCo } static public org.hl7.fhir.r5.model.Enumeration convertFilterOperator(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.FilterOperatorEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case EQUAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.EQUAL); - break; - case ISA: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.ISA); - break; - case DESCENDENTOF: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.DESCENDENTOF); - break; - case ISNOTA: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.ISNOTA); - break; - case REGEX: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.REGEX); - break; - case IN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.NOTIN); - break; - case GENERALIZES: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.GENERALIZES); - break; - case EXISTS: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.EXISTS); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.FilterOperatorEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUAL: + tgt.setValue(Enumerations.FilterOperator.EQUAL); + break; + case ISA: + tgt.setValue(Enumerations.FilterOperator.ISA); + break; + case DESCENDENTOF: + tgt.setValue(Enumerations.FilterOperator.DESCENDENTOF); + break; + case ISNOTA: + tgt.setValue(Enumerations.FilterOperator.ISNOTA); + break; + case REGEX: + tgt.setValue(Enumerations.FilterOperator.REGEX); + break; + case IN: + tgt.setValue(Enumerations.FilterOperator.IN); + break; + case NOTIN: + tgt.setValue(Enumerations.FilterOperator.NOTIN); + break; + case GENERALIZES: + tgt.setValue(Enumerations.FilterOperator.GENERALIZES); + break; + case EXISTS: + tgt.setValue(Enumerations.FilterOperator.EXISTS); + break; + default: + tgt.setValue(Enumerations.FilterOperator.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertFilterOperator(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ValueSet.FilterOperatorEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case EQUAL: - tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.EQUAL); - break; - case ISA: - tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.ISA); - break; - case DESCENDENTOF: - tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.DESCENDENTOF); - break; - case ISNOTA: - tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.ISNOTA); - break; - case REGEX: - tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.REGEX); - break; - case IN: - tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.NOTIN); - break; - case GENERALIZES: - tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.GENERALIZES); - break; - case EXISTS: - tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.EXISTS); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.ValueSet.FilterOperator.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new ValueSet.FilterOperatorEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUAL: + tgt.setValue(ValueSet.FilterOperator.EQUAL); + break; + case ISA: + tgt.setValue(ValueSet.FilterOperator.ISA); + break; + case DESCENDENTOF: + tgt.setValue(ValueSet.FilterOperator.DESCENDENTOF); + break; + case ISNOTA: + tgt.setValue(ValueSet.FilterOperator.ISNOTA); + break; + case REGEX: + tgt.setValue(ValueSet.FilterOperator.REGEX); + break; + case IN: + tgt.setValue(ValueSet.FilterOperator.IN); + break; + case NOTIN: + tgt.setValue(ValueSet.FilterOperator.NOTIN); + break; + case GENERALIZES: + tgt.setValue(ValueSet.FilterOperator.GENERALIZES); + break; + case EXISTS: + tgt.setValue(ValueSet.FilterOperator.EXISTS); + break; + default: + tgt.setValue(ValueSet.FilterOperator.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionComponent convertValueSetExpansionComponent(org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/VerificationResult40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/VerificationResult40_50.java index 8bdca5e130..cf6cd52ff3 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/VerificationResult40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/VerificationResult40_50.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.VerificationResult; /* Copyright (c) 2011+, HL7, Inc. @@ -112,65 +114,73 @@ public static org.hl7.fhir.r4.model.VerificationResult convertVerificationResult } static public org.hl7.fhir.r5.model.Enumeration convertStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.VerificationResult.VerificationResultStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ATTESTED: - tgt.setValue(org.hl7.fhir.r5.model.VerificationResult.VerificationResultStatus.ATTESTED); - break; - case VALIDATED: - tgt.setValue(org.hl7.fhir.r5.model.VerificationResult.VerificationResultStatus.VALIDATED); - break; - case INPROCESS: - tgt.setValue(org.hl7.fhir.r5.model.VerificationResult.VerificationResultStatus.INPROCESS); - break; - case REQREVALID: - tgt.setValue(org.hl7.fhir.r5.model.VerificationResult.VerificationResultStatus.REQREVALID); - break; - case VALFAIL: - tgt.setValue(org.hl7.fhir.r5.model.VerificationResult.VerificationResultStatus.VALFAIL); - break; - case REVALFAIL: - tgt.setValue(org.hl7.fhir.r5.model.VerificationResult.VerificationResultStatus.REVALFAIL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.VerificationResult.VerificationResultStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new VerificationResult.VerificationResultStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ATTESTED: + tgt.setValue(VerificationResult.VerificationResultStatus.ATTESTED); + break; + case VALIDATED: + tgt.setValue(VerificationResult.VerificationResultStatus.VALIDATED); + break; + case INPROCESS: + tgt.setValue(VerificationResult.VerificationResultStatus.INPROCESS); + break; + case REQREVALID: + tgt.setValue(VerificationResult.VerificationResultStatus.REQREVALID); + break; + case VALFAIL: + tgt.setValue(VerificationResult.VerificationResultStatus.VALFAIL); + break; + case REVALFAIL: + tgt.setValue(VerificationResult.VerificationResultStatus.REVALFAIL); + break; + default: + tgt.setValue(VerificationResult.VerificationResultStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.VerificationResult.StatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ATTESTED: - tgt.setValue(org.hl7.fhir.r4.model.VerificationResult.Status.ATTESTED); - break; - case VALIDATED: - tgt.setValue(org.hl7.fhir.r4.model.VerificationResult.Status.VALIDATED); - break; - case INPROCESS: - tgt.setValue(org.hl7.fhir.r4.model.VerificationResult.Status.INPROCESS); - break; - case REQREVALID: - tgt.setValue(org.hl7.fhir.r4.model.VerificationResult.Status.REQREVALID); - break; - case VALFAIL: - tgt.setValue(org.hl7.fhir.r4.model.VerificationResult.Status.VALFAIL); - break; - case REVALFAIL: - tgt.setValue(org.hl7.fhir.r4.model.VerificationResult.Status.REVALFAIL); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.VerificationResult.Status.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.VerificationResult.StatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ATTESTED: + tgt.setValue(org.hl7.fhir.r4.model.VerificationResult.Status.ATTESTED); + break; + case VALIDATED: + tgt.setValue(org.hl7.fhir.r4.model.VerificationResult.Status.VALIDATED); + break; + case INPROCESS: + tgt.setValue(org.hl7.fhir.r4.model.VerificationResult.Status.INPROCESS); + break; + case REQREVALID: + tgt.setValue(org.hl7.fhir.r4.model.VerificationResult.Status.REQREVALID); + break; + case VALFAIL: + tgt.setValue(org.hl7.fhir.r4.model.VerificationResult.Status.VALFAIL); + break; + case REVALFAIL: + tgt.setValue(org.hl7.fhir.r4.model.VerificationResult.Status.REVALFAIL); + break; + default: + tgt.setValue(org.hl7.fhir.r4.model.VerificationResult.Status.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.VerificationResult.VerificationResultPrimarySourceComponent convertVerificationResultPrimarySourceComponent(org.hl7.fhir.r4.model.VerificationResult.VerificationResultPrimarySourceComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/VisionPrescription40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/VisionPrescription40_50.java index 7fbeb31605..256eba69d6 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/VisionPrescription40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/VisionPrescription40_50.java @@ -11,6 +11,9 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.VisionPrescription; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -92,53 +95,61 @@ public static org.hl7.fhir.r4.model.VisionPrescription convertVisionPrescription } static public org.hl7.fhir.r5.model.Enumeration convertVisionStatus(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodesEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.CANCELLED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.FinancialResourceStatusCodesEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.ACTIVE); + break; + case CANCELLED: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.CANCELLED); + break; + case DRAFT: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); + break; + default: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertVisionStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.VisionPrescription.VisionStatusEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4.model.VisionPrescription.VisionStatus.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4.model.VisionPrescription.VisionStatus.CANCELLED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r4.model.VisionPrescription.VisionStatus.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4.model.VisionPrescription.VisionStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.VisionPrescription.VisionStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new VisionPrescription.VisionStatusEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(VisionPrescription.VisionStatus.ACTIVE); + break; + case CANCELLED: + tgt.setValue(VisionPrescription.VisionStatus.CANCELLED); + break; + case DRAFT: + tgt.setValue(VisionPrescription.VisionStatus.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(VisionPrescription.VisionStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(VisionPrescription.VisionStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.VisionPrescription.VisionPrescriptionLensSpecificationComponent convertVisionPrescriptionLensSpecificationComponent(org.hl7.fhir.r4.model.VisionPrescription.VisionPrescriptionLensSpecificationComponent src) throws FHIRException { @@ -212,41 +223,49 @@ public static org.hl7.fhir.r4.model.VisionPrescription.VisionPrescriptionLensSpe } static public org.hl7.fhir.r5.model.Enumeration convertVisionEyes(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.VisionPrescription.VisionEyesEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case RIGHT: - tgt.setValue(org.hl7.fhir.r5.model.VisionPrescription.VisionEyes.RIGHT); - break; - case LEFT: - tgt.setValue(org.hl7.fhir.r5.model.VisionPrescription.VisionEyes.LEFT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.VisionPrescription.VisionEyes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new org.hl7.fhir.r5.model.VisionPrescription.VisionEyesEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case RIGHT: + tgt.setValue(org.hl7.fhir.r5.model.VisionPrescription.VisionEyes.RIGHT); + break; + case LEFT: + tgt.setValue(org.hl7.fhir.r5.model.VisionPrescription.VisionEyes.LEFT); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.VisionPrescription.VisionEyes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertVisionEyes(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.VisionPrescription.VisionEyesEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case RIGHT: - tgt.setValue(org.hl7.fhir.r4.model.VisionPrescription.VisionEyes.RIGHT); - break; - case LEFT: - tgt.setValue(org.hl7.fhir.r4.model.VisionPrescription.VisionEyes.LEFT); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.VisionPrescription.VisionEyes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new VisionPrescription.VisionEyesEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case RIGHT: + tgt.setValue(VisionPrescription.VisionEyes.RIGHT); + break; + case LEFT: + tgt.setValue(VisionPrescription.VisionEyes.LEFT); + break; + default: + tgt.setValue(VisionPrescription.VisionEyes.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.VisionPrescription.PrismComponent convertPrismComponent(org.hl7.fhir.r4.model.VisionPrescription.PrismComponent src) throws FHIRException { @@ -274,52 +293,60 @@ public static org.hl7.fhir.r4.model.VisionPrescription.PrismComponent convertPri } static public org.hl7.fhir.r5.model.Enumeration convertVisionBase(org.hl7.fhir.r4.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.VisionPrescription.VisionBaseEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case UP: - tgt.setValue(org.hl7.fhir.r5.model.VisionPrescription.VisionBase.UP); - break; - case DOWN: - tgt.setValue(org.hl7.fhir.r5.model.VisionPrescription.VisionBase.DOWN); - break; - case IN: - tgt.setValue(org.hl7.fhir.r5.model.VisionPrescription.VisionBase.IN); - break; - case OUT: - tgt.setValue(org.hl7.fhir.r5.model.VisionPrescription.VisionBase.OUT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.VisionPrescription.VisionBase.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new org.hl7.fhir.r5.model.VisionPrescription.VisionBaseEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case UP: + tgt.setValue(org.hl7.fhir.r5.model.VisionPrescription.VisionBase.UP); + break; + case DOWN: + tgt.setValue(org.hl7.fhir.r5.model.VisionPrescription.VisionBase.DOWN); + break; + case IN: + tgt.setValue(org.hl7.fhir.r5.model.VisionPrescription.VisionBase.IN); + break; + case OUT: + tgt.setValue(org.hl7.fhir.r5.model.VisionPrescription.VisionBase.OUT); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.VisionPrescription.VisionBase.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4.model.Enumeration convertVisionBase(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.VisionPrescription.VisionBaseEnumFactory()); - ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); - switch (src.getValue()) { - case UP: - tgt.setValue(org.hl7.fhir.r4.model.VisionPrescription.VisionBase.UP); - break; - case DOWN: - tgt.setValue(org.hl7.fhir.r4.model.VisionPrescription.VisionBase.DOWN); - break; - case IN: - tgt.setValue(org.hl7.fhir.r4.model.VisionPrescription.VisionBase.IN); - break; - case OUT: - tgt.setValue(org.hl7.fhir.r4.model.VisionPrescription.VisionBase.OUT); - break; - default: - tgt.setValue(org.hl7.fhir.r4.model.VisionPrescription.VisionBase.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4.model.Enumeration tgt = new org.hl7.fhir.r4.model.Enumeration<>(new VisionPrescription.VisionBaseEnumFactory()); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case UP: + tgt.setValue(VisionPrescription.VisionBase.UP); + break; + case DOWN: + tgt.setValue(VisionPrescription.VisionBase.DOWN); + break; + case IN: + tgt.setValue(VisionPrescription.VisionBase.IN); + break; + case OUT: + tgt.setValue(VisionPrescription.VisionBase.OUT); + break; + default: + tgt.setValue(VisionPrescription.VisionBase.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Address43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Address43_50.java index fd62ae9f54..231b78048f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Address43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Address43_50.java @@ -3,6 +3,7 @@ import org.hl7.fhir.convertors.context.ConversionContext43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Address; public class Address43_50 { public static org.hl7.fhir.r5.model.Address convertAddress(org.hl7.fhir.r4b.model.Address src) throws FHIRException { @@ -44,29 +45,29 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Address.AddressUseEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HOME: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressUse.HOME); - break; - case WORK: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressUse.WORK); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressUse.OLD); - break; - case BILLING: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressUse.BILLING); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressUse.NULL); - break; - } - } + tgt.setValue(Address.AddressUse.HOME); + break; + case WORK: + tgt.setValue(Address.AddressUse.WORK); + break; + case TEMP: + tgt.setValue(Address.AddressUse.TEMP); + break; + case OLD: + tgt.setValue(Address.AddressUse.OLD); + break; + case BILLING: + tgt.setValue(Address.AddressUse.BILLING); + break; + default: + tgt.setValue(Address.AddressUse.NULL); + break; + } +} return tgt; } @@ -75,29 +76,29 @@ static public org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Address.AddressUseEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4b.model.Address.AddressUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HOME: - tgt.setValue(org.hl7.fhir.r4b.model.Address.AddressUse.HOME); - break; - case WORK: - tgt.setValue(org.hl7.fhir.r4b.model.Address.AddressUse.WORK); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.r4b.model.Address.AddressUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.r4b.model.Address.AddressUse.OLD); - break; - case BILLING: - tgt.setValue(org.hl7.fhir.r4b.model.Address.AddressUse.BILLING); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Address.AddressUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4b.model.Address.AddressUse.HOME); + break; + case WORK: + tgt.setValue(org.hl7.fhir.r4b.model.Address.AddressUse.WORK); + break; + case TEMP: + tgt.setValue(org.hl7.fhir.r4b.model.Address.AddressUse.TEMP); + break; + case OLD: + tgt.setValue(org.hl7.fhir.r4b.model.Address.AddressUse.OLD); + break; + case BILLING: + tgt.setValue(org.hl7.fhir.r4b.model.Address.AddressUse.BILLING); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Address.AddressUse.NULL); + break; + } +} return tgt; } @@ -106,23 +107,23 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Address.AddressTypeEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case POSTAL: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressType.POSTAL); - break; - case PHYSICAL: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressType.PHYSICAL); - break; - case BOTH: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressType.BOTH); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Address.AddressType.NULL); - break; - } - } + tgt.setValue(Address.AddressType.POSTAL); + break; + case PHYSICAL: + tgt.setValue(Address.AddressType.PHYSICAL); + break; + case BOTH: + tgt.setValue(Address.AddressType.BOTH); + break; + default: + tgt.setValue(Address.AddressType.NULL); + break; + } +} return tgt; } @@ -131,23 +132,23 @@ static public org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Address.AddressTypeEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4b.model.Address.AddressType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case POSTAL: - tgt.setValue(org.hl7.fhir.r4b.model.Address.AddressType.POSTAL); - break; - case PHYSICAL: - tgt.setValue(org.hl7.fhir.r4b.model.Address.AddressType.PHYSICAL); - break; - case BOTH: - tgt.setValue(org.hl7.fhir.r4b.model.Address.AddressType.BOTH); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Address.AddressType.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4b.model.Address.AddressType.POSTAL); + break; + case PHYSICAL: + tgt.setValue(org.hl7.fhir.r4b.model.Address.AddressType.PHYSICAL); + break; + case BOTH: + tgt.setValue(org.hl7.fhir.r4b.model.Address.AddressType.BOTH); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Address.AddressType.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/ContactPoint43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/ContactPoint43_50.java index 32978e4865..587f55074f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/ContactPoint43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/ContactPoint43_50.java @@ -4,6 +4,7 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.PositiveInt43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.ContactPoint; public class ContactPoint43_50 { public static org.hl7.fhir.r5.model.ContactPoint convertContactPoint(org.hl7.fhir.r4b.model.ContactPoint src) throws FHIRException { @@ -35,35 +36,35 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ContactPoint.ContactPointSystemEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case PHONE: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.PHONE); - break; - case FAX: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.FAX); - break; - case EMAIL: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.EMAIL); - break; - case PAGER: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.PAGER); - break; - case URL: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.URL); - break; - case SMS: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.SMS); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.NULL); - break; - } - } + tgt.setValue(ContactPoint.ContactPointSystem.PHONE); + break; + case FAX: + tgt.setValue(ContactPoint.ContactPointSystem.FAX); + break; + case EMAIL: + tgt.setValue(ContactPoint.ContactPointSystem.EMAIL); + break; + case PAGER: + tgt.setValue(ContactPoint.ContactPointSystem.PAGER); + break; + case URL: + tgt.setValue(ContactPoint.ContactPointSystem.URL); + break; + case SMS: + tgt.setValue(ContactPoint.ContactPointSystem.SMS); + break; + case OTHER: + tgt.setValue(ContactPoint.ContactPointSystem.OTHER); + break; + default: + tgt.setValue(ContactPoint.ContactPointSystem.NULL); + break; + } +} return tgt; } @@ -72,35 +73,35 @@ static public org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.ContactPoint.ContactPointSystemEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointSystem.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case PHONE: - tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointSystem.PHONE); - break; - case FAX: - tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointSystem.FAX); - break; - case EMAIL: - tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointSystem.EMAIL); - break; - case PAGER: - tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointSystem.PAGER); - break; - case URL: - tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointSystem.URL); - break; - case SMS: - tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointSystem.SMS); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointSystem.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointSystem.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointSystem.PHONE); + break; + case FAX: + tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointSystem.FAX); + break; + case EMAIL: + tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointSystem.EMAIL); + break; + case PAGER: + tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointSystem.PAGER); + break; + case URL: + tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointSystem.URL); + break; + case SMS: + tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointSystem.SMS); + break; + case OTHER: + tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointSystem.OTHER); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointSystem.NULL); + break; + } +} return tgt; } @@ -109,29 +110,29 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ContactPoint.ContactPointUseEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HOME: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.HOME); - break; - case WORK: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.WORK); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.OLD); - break; - case MOBILE: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.MOBILE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.NULL); - break; - } - } + tgt.setValue(ContactPoint.ContactPointUse.HOME); + break; + case WORK: + tgt.setValue(ContactPoint.ContactPointUse.WORK); + break; + case TEMP: + tgt.setValue(ContactPoint.ContactPointUse.TEMP); + break; + case OLD: + tgt.setValue(ContactPoint.ContactPointUse.OLD); + break; + case MOBILE: + tgt.setValue(ContactPoint.ContactPointUse.MOBILE); + break; + default: + tgt.setValue(ContactPoint.ContactPointUse.NULL); + break; + } +} return tgt; } @@ -140,29 +141,29 @@ static public org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.ContactPoint.ContactPointUseEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case HOME: - tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointUse.HOME); - break; - case WORK: - tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointUse.WORK); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointUse.TEMP); - break; - case OLD: - tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointUse.OLD); - break; - case MOBILE: - tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointUse.MOBILE); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointUse.HOME); + break; + case WORK: + tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointUse.WORK); + break; + case TEMP: + tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointUse.TEMP); + break; + case OLD: + tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointUse.OLD); + break; + case MOBILE: + tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointUse.MOBILE); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointUse.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/HumanName43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/HumanName43_50.java index d6cfb67c24..fbc6bfe27a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/HumanName43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/HumanName43_50.java @@ -3,6 +3,7 @@ import org.hl7.fhir.convertors.context.ConversionContext43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.HumanName; public class HumanName43_50 { public static org.hl7.fhir.r5.model.HumanName convertHumanName(org.hl7.fhir.r4b.model.HumanName src) throws FHIRException { @@ -38,35 +39,35 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.HumanName.NameUseEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case USUAL: - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.USUAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.OFFICIAL); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.TEMP); - break; - case NICKNAME: - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.NICKNAME); - break; - case ANONYMOUS: - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.ANONYMOUS); - break; - case OLD: - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.OLD); - break; - case MAIDEN: - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.MAIDEN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.NULL); - break; - } - } + tgt.setValue(HumanName.NameUse.USUAL); + break; + case OFFICIAL: + tgt.setValue(HumanName.NameUse.OFFICIAL); + break; + case TEMP: + tgt.setValue(HumanName.NameUse.TEMP); + break; + case NICKNAME: + tgt.setValue(HumanName.NameUse.NICKNAME); + break; + case ANONYMOUS: + tgt.setValue(HumanName.NameUse.ANONYMOUS); + break; + case OLD: + tgt.setValue(HumanName.NameUse.OLD); + break; + case MAIDEN: + tgt.setValue(HumanName.NameUse.MAIDEN); + break; + default: + tgt.setValue(HumanName.NameUse.NULL); + break; + } +} return tgt; } @@ -75,35 +76,35 @@ static public org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.HumanName.NameUseEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4b.model.HumanName.NameUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case USUAL: - tgt.setValue(org.hl7.fhir.r4b.model.HumanName.NameUse.USUAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.r4b.model.HumanName.NameUse.OFFICIAL); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.r4b.model.HumanName.NameUse.TEMP); - break; - case NICKNAME: - tgt.setValue(org.hl7.fhir.r4b.model.HumanName.NameUse.NICKNAME); - break; - case ANONYMOUS: - tgt.setValue(org.hl7.fhir.r4b.model.HumanName.NameUse.ANONYMOUS); - break; - case OLD: - tgt.setValue(org.hl7.fhir.r4b.model.HumanName.NameUse.OLD); - break; - case MAIDEN: - tgt.setValue(org.hl7.fhir.r4b.model.HumanName.NameUse.MAIDEN); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.HumanName.NameUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4b.model.HumanName.NameUse.USUAL); + break; + case OFFICIAL: + tgt.setValue(org.hl7.fhir.r4b.model.HumanName.NameUse.OFFICIAL); + break; + case TEMP: + tgt.setValue(org.hl7.fhir.r4b.model.HumanName.NameUse.TEMP); + break; + case NICKNAME: + tgt.setValue(org.hl7.fhir.r4b.model.HumanName.NameUse.NICKNAME); + break; + case ANONYMOUS: + tgt.setValue(org.hl7.fhir.r4b.model.HumanName.NameUse.ANONYMOUS); + break; + case OLD: + tgt.setValue(org.hl7.fhir.r4b.model.HumanName.NameUse.OLD); + break; + case MAIDEN: + tgt.setValue(org.hl7.fhir.r4b.model.HumanName.NameUse.MAIDEN); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.HumanName.NameUse.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Identifier43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Identifier43_50.java index acb8fa87d7..fc4fdd1e17 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Identifier43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Identifier43_50.java @@ -5,6 +5,7 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Identifier; public class Identifier43_50 { public static org.hl7.fhir.r5.model.Identifier convertIdentifier(org.hl7.fhir.r4b.model.Identifier src) throws FHIRException { @@ -38,29 +39,29 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Identifier.IdentifierUseEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Identifier.IdentifierUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case USUAL: - tgt.setValue(org.hl7.fhir.r5.model.Identifier.IdentifierUse.USUAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.r5.model.Identifier.IdentifierUse.OFFICIAL); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.r5.model.Identifier.IdentifierUse.TEMP); - break; - case SECONDARY: - tgt.setValue(org.hl7.fhir.r5.model.Identifier.IdentifierUse.SECONDARY); - break; - case OLD: - tgt.setValue(org.hl7.fhir.r5.model.Identifier.IdentifierUse.OLD); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Identifier.IdentifierUse.NULL); - break; - } - } + tgt.setValue(Identifier.IdentifierUse.USUAL); + break; + case OFFICIAL: + tgt.setValue(Identifier.IdentifierUse.OFFICIAL); + break; + case TEMP: + tgt.setValue(Identifier.IdentifierUse.TEMP); + break; + case SECONDARY: + tgt.setValue(Identifier.IdentifierUse.SECONDARY); + break; + case OLD: + tgt.setValue(Identifier.IdentifierUse.OLD); + break; + default: + tgt.setValue(Identifier.IdentifierUse.NULL); + break; + } +} return tgt; } @@ -69,29 +70,29 @@ static public org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Identifier.IdentifierUseEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4b.model.Identifier.IdentifierUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case USUAL: - tgt.setValue(org.hl7.fhir.r4b.model.Identifier.IdentifierUse.USUAL); - break; - case OFFICIAL: - tgt.setValue(org.hl7.fhir.r4b.model.Identifier.IdentifierUse.OFFICIAL); - break; - case TEMP: - tgt.setValue(org.hl7.fhir.r4b.model.Identifier.IdentifierUse.TEMP); - break; - case SECONDARY: - tgt.setValue(org.hl7.fhir.r4b.model.Identifier.IdentifierUse.SECONDARY); - break; - case OLD: - tgt.setValue(org.hl7.fhir.r4b.model.Identifier.IdentifierUse.OLD); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Identifier.IdentifierUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4b.model.Identifier.IdentifierUse.USUAL); + break; + case OFFICIAL: + tgt.setValue(org.hl7.fhir.r4b.model.Identifier.IdentifierUse.OFFICIAL); + break; + case TEMP: + tgt.setValue(org.hl7.fhir.r4b.model.Identifier.IdentifierUse.TEMP); + break; + case SECONDARY: + tgt.setValue(org.hl7.fhir.r4b.model.Identifier.IdentifierUse.SECONDARY); + break; + case OLD: + tgt.setValue(org.hl7.fhir.r4b.model.Identifier.IdentifierUse.OLD); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Identifier.IdentifierUse.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Quantity43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Quantity43_50.java index e553abd23b..6ca831b2b0 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Quantity43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Quantity43_50.java @@ -6,6 +6,7 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumerations; public class Quantity43_50 { public static org.hl7.fhir.r5.model.Quantity convertQuantity(org.hl7.fhir.r4b.model.Quantity src) throws FHIRException { @@ -37,26 +38,26 @@ public static org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.QuantityComparatorEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.QuantityComparator.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case LESS_THAN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.QuantityComparator.LESS_THAN); - break; - case LESS_OR_EQUAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.QuantityComparator.LESS_OR_EQUAL); - break; - case GREATER_OR_EQUAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.QuantityComparator.GREATER_OR_EQUAL); - break; - case GREATER_THAN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.QuantityComparator.GREATER_THAN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.QuantityComparator.NULL); - break; - } - } + tgt.setValue(Enumerations.QuantityComparator.LESS_THAN); + break; + case LESS_OR_EQUAL: + tgt.setValue(Enumerations.QuantityComparator.LESS_OR_EQUAL); + break; + case GREATER_OR_EQUAL: + tgt.setValue(Enumerations.QuantityComparator.GREATER_OR_EQUAL); + break; + case GREATER_THAN: + tgt.setValue(Enumerations.QuantityComparator.GREATER_THAN); + break; + default: + tgt.setValue(Enumerations.QuantityComparator.NULL); + break; + } +} return tgt; } @@ -65,26 +66,26 @@ public static org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.QuantityComparatorEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.QuantityComparator.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case LESS_THAN: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.QuantityComparator.LESS_THAN); - break; - case LESS_OR_EQUAL: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.QuantityComparator.LESS_OR_EQUAL); - break; - case GREATER_OR_EQUAL: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.QuantityComparator.GREATER_OR_EQUAL); - break; - case GREATER_THAN: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.QuantityComparator.GREATER_THAN); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.QuantityComparator.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.QuantityComparator.LESS_THAN); + break; + case LESS_OR_EQUAL: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.QuantityComparator.LESS_OR_EQUAL); + break; + case GREATER_OR_EQUAL: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.QuantityComparator.GREATER_OR_EQUAL); + break; + case GREATER_THAN: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.QuantityComparator.GREATER_THAN); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.QuantityComparator.NULL); + break; + } +} return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Timing43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Timing43_50.java index db7223e6cf..ca807a8ff3 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Timing43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Timing43_50.java @@ -11,6 +11,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Time43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.UnsignedInt43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumerations; +import org.hl7.fhir.r5.model.Timing; public class Timing43_50 { public static org.hl7.fhir.r4b.model.Timing convertTiming(org.hl7.fhir.r5.model.Timing src) throws FHIRException { @@ -88,35 +90,35 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Timing.UnitsOfTimeEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case S: - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.S); - break; - case MIN: - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.MIN); - break; - case H: - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.H); - break; - case D: - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.D); - break; - case WK: - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.WK); - break; - case MO: - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.MO); - break; - case A: - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.A); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.NULL); - break; - } - } + tgt.setValue(Timing.UnitsOfTime.S); + break; + case MIN: + tgt.setValue(Timing.UnitsOfTime.MIN); + break; + case H: + tgt.setValue(Timing.UnitsOfTime.H); + break; + case D: + tgt.setValue(Timing.UnitsOfTime.D); + break; + case WK: + tgt.setValue(Timing.UnitsOfTime.WK); + break; + case MO: + tgt.setValue(Timing.UnitsOfTime.MO); + break; + case A: + tgt.setValue(Timing.UnitsOfTime.A); + break; + default: + tgt.setValue(Timing.UnitsOfTime.NULL); + break; + } +} return tgt; } @@ -125,35 +127,35 @@ static public org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Timing.UnitsOfTimeEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4b.model.Timing.UnitsOfTime.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case S: - tgt.setValue(org.hl7.fhir.r4b.model.Timing.UnitsOfTime.S); - break; - case MIN: - tgt.setValue(org.hl7.fhir.r4b.model.Timing.UnitsOfTime.MIN); - break; - case H: - tgt.setValue(org.hl7.fhir.r4b.model.Timing.UnitsOfTime.H); - break; - case D: - tgt.setValue(org.hl7.fhir.r4b.model.Timing.UnitsOfTime.D); - break; - case WK: - tgt.setValue(org.hl7.fhir.r4b.model.Timing.UnitsOfTime.WK); - break; - case MO: - tgt.setValue(org.hl7.fhir.r4b.model.Timing.UnitsOfTime.MO); - break; - case A: - tgt.setValue(org.hl7.fhir.r4b.model.Timing.UnitsOfTime.A); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Timing.UnitsOfTime.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4b.model.Timing.UnitsOfTime.S); + break; + case MIN: + tgt.setValue(org.hl7.fhir.r4b.model.Timing.UnitsOfTime.MIN); + break; + case H: + tgt.setValue(org.hl7.fhir.r4b.model.Timing.UnitsOfTime.H); + break; + case D: + tgt.setValue(org.hl7.fhir.r4b.model.Timing.UnitsOfTime.D); + break; + case WK: + tgt.setValue(org.hl7.fhir.r4b.model.Timing.UnitsOfTime.WK); + break; + case MO: + tgt.setValue(org.hl7.fhir.r4b.model.Timing.UnitsOfTime.MO); + break; + case A: + tgt.setValue(org.hl7.fhir.r4b.model.Timing.UnitsOfTime.A); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Timing.UnitsOfTime.NULL); + break; + } +} return tgt; } @@ -162,35 +164,35 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.DaysOfWeekEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case MON: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.MON); - break; - case TUE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.TUE); - break; - case WED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.WED); - break; - case THU: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.THU); - break; - case FRI: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.FRI); - break; - case SAT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.SAT); - break; - case SUN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.SUN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.NULL); - break; - } - } + tgt.setValue(Enumerations.DaysOfWeek.MON); + break; + case TUE: + tgt.setValue(Enumerations.DaysOfWeek.TUE); + break; + case WED: + tgt.setValue(Enumerations.DaysOfWeek.WED); + break; + case THU: + tgt.setValue(Enumerations.DaysOfWeek.THU); + break; + case FRI: + tgt.setValue(Enumerations.DaysOfWeek.FRI); + break; + case SAT: + tgt.setValue(Enumerations.DaysOfWeek.SAT); + break; + case SUN: + tgt.setValue(Enumerations.DaysOfWeek.SUN); + break; + default: + tgt.setValue(Enumerations.DaysOfWeek.NULL); + break; + } +} return tgt; } @@ -199,35 +201,35 @@ static public org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.DaysOfWeekEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case MON: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.MON); - break; - case TUE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.TUE); - break; - case WED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.WED); - break; - case THU: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.THU); - break; - case FRI: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.FRI); - break; - case SAT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.SAT); - break; - case SUN: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.SUN); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.MON); + break; + case TUE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.TUE); + break; + case WED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.WED); + break; + case THU: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.THU); + break; + case FRI: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.FRI); + break; + case SAT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.SAT); + break; + case SUN: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.SUN); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.NULL); + break; + } +} return tgt; } @@ -236,92 +238,92 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Timing.EventTimingEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case MORN: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.MORN); - break; - case MORN_EARLY: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.MORN_EARLY); - break; - case MORN_LATE: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.MORN_LATE); - break; - case NOON: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.NOON); - break; - case AFT: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.AFT); - break; - case AFT_EARLY: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.AFT_EARLY); - break; - case AFT_LATE: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.AFT_LATE); - break; - case EVE: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.EVE); - break; - case EVE_EARLY: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.EVE_EARLY); - break; - case EVE_LATE: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.EVE_LATE); - break; - case NIGHT: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.NIGHT); - break; - case PHS: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.PHS); - break; - case HS: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.HS); - break; - case WAKE: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.WAKE); - break; - case C: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.C); - break; - case CM: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.CM); - break; - case CD: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.CD); - break; - case CV: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.CV); - break; - case AC: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.AC); - break; - case ACM: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.ACM); - break; - case ACD: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.ACD); - break; - case ACV: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.ACV); - break; - case PC: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.PC); - break; - case PCM: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.PCM); - break; - case PCD: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.PCD); - break; - case PCV: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.PCV); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.NULL); - break; - } - } + tgt.setValue(Timing.EventTiming.MORN); + break; + case MORN_EARLY: + tgt.setValue(Timing.EventTiming.MORN_EARLY); + break; + case MORN_LATE: + tgt.setValue(Timing.EventTiming.MORN_LATE); + break; + case NOON: + tgt.setValue(Timing.EventTiming.NOON); + break; + case AFT: + tgt.setValue(Timing.EventTiming.AFT); + break; + case AFT_EARLY: + tgt.setValue(Timing.EventTiming.AFT_EARLY); + break; + case AFT_LATE: + tgt.setValue(Timing.EventTiming.AFT_LATE); + break; + case EVE: + tgt.setValue(Timing.EventTiming.EVE); + break; + case EVE_EARLY: + tgt.setValue(Timing.EventTiming.EVE_EARLY); + break; + case EVE_LATE: + tgt.setValue(Timing.EventTiming.EVE_LATE); + break; + case NIGHT: + tgt.setValue(Timing.EventTiming.NIGHT); + break; + case PHS: + tgt.setValue(Timing.EventTiming.PHS); + break; + case HS: + tgt.setValue(Timing.EventTiming.HS); + break; + case WAKE: + tgt.setValue(Timing.EventTiming.WAKE); + break; + case C: + tgt.setValue(Timing.EventTiming.C); + break; + case CM: + tgt.setValue(Timing.EventTiming.CM); + break; + case CD: + tgt.setValue(Timing.EventTiming.CD); + break; + case CV: + tgt.setValue(Timing.EventTiming.CV); + break; + case AC: + tgt.setValue(Timing.EventTiming.AC); + break; + case ACM: + tgt.setValue(Timing.EventTiming.ACM); + break; + case ACD: + tgt.setValue(Timing.EventTiming.ACD); + break; + case ACV: + tgt.setValue(Timing.EventTiming.ACV); + break; + case PC: + tgt.setValue(Timing.EventTiming.PC); + break; + case PCM: + tgt.setValue(Timing.EventTiming.PCM); + break; + case PCD: + tgt.setValue(Timing.EventTiming.PCD); + break; + case PCV: + tgt.setValue(Timing.EventTiming.PCV); + break; + default: + tgt.setValue(Timing.EventTiming.NULL); + break; + } +} return tgt; } @@ -330,92 +332,92 @@ static public org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Timing.EventTimingEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case MORN: - tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.MORN); - break; - case MORN_EARLY: - tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.MORN_EARLY); - break; - case MORN_LATE: - tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.MORN_LATE); - break; - case NOON: - tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.NOON); - break; - case AFT: - tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.AFT); - break; - case AFT_EARLY: - tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.AFT_EARLY); - break; - case AFT_LATE: - tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.AFT_LATE); - break; - case EVE: - tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.EVE); - break; - case EVE_EARLY: - tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.EVE_EARLY); - break; - case EVE_LATE: - tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.EVE_LATE); - break; - case NIGHT: - tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.NIGHT); - break; - case PHS: - tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.PHS); - break; - case HS: - tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.HS); - break; - case WAKE: - tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.WAKE); - break; - case C: - tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.C); - break; - case CM: - tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.CM); - break; - case CD: - tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.CD); - break; - case CV: - tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.CV); - break; - case AC: - tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.AC); - break; - case ACM: - tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.ACM); - break; - case ACD: - tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.ACD); - break; - case ACV: - tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.ACV); - break; - case PC: - tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.PC); - break; - case PCM: - tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.PCM); - break; - case PCD: - tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.PCD); - break; - case PCV: - tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.PCV); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.MORN); + break; + case MORN_EARLY: + tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.MORN_EARLY); + break; + case MORN_LATE: + tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.MORN_LATE); + break; + case NOON: + tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.NOON); + break; + case AFT: + tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.AFT); + break; + case AFT_EARLY: + tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.AFT_EARLY); + break; + case AFT_LATE: + tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.AFT_LATE); + break; + case EVE: + tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.EVE); + break; + case EVE_EARLY: + tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.EVE_EARLY); + break; + case EVE_LATE: + tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.EVE_LATE); + break; + case NIGHT: + tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.NIGHT); + break; + case PHS: + tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.PHS); + break; + case HS: + tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.HS); + break; + case WAKE: + tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.WAKE); + break; + case C: + tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.C); + break; + case CM: + tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.CM); + break; + case CD: + tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.CD); + break; + case CV: + tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.CV); + break; + case AC: + tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.AC); + break; + case ACM: + tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.ACM); + break; + case ACD: + tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.ACD); + break; + case ACV: + tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.ACV); + break; + case PC: + tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.PC); + break; + case PCM: + tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.PCM); + break; + case PCD: + tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.PCD); + break; + case PCV: + tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.PCV); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/Contributor43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/Contributor43_50.java index 162277aaeb..0057ea22d5 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/Contributor43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/Contributor43_50.java @@ -3,6 +3,7 @@ import org.hl7.fhir.convertors.context.ConversionContext43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Contributor; public class Contributor43_50 { public static org.hl7.fhir.r5.model.Contributor convertContributor(org.hl7.fhir.r4b.model.Contributor src) throws FHIRException { @@ -32,26 +33,26 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Contributor.ContributorTypeEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Contributor.ContributorType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case AUTHOR: - tgt.setValue(org.hl7.fhir.r5.model.Contributor.ContributorType.AUTHOR); - break; - case EDITOR: - tgt.setValue(org.hl7.fhir.r5.model.Contributor.ContributorType.EDITOR); - break; - case REVIEWER: - tgt.setValue(org.hl7.fhir.r5.model.Contributor.ContributorType.REVIEWER); - break; - case ENDORSER: - tgt.setValue(org.hl7.fhir.r5.model.Contributor.ContributorType.ENDORSER); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Contributor.ContributorType.NULL); - break; - } - } + tgt.setValue(Contributor.ContributorType.AUTHOR); + break; + case EDITOR: + tgt.setValue(Contributor.ContributorType.EDITOR); + break; + case REVIEWER: + tgt.setValue(Contributor.ContributorType.REVIEWER); + break; + case ENDORSER: + tgt.setValue(Contributor.ContributorType.ENDORSER); + break; + default: + tgt.setValue(Contributor.ContributorType.NULL); + break; + } +} return tgt; } @@ -60,26 +61,26 @@ static public org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Contributor.ContributorTypeEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4b.model.Contributor.ContributorType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case AUTHOR: - tgt.setValue(org.hl7.fhir.r4b.model.Contributor.ContributorType.AUTHOR); - break; - case EDITOR: - tgt.setValue(org.hl7.fhir.r4b.model.Contributor.ContributorType.EDITOR); - break; - case REVIEWER: - tgt.setValue(org.hl7.fhir.r4b.model.Contributor.ContributorType.REVIEWER); - break; - case ENDORSER: - tgt.setValue(org.hl7.fhir.r4b.model.Contributor.ContributorType.ENDORSER); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Contributor.ContributorType.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4b.model.Contributor.ContributorType.AUTHOR); + break; + case EDITOR: + tgt.setValue(org.hl7.fhir.r4b.model.Contributor.ContributorType.EDITOR); + break; + case REVIEWER: + tgt.setValue(org.hl7.fhir.r4b.model.Contributor.ContributorType.REVIEWER); + break; + case ENDORSER: + tgt.setValue(org.hl7.fhir.r4b.model.Contributor.ContributorType.ENDORSER); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Contributor.ContributorType.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/DataRequirement43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/DataRequirement43_50.java index d2608057f6..1cbd678213 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/DataRequirement43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/DataRequirement43_50.java @@ -7,6 +7,7 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.PositiveInt43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.DataRequirement; public class DataRequirement43_50 { public static org.hl7.fhir.r5.model.DataRequirement convertDataRequirement(org.hl7.fhir.r4b.model.DataRequirement src) throws FHIRException { @@ -122,20 +123,20 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DataRequirement.SortDirectionEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.DataRequirement.SortDirection.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case ASCENDING: - tgt.setValue(org.hl7.fhir.r5.model.DataRequirement.SortDirection.ASCENDING); - break; - case DESCENDING: - tgt.setValue(org.hl7.fhir.r5.model.DataRequirement.SortDirection.DESCENDING); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.DataRequirement.SortDirection.NULL); - break; - } - } + tgt.setValue(DataRequirement.SortDirection.ASCENDING); + break; + case DESCENDING: + tgt.setValue(DataRequirement.SortDirection.DESCENDING); + break; + default: + tgt.setValue(DataRequirement.SortDirection.NULL); + break; + } +} return tgt; } @@ -144,20 +145,20 @@ static public org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.DataRequirement.SortDirectionEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4b.model.DataRequirement.SortDirection.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case ASCENDING: - tgt.setValue(org.hl7.fhir.r4b.model.DataRequirement.SortDirection.ASCENDING); - break; - case DESCENDING: - tgt.setValue(org.hl7.fhir.r4b.model.DataRequirement.SortDirection.DESCENDING); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.DataRequirement.SortDirection.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4b.model.DataRequirement.SortDirection.ASCENDING); + break; + case DESCENDING: + tgt.setValue(org.hl7.fhir.r4b.model.DataRequirement.SortDirection.DESCENDING); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.DataRequirement.SortDirection.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/ParameterDefinition43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/ParameterDefinition43_50.java index 461dc791c1..01f1bd3193 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/ParameterDefinition43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/ParameterDefinition43_50.java @@ -7,6 +7,7 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Integer43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumerations; public class ParameterDefinition43_50 { public static org.hl7.fhir.r5.model.ParameterDefinition convertParameterDefinition(org.hl7.fhir.r4b.model.ParameterDefinition src) throws FHIRException { @@ -46,20 +47,20 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.OperationParameterUseEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.OperationParameterUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case IN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.OperationParameterUse.IN); - break; - case OUT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.OperationParameterUse.OUT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.OperationParameterUse.NULL); - break; - } - } + tgt.setValue(Enumerations.OperationParameterUse.IN); + break; + case OUT: + tgt.setValue(Enumerations.OperationParameterUse.OUT); + break; + default: + tgt.setValue(Enumerations.OperationParameterUse.NULL); + break; + } +} return tgt; } @@ -68,20 +69,20 @@ static public org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.OperationParameterUseEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.OperationParameterUse.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case IN: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.OperationParameterUse.IN); - break; - case OUT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.OperationParameterUse.OUT); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.OperationParameterUse.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.OperationParameterUse.IN); + break; + case OUT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.OperationParameterUse.OUT); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.OperationParameterUse.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/RelatedArtifact43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/RelatedArtifact43_50.java index 0124e7af0d..f8c34f81df 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/RelatedArtifact43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/RelatedArtifact43_50.java @@ -7,6 +7,7 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Url43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.RelatedArtifact; public class RelatedArtifact43_50 { public static org.hl7.fhir.r5.model.RelatedArtifact convertRelatedArtifact(org.hl7.fhir.r4b.model.RelatedArtifact src) throws FHIRException { @@ -42,38 +43,38 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactTypeEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case DOCUMENTATION: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.DOCUMENTATION); - break; - case JUSTIFICATION: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.JUSTIFICATION); - break; - case CITATION: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.CITATION); - break; - case PREDECESSOR: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.PREDECESSOR); - break; - case SUCCESSOR: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.SUCCESSOR); - break; - case DERIVEDFROM: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.DERIVEDFROM); - break; - case DEPENDSON: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.DEPENDSON); - break; - case COMPOSEDOF: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.COMPOSEDOF); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.NULL); - break; - } - } + tgt.setValue(RelatedArtifact.RelatedArtifactType.DOCUMENTATION); + break; + case JUSTIFICATION: + tgt.setValue(RelatedArtifact.RelatedArtifactType.JUSTIFICATION); + break; + case CITATION: + tgt.setValue(RelatedArtifact.RelatedArtifactType.CITATION); + break; + case PREDECESSOR: + tgt.setValue(RelatedArtifact.RelatedArtifactType.PREDECESSOR); + break; + case SUCCESSOR: + tgt.setValue(RelatedArtifact.RelatedArtifactType.SUCCESSOR); + break; + case DERIVEDFROM: + tgt.setValue(RelatedArtifact.RelatedArtifactType.DERIVEDFROM); + break; + case DEPENDSON: + tgt.setValue(RelatedArtifact.RelatedArtifactType.DEPENDSON); + break; + case COMPOSEDOF: + tgt.setValue(RelatedArtifact.RelatedArtifactType.COMPOSEDOF); + break; + default: + tgt.setValue(RelatedArtifact.RelatedArtifactType.NULL); + break; + } +} return tgt; } @@ -82,38 +83,38 @@ static public org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.RelatedArtifact.RelatedArtifactTypeEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4b.model.RelatedArtifact.RelatedArtifactType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case DOCUMENTATION: - tgt.setValue(org.hl7.fhir.r4b.model.RelatedArtifact.RelatedArtifactType.DOCUMENTATION); - break; - case JUSTIFICATION: - tgt.setValue(org.hl7.fhir.r4b.model.RelatedArtifact.RelatedArtifactType.JUSTIFICATION); - break; - case CITATION: - tgt.setValue(org.hl7.fhir.r4b.model.RelatedArtifact.RelatedArtifactType.CITATION); - break; - case PREDECESSOR: - tgt.setValue(org.hl7.fhir.r4b.model.RelatedArtifact.RelatedArtifactType.PREDECESSOR); - break; - case SUCCESSOR: - tgt.setValue(org.hl7.fhir.r4b.model.RelatedArtifact.RelatedArtifactType.SUCCESSOR); - break; - case DERIVEDFROM: - tgt.setValue(org.hl7.fhir.r4b.model.RelatedArtifact.RelatedArtifactType.DERIVEDFROM); - break; - case DEPENDSON: - tgt.setValue(org.hl7.fhir.r4b.model.RelatedArtifact.RelatedArtifactType.DEPENDSON); - break; - case COMPOSEDOF: - tgt.setValue(org.hl7.fhir.r4b.model.RelatedArtifact.RelatedArtifactType.COMPOSEDOF); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.RelatedArtifact.RelatedArtifactType.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4b.model.RelatedArtifact.RelatedArtifactType.DOCUMENTATION); + break; + case JUSTIFICATION: + tgt.setValue(org.hl7.fhir.r4b.model.RelatedArtifact.RelatedArtifactType.JUSTIFICATION); + break; + case CITATION: + tgt.setValue(org.hl7.fhir.r4b.model.RelatedArtifact.RelatedArtifactType.CITATION); + break; + case PREDECESSOR: + tgt.setValue(org.hl7.fhir.r4b.model.RelatedArtifact.RelatedArtifactType.PREDECESSOR); + break; + case SUCCESSOR: + tgt.setValue(org.hl7.fhir.r4b.model.RelatedArtifact.RelatedArtifactType.SUCCESSOR); + break; + case DERIVEDFROM: + tgt.setValue(org.hl7.fhir.r4b.model.RelatedArtifact.RelatedArtifactType.DERIVEDFROM); + break; + case DEPENDSON: + tgt.setValue(org.hl7.fhir.r4b.model.RelatedArtifact.RelatedArtifactType.DEPENDSON); + break; + case COMPOSEDOF: + tgt.setValue(org.hl7.fhir.r4b.model.RelatedArtifact.RelatedArtifactType.COMPOSEDOF); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.RelatedArtifact.RelatedArtifactType.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/TriggerDefinition43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/TriggerDefinition43_50.java index 63f066ea1c..4abd416524 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/TriggerDefinition43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/TriggerDefinition43_50.java @@ -3,6 +3,7 @@ import org.hl7.fhir.convertors.context.ConversionContext43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.TriggerDefinition; public class TriggerDefinition43_50 { public static org.hl7.fhir.r5.model.TriggerDefinition convertTriggerDefinition(org.hl7.fhir.r4b.model.TriggerDefinition src) throws FHIRException { @@ -38,38 +39,38 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TriggerDefinition.TriggerTypeEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.TriggerDefinition.TriggerType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case NAMEDEVENT: - tgt.setValue(org.hl7.fhir.r5.model.TriggerDefinition.TriggerType.NAMEDEVENT); - break; - case PERIODIC: - tgt.setValue(org.hl7.fhir.r5.model.TriggerDefinition.TriggerType.PERIODIC); - break; - case DATACHANGED: - tgt.setValue(org.hl7.fhir.r5.model.TriggerDefinition.TriggerType.DATACHANGED); - break; - case DATAADDED: - tgt.setValue(org.hl7.fhir.r5.model.TriggerDefinition.TriggerType.DATAADDED); - break; - case DATAMODIFIED: - tgt.setValue(org.hl7.fhir.r5.model.TriggerDefinition.TriggerType.DATAMODIFIED); - break; - case DATAREMOVED: - tgt.setValue(org.hl7.fhir.r5.model.TriggerDefinition.TriggerType.DATAREMOVED); - break; - case DATAACCESSED: - tgt.setValue(org.hl7.fhir.r5.model.TriggerDefinition.TriggerType.DATAACCESSED); - break; - case DATAACCESSENDED: - tgt.setValue(org.hl7.fhir.r5.model.TriggerDefinition.TriggerType.DATAACCESSENDED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.TriggerDefinition.TriggerType.NULL); - break; - } - } + tgt.setValue(TriggerDefinition.TriggerType.NAMEDEVENT); + break; + case PERIODIC: + tgt.setValue(TriggerDefinition.TriggerType.PERIODIC); + break; + case DATACHANGED: + tgt.setValue(TriggerDefinition.TriggerType.DATACHANGED); + break; + case DATAADDED: + tgt.setValue(TriggerDefinition.TriggerType.DATAADDED); + break; + case DATAMODIFIED: + tgt.setValue(TriggerDefinition.TriggerType.DATAMODIFIED); + break; + case DATAREMOVED: + tgt.setValue(TriggerDefinition.TriggerType.DATAREMOVED); + break; + case DATAACCESSED: + tgt.setValue(TriggerDefinition.TriggerType.DATAACCESSED); + break; + case DATAACCESSENDED: + tgt.setValue(TriggerDefinition.TriggerType.DATAACCESSENDED); + break; + default: + tgt.setValue(TriggerDefinition.TriggerType.NULL); + break; + } +} return tgt; } @@ -78,38 +79,38 @@ static public org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.TriggerDefinition.TriggerTypeEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4b.model.TriggerDefinition.TriggerType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case NAMEDEVENT: - tgt.setValue(org.hl7.fhir.r4b.model.TriggerDefinition.TriggerType.NAMEDEVENT); - break; - case PERIODIC: - tgt.setValue(org.hl7.fhir.r4b.model.TriggerDefinition.TriggerType.PERIODIC); - break; - case DATACHANGED: - tgt.setValue(org.hl7.fhir.r4b.model.TriggerDefinition.TriggerType.DATACHANGED); - break; - case DATAADDED: - tgt.setValue(org.hl7.fhir.r4b.model.TriggerDefinition.TriggerType.DATAADDED); - break; - case DATAMODIFIED: - tgt.setValue(org.hl7.fhir.r4b.model.TriggerDefinition.TriggerType.DATAMODIFIED); - break; - case DATAREMOVED: - tgt.setValue(org.hl7.fhir.r4b.model.TriggerDefinition.TriggerType.DATAREMOVED); - break; - case DATAACCESSED: - tgt.setValue(org.hl7.fhir.r4b.model.TriggerDefinition.TriggerType.DATAACCESSED); - break; - case DATAACCESSENDED: - tgt.setValue(org.hl7.fhir.r4b.model.TriggerDefinition.TriggerType.DATAACCESSENDED); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.TriggerDefinition.TriggerType.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4b.model.TriggerDefinition.TriggerType.NAMEDEVENT); + break; + case PERIODIC: + tgt.setValue(org.hl7.fhir.r4b.model.TriggerDefinition.TriggerType.PERIODIC); + break; + case DATACHANGED: + tgt.setValue(org.hl7.fhir.r4b.model.TriggerDefinition.TriggerType.DATACHANGED); + break; + case DATAADDED: + tgt.setValue(org.hl7.fhir.r4b.model.TriggerDefinition.TriggerType.DATAADDED); + break; + case DATAMODIFIED: + tgt.setValue(org.hl7.fhir.r4b.model.TriggerDefinition.TriggerType.DATAMODIFIED); + break; + case DATAREMOVED: + tgt.setValue(org.hl7.fhir.r4b.model.TriggerDefinition.TriggerType.DATAREMOVED); + break; + case DATAACCESSED: + tgt.setValue(org.hl7.fhir.r4b.model.TriggerDefinition.TriggerType.DATAACCESSED); + break; + case DATAACCESSENDED: + tgt.setValue(org.hl7.fhir.r4b.model.TriggerDefinition.TriggerType.DATAACCESSENDED); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.TriggerDefinition.TriggerType.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/special43_50/ElementDefinition43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/special43_50/ElementDefinition43_50.java index 507366fe45..16830ce4e2 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/special43_50/ElementDefinition43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/special43_50/ElementDefinition43_50.java @@ -28,6 +28,7 @@ import org.hl7.fhir.r4b.model.MarkdownType; import org.hl7.fhir.r4b.model.StringType; import org.hl7.fhir.r5.model.CodeType; +import org.hl7.fhir.r5.model.ElementDefinition; import org.hl7.fhir.r5.model.UsageContext; import org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionBindingAdditionalComponent; @@ -160,29 +161,29 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentationEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case XMLATTR: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.XMLATTR); - break; - case XMLTEXT: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.XMLTEXT); - break; - case TYPEATTR: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.TYPEATTR); - break; - case CDATEXT: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.CDATEXT); - break; - case XHTML: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.XHTML); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.NULL); - break; - } - } + tgt.setValue(ElementDefinition.PropertyRepresentation.XMLATTR); + break; + case XMLTEXT: + tgt.setValue(ElementDefinition.PropertyRepresentation.XMLTEXT); + break; + case TYPEATTR: + tgt.setValue(ElementDefinition.PropertyRepresentation.TYPEATTR); + break; + case CDATEXT: + tgt.setValue(ElementDefinition.PropertyRepresentation.CDATEXT); + break; + case XHTML: + tgt.setValue(ElementDefinition.PropertyRepresentation.XHTML); + break; + default: + tgt.setValue(ElementDefinition.PropertyRepresentation.NULL); + break; + } +} return tgt; } @@ -191,29 +192,29 @@ static public org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.ElementDefinition.PropertyRepresentationEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.PropertyRepresentation.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case XMLATTR: - tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.PropertyRepresentation.XMLATTR); - break; - case XMLTEXT: - tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.PropertyRepresentation.XMLTEXT); - break; - case TYPEATTR: - tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.PropertyRepresentation.TYPEATTR); - break; - case CDATEXT: - tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.PropertyRepresentation.CDATEXT); - break; - case XHTML: - tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.PropertyRepresentation.XHTML); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.PropertyRepresentation.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.PropertyRepresentation.XMLATTR); + break; + case XMLTEXT: + tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.PropertyRepresentation.XMLTEXT); + break; + case TYPEATTR: + tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.PropertyRepresentation.TYPEATTR); + break; + case CDATEXT: + tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.PropertyRepresentation.CDATEXT); + break; + case XHTML: + tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.PropertyRepresentation.XHTML); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.PropertyRepresentation.NULL); + break; + } +} return tgt; } @@ -246,23 +247,23 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ElementDefinition.SlicingRulesEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.SlicingRules.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CLOSED: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.SlicingRules.CLOSED); - break; - case OPEN: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.SlicingRules.OPEN); - break; - case OPENATEND: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.SlicingRules.OPENATEND); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.SlicingRules.NULL); - break; - } - } + tgt.setValue(ElementDefinition.SlicingRules.CLOSED); + break; + case OPEN: + tgt.setValue(ElementDefinition.SlicingRules.OPEN); + break; + case OPENATEND: + tgt.setValue(ElementDefinition.SlicingRules.OPENATEND); + break; + default: + tgt.setValue(ElementDefinition.SlicingRules.NULL); + break; + } +} return tgt; } @@ -271,23 +272,23 @@ static public org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.ElementDefinition.SlicingRulesEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.SlicingRules.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CLOSED: - tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.SlicingRules.CLOSED); - break; - case OPEN: - tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.SlicingRules.OPEN); - break; - case OPENATEND: - tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.SlicingRules.OPENATEND); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.SlicingRules.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.SlicingRules.CLOSED); + break; + case OPEN: + tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.SlicingRules.OPEN); + break; + case OPENATEND: + tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.SlicingRules.OPENATEND); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.SlicingRules.NULL); + break; + } +} return tgt; } @@ -314,29 +315,29 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ElementDefinition.DiscriminatorTypeEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.DiscriminatorType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case VALUE: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.DiscriminatorType.VALUE); - break; - case EXISTS: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.DiscriminatorType.EXISTS); - break; - case PATTERN: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.DiscriminatorType.PATTERN); - break; - case TYPE: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.DiscriminatorType.TYPE); - break; - case PROFILE: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.DiscriminatorType.PROFILE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.DiscriminatorType.NULL); - break; - } - } + tgt.setValue(ElementDefinition.DiscriminatorType.VALUE); + break; + case EXISTS: + tgt.setValue(ElementDefinition.DiscriminatorType.EXISTS); + break; + case PATTERN: + tgt.setValue(ElementDefinition.DiscriminatorType.PATTERN); + break; + case TYPE: + tgt.setValue(ElementDefinition.DiscriminatorType.TYPE); + break; + case PROFILE: + tgt.setValue(ElementDefinition.DiscriminatorType.PROFILE); + break; + default: + tgt.setValue(ElementDefinition.DiscriminatorType.NULL); + break; + } +} return tgt; } @@ -345,29 +346,29 @@ static public org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.ElementDefinition.DiscriminatorTypeEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.DiscriminatorType.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case VALUE: - tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.DiscriminatorType.VALUE); - break; - case EXISTS: - tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.DiscriminatorType.EXISTS); - break; - case PATTERN: - tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.DiscriminatorType.PATTERN); - break; - case TYPE: - tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.DiscriminatorType.TYPE); - break; - case PROFILE: - tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.DiscriminatorType.PROFILE); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.DiscriminatorType.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.DiscriminatorType.VALUE); + break; + case EXISTS: + tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.DiscriminatorType.EXISTS); + break; + case PATTERN: + tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.DiscriminatorType.PATTERN); + break; + case TYPE: + tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.DiscriminatorType.TYPE); + break; + case PROFILE: + tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.DiscriminatorType.PROFILE); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.DiscriminatorType.NULL); + break; + } +} return tgt; } @@ -424,23 +425,23 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ElementDefinition.AggregationModeEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.AggregationMode.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CONTAINED: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.AggregationMode.CONTAINED); - break; - case REFERENCED: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.AggregationMode.REFERENCED); - break; - case BUNDLED: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.AggregationMode.BUNDLED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.AggregationMode.NULL); - break; - } - } + tgt.setValue(ElementDefinition.AggregationMode.CONTAINED); + break; + case REFERENCED: + tgt.setValue(ElementDefinition.AggregationMode.REFERENCED); + break; + case BUNDLED: + tgt.setValue(ElementDefinition.AggregationMode.BUNDLED); + break; + default: + tgt.setValue(ElementDefinition.AggregationMode.NULL); + break; + } +} return tgt; } @@ -449,23 +450,23 @@ static public org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.ElementDefinition.AggregationModeEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.AggregationMode.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case CONTAINED: - tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.AggregationMode.CONTAINED); - break; - case REFERENCED: - tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.AggregationMode.REFERENCED); - break; - case BUNDLED: - tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.AggregationMode.BUNDLED); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.AggregationMode.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.AggregationMode.CONTAINED); + break; + case REFERENCED: + tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.AggregationMode.REFERENCED); + break; + case BUNDLED: + tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.AggregationMode.BUNDLED); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.AggregationMode.NULL); + break; + } +} return tgt; } @@ -474,23 +475,23 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ElementDefinition.ReferenceVersionRulesEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ReferenceVersionRules.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case EITHER: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ReferenceVersionRules.EITHER); - break; - case INDEPENDENT: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ReferenceVersionRules.INDEPENDENT); - break; - case SPECIFIC: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ReferenceVersionRules.SPECIFIC); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ReferenceVersionRules.NULL); - break; - } - } + tgt.setValue(ElementDefinition.ReferenceVersionRules.EITHER); + break; + case INDEPENDENT: + tgt.setValue(ElementDefinition.ReferenceVersionRules.INDEPENDENT); + break; + case SPECIFIC: + tgt.setValue(ElementDefinition.ReferenceVersionRules.SPECIFIC); + break; + default: + tgt.setValue(ElementDefinition.ReferenceVersionRules.NULL); + break; + } +} return tgt; } @@ -499,23 +500,23 @@ static public org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.ElementDefinition.ReferenceVersionRulesEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.ReferenceVersionRules.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case EITHER: - tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.ReferenceVersionRules.EITHER); - break; - case INDEPENDENT: - tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.ReferenceVersionRules.INDEPENDENT); - break; - case SPECIFIC: - tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.ReferenceVersionRules.SPECIFIC); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.ReferenceVersionRules.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.ReferenceVersionRules.EITHER); + break; + case INDEPENDENT: + tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.ReferenceVersionRules.INDEPENDENT); + break; + case SPECIFIC: + tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.ReferenceVersionRules.SPECIFIC); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.ReferenceVersionRules.NULL); + break; + } +} return tgt; } @@ -577,20 +578,20 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ElementDefinition.ConstraintSeverityEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ConstraintSeverity.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case ERROR: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ConstraintSeverity.ERROR); - break; - case WARNING: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ConstraintSeverity.WARNING); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ConstraintSeverity.NULL); - break; - } - } + tgt.setValue(ElementDefinition.ConstraintSeverity.ERROR); + break; + case WARNING: + tgt.setValue(ElementDefinition.ConstraintSeverity.WARNING); + break; + default: + tgt.setValue(ElementDefinition.ConstraintSeverity.NULL); + break; + } +} return tgt; } @@ -599,20 +600,20 @@ static public org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.ElementDefinition.ConstraintSeverityEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.ConstraintSeverity.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case ERROR: - tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.ConstraintSeverity.ERROR); - break; - case WARNING: - tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.ConstraintSeverity.WARNING); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.ConstraintSeverity.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.ConstraintSeverity.ERROR); + break; + case WARNING: + tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.ConstraintSeverity.WARNING); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.ConstraintSeverity.NULL); + break; + } +} return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/special43_50/Narrative43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/special43_50/Narrative43_50.java index bf2110ec14..5abb710386 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/special43_50/Narrative43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/special43_50/Narrative43_50.java @@ -2,6 +2,7 @@ import org.hl7.fhir.convertors.context.ConversionContext43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Narrative; public class Narrative43_50 { public static org.hl7.fhir.r5.model.Narrative convertNarrative(org.hl7.fhir.r4b.model.Narrative src) throws FHIRException { @@ -27,26 +28,26 @@ static public org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Narrative.NarrativeStatusEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r5.model.Narrative.NarrativeStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case GENERATED: - tgt.setValue(org.hl7.fhir.r5.model.Narrative.NarrativeStatus.GENERATED); - break; - case EXTENSIONS: - tgt.setValue(org.hl7.fhir.r5.model.Narrative.NarrativeStatus.EXTENSIONS); - break; - case ADDITIONAL: - tgt.setValue(org.hl7.fhir.r5.model.Narrative.NarrativeStatus.ADDITIONAL); - break; - case EMPTY: - tgt.setValue(org.hl7.fhir.r5.model.Narrative.NarrativeStatus.EMPTY); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Narrative.NarrativeStatus.NULL); - break; - } - } + tgt.setValue(Narrative.NarrativeStatus.GENERATED); + break; + case EXTENSIONS: + tgt.setValue(Narrative.NarrativeStatus.EXTENSIONS); + break; + case ADDITIONAL: + tgt.setValue(Narrative.NarrativeStatus.ADDITIONAL); + break; + case EMPTY: + tgt.setValue(Narrative.NarrativeStatus.EMPTY); + break; + default: + tgt.setValue(Narrative.NarrativeStatus.NULL); + break; + } +} return tgt; } @@ -55,26 +56,26 @@ static public org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Narrative.NarrativeStatusEnumFactory()); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); if (src.getValue() == null) { - tgt.setValue(org.hl7.fhir.r4b.model.Narrative.NarrativeStatus.NULL); - } else { - switch (src.getValue()) { + tgt.setValue(null); +} else { + switch(src.getValue()) { case GENERATED: - tgt.setValue(org.hl7.fhir.r4b.model.Narrative.NarrativeStatus.GENERATED); - break; - case EXTENSIONS: - tgt.setValue(org.hl7.fhir.r4b.model.Narrative.NarrativeStatus.EXTENSIONS); - break; - case ADDITIONAL: - tgt.setValue(org.hl7.fhir.r4b.model.Narrative.NarrativeStatus.ADDITIONAL); - break; - case EMPTY: - tgt.setValue(org.hl7.fhir.r4b.model.Narrative.NarrativeStatus.EMPTY); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Narrative.NarrativeStatus.NULL); - break; - } - } + tgt.setValue(org.hl7.fhir.r4b.model.Narrative.NarrativeStatus.GENERATED); + break; + case EXTENSIONS: + tgt.setValue(org.hl7.fhir.r4b.model.Narrative.NarrativeStatus.EXTENSIONS); + break; + case ADDITIONAL: + tgt.setValue(org.hl7.fhir.r4b.model.Narrative.NarrativeStatus.ADDITIONAL); + break; + case EMPTY: + tgt.setValue(org.hl7.fhir.r4b.model.Narrative.NarrativeStatus.EMPTY); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Narrative.NarrativeStatus.NULL); + break; + } +} return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Account43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Account43_50.java index c561b9be72..a6383086cd 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Account43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Account43_50.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Account; +import org.hl7.fhir.r5.model.Enumeration; /* Copyright (c) 2011+, HL7, Inc. @@ -100,59 +102,67 @@ public static org.hl7.fhir.r4b.model.Account convertAccount(org.hl7.fhir.r5.mode } static public org.hl7.fhir.r5.model.Enumeration convertAccountStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Account.AccountStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Account.AccountStatus.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Account.AccountStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Account.AccountStatus.ENTEREDINERROR); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r5.model.Account.AccountStatus.ONHOLD); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.Account.AccountStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Account.AccountStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Account.AccountStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Account.AccountStatus.ACTIVE); + break; + case INACTIVE: + tgt.setValue(Account.AccountStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(Account.AccountStatus.ENTEREDINERROR); + break; + case ONHOLD: + tgt.setValue(Account.AccountStatus.ONHOLD); + break; + case UNKNOWN: + tgt.setValue(Account.AccountStatus.UNKNOWN); + break; + default: + tgt.setValue(Account.AccountStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertAccountStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Account.AccountStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.Account.AccountStatus.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.Account.AccountStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.Account.AccountStatus.ENTEREDINERROR); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r4b.model.Account.AccountStatus.ONHOLD); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4b.model.Account.AccountStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Account.AccountStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Account.AccountStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4b.model.Account.AccountStatus.ACTIVE); + break; + case INACTIVE: + tgt.setValue(org.hl7.fhir.r4b.model.Account.AccountStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.Account.AccountStatus.ENTEREDINERROR); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.r4b.model.Account.AccountStatus.ONHOLD); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4b.model.Account.AccountStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Account.AccountStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Account.CoverageComponent convertCoverageComponent(org.hl7.fhir.r4b.model.Account.CoverageComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ActivityDefinition43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ActivityDefinition43_50.java index 7d7697b0a9..e532ceac84 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ActivityDefinition43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ActivityDefinition43_50.java @@ -20,8 +20,7 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Dosage43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.r5.model.CodeType; -import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.*; /* Copyright (c) 2011+, HL7, Inc. @@ -253,59 +252,63 @@ public static org.hl7.fhir.r4b.model.ActivityDefinition convertActivityDefinitio } static public org.hl7.fhir.r5.model.Enumeration convertActivityDefinitionKind(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypesEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case APPOINTMENT: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.APPOINTMENT); - break; - case APPOINTMENTRESPONSE: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.APPOINTMENTRESPONSE); - break; - case CAREPLAN: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.CAREPLAN); - break; - case CLAIM: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.CLAIM); - break; - case COMMUNICATIONREQUEST: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.COMMUNICATIONREQUEST); - break; - case DEVICEREQUEST: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.DEVICEREQUEST); - break; - case ENROLLMENTREQUEST: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.ENROLLMENTREQUEST); - break; - case IMMUNIZATIONRECOMMENDATION: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.IMMUNIZATIONRECOMMENDATION); - break; - case MEDICATIONREQUEST: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.MEDICATIONREQUEST); - break; - case NUTRITIONORDER: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.NUTRITIONORDER); - break; - case SERVICEREQUEST: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.SERVICEREQUEST); - break; - case SUPPLYREQUEST: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.SUPPLYREQUEST); - break; - case TASK: - tgt.setValue(null); - tgt.addExtension(VersionConvertorConstants.EXT_ACTUAL_RESOURCE_NAME, new CodeType("Task")); - break; - case VISIONPRESCRIPTION: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.VISIONPRESCRIPTION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ActivityDefinition.RequestResourceTypesEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case APPOINTMENT: + tgt.setValue(ActivityDefinition.RequestResourceTypes.APPOINTMENT); + break; + case APPOINTMENTRESPONSE: + tgt.setValue(ActivityDefinition.RequestResourceTypes.APPOINTMENTRESPONSE); + break; + case CAREPLAN: + tgt.setValue(ActivityDefinition.RequestResourceTypes.CAREPLAN); + break; + case CLAIM: + tgt.setValue(ActivityDefinition.RequestResourceTypes.CLAIM); + break; + case COMMUNICATIONREQUEST: + tgt.setValue(ActivityDefinition.RequestResourceTypes.COMMUNICATIONREQUEST); + break; + case DEVICEREQUEST: + tgt.setValue(ActivityDefinition.RequestResourceTypes.DEVICEREQUEST); + break; + case ENROLLMENTREQUEST: + tgt.setValue(ActivityDefinition.RequestResourceTypes.ENROLLMENTREQUEST); + break; + case IMMUNIZATIONRECOMMENDATION: + tgt.setValue(ActivityDefinition.RequestResourceTypes.IMMUNIZATIONRECOMMENDATION); + break; + case MEDICATIONREQUEST: + tgt.setValue(ActivityDefinition.RequestResourceTypes.MEDICATIONREQUEST); + break; + case NUTRITIONORDER: + tgt.setValue(ActivityDefinition.RequestResourceTypes.NUTRITIONORDER); + break; + case SERVICEREQUEST: + tgt.setValue(ActivityDefinition.RequestResourceTypes.SERVICEREQUEST); + break; + case SUPPLYREQUEST: + tgt.setValue(ActivityDefinition.RequestResourceTypes.SUPPLYREQUEST); + break; + case TASK: + tgt.setValue(null); + tgt.addExtension(VersionConvertorConstants.EXT_ACTUAL_RESOURCE_NAME, new CodeType("Task")); + break; + case VISIONPRESCRIPTION: + tgt.setValue(ActivityDefinition.RequestResourceTypes.VISIONPRESCRIPTION); + break; + default: + tgt.setValue(ActivityDefinition.RequestResourceTypes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertActivityDefinitionKind(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { @@ -316,182 +319,202 @@ static public org.hl7.fhir.r4b.model.Enumeration convertRequestIntent(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestIntentEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.PROPOSAL); - break; - case PLAN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.PLAN); - break; - case DIRECTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.DIRECTIVE); - break; - case ORDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORDER); - break; - case ORIGINALORDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORIGINALORDER); - break; - case REFLEXORDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.REFLEXORDER); - break; - case FILLERORDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.FILLERORDER); - break; - case INSTANCEORDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.INSTANCEORDER); - break; - case OPTION: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.OPTION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.RequestIntentEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSAL: + tgt.setValue(Enumerations.RequestIntent.PROPOSAL); + break; + case PLAN: + tgt.setValue(Enumerations.RequestIntent.PLAN); + break; + case DIRECTIVE: + tgt.setValue(Enumerations.RequestIntent.DIRECTIVE); + break; + case ORDER: + tgt.setValue(Enumerations.RequestIntent.ORDER); + break; + case ORIGINALORDER: + tgt.setValue(Enumerations.RequestIntent.ORIGINALORDER); + break; + case REFLEXORDER: + tgt.setValue(Enumerations.RequestIntent.REFLEXORDER); + break; + case FILLERORDER: + tgt.setValue(Enumerations.RequestIntent.FILLERORDER); + break; + case INSTANCEORDER: + tgt.setValue(Enumerations.RequestIntent.INSTANCEORDER); + break; + case OPTION: + tgt.setValue(Enumerations.RequestIntent.OPTION); + break; + default: + tgt.setValue(Enumerations.RequestIntent.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertRequestIntent(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestIntentEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSAL: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.PROPOSAL); - break; - case PLAN: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.PLAN); - break; - case DIRECTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.DIRECTIVE); - break; - case ORDER: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.ORDER); - break; - case ORIGINALORDER: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.ORIGINALORDER); - break; - case REFLEXORDER: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.REFLEXORDER); - break; - case FILLERORDER: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.FILLERORDER); - break; - case INSTANCEORDER: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.INSTANCEORDER); - break; - case OPTION: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.OPTION); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestIntentEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSAL: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.PROPOSAL); + break; + case PLAN: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.PLAN); + break; + case DIRECTIVE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.DIRECTIVE); + break; + case ORDER: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.ORDER); + break; + case ORIGINALORDER: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.ORIGINALORDER); + break; + case REFLEXORDER: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.REFLEXORDER); + break; + case FILLERORDER: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.FILLERORDER); + break; + case INSTANCEORDER: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.INSTANCEORDER); + break; + case OPTION: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.OPTION); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertRequestPriority(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestPriorityEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP); - break; - case STAT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.RequestPriorityEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(Enumerations.RequestPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(Enumerations.RequestPriority.URGENT); + break; + case ASAP: + tgt.setValue(Enumerations.RequestPriority.ASAP); + break; + case STAT: + tgt.setValue(Enumerations.RequestPriority.STAT); + break; + default: + tgt.setValue(Enumerations.RequestPriority.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertRequestPriority(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestPriorityEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.URGENT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ASAP); - break; - case STAT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.STAT); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestPriorityEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.URGENT); + break; + case ASAP: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ASAP); + break; + case STAT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.STAT); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionParticipantComponent convertActivityDefinitionParticipantComponent(org.hl7.fhir.r4b.model.ActivityDefinition.ActivityDefinitionParticipantComponent src) throws FHIRException { @@ -519,53 +542,61 @@ public static org.hl7.fhir.r4b.model.ActivityDefinition.ActivityDefinitionPartic } static public org.hl7.fhir.r5.model.Enumeration convertActivityParticipantType(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ActionParticipantTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PATIENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.PATIENT); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.PRACTITIONER); - break; - case RELATEDPERSON: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.RELATEDPERSON); - break; - case DEVICE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.DEVICE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ActionParticipantTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PATIENT: + tgt.setValue(Enumerations.ActionParticipantType.PATIENT); + break; + case PRACTITIONER: + tgt.setValue(Enumerations.ActionParticipantType.PRACTITIONER); + break; + case RELATEDPERSON: + tgt.setValue(Enumerations.ActionParticipantType.RELATEDPERSON); + break; + case DEVICE: + tgt.setValue(Enumerations.ActionParticipantType.DEVICE); + break; + default: + tgt.setValue(Enumerations.ActionParticipantType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertActivityParticipantType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.ActionParticipantTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PATIENT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionParticipantType.PATIENT); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionParticipantType.PRACTITIONER); - break; - case RELATEDPERSON: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionParticipantType.RELATEDPERSON); - break; - case DEVICE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionParticipantType.DEVICE); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionParticipantType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.ActionParticipantTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PATIENT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionParticipantType.PATIENT); + break; + case PRACTITIONER: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionParticipantType.PRACTITIONER); + break; + case RELATEDPERSON: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionParticipantType.RELATEDPERSON); + break; + case DEVICE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionParticipantType.DEVICE); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionParticipantType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent convertActivityDefinitionDynamicValueComponent(org.hl7.fhir.r4b.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/AllergyIntolerance43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/AllergyIntolerance43_50.java index 01feb2d9ae..6f050956f7 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/AllergyIntolerance43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/AllergyIntolerance43_50.java @@ -10,10 +10,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.*; import org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceParticipantComponent; -import org.hl7.fhir.r5.model.CodeableConcept; -import org.hl7.fhir.r5.model.CodeableReference; -import org.hl7.fhir.r5.model.Coding; /* Copyright (c) 2011+, HL7, Inc. @@ -133,21 +131,25 @@ public static org.hl7.fhir.r4b.model.AllergyIntolerance convertAllergyIntoleranc } static public org.hl7.fhir.r5.model.CodeableConcept convertAllergyIntoleranceType(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.CodeableConcept tgt = new org.hl7.fhir.r5.model.CodeableConcept(); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ALLERGY: - tgt.addCoding("http://hl7.org/fhir/allergy-intolerance-type", "allergy", "Allergy"); - break; - case INTOLERANCE: - tgt.addCoding("http://hl7.org/fhir/allergy-intolerance-type", "intolerance", "Intolerance"); - break; - default: - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + CodeableConcept tgt = new CodeableConcept(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + // Add nothing + } else { + switch (src.getValue()) { + case ALLERGY: + tgt.addCoding("http://hl7.org/fhir/allergy-intolerance-type", "allergy", "Allergy"); + break; + case INTOLERANCE: + tgt.addCoding("http://hl7.org/fhir/allergy-intolerance-type", "intolerance", "Intolerance"); + break; + default: + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertAllergyIntoleranceType(org.hl7.fhir.r5.model.CodeableConcept src) throws FHIRException { @@ -164,97 +166,113 @@ static public org.hl7.fhir.r4b.model.Enumeration convertAllergyIntoleranceCategory(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategoryEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case FOOD: - tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory.FOOD); - break; - case MEDICATION: - tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory.MEDICATION); - break; - case ENVIRONMENT: - tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory.ENVIRONMENT); - break; - case BIOLOGIC: - tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory.BIOLOGIC); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new AllergyIntolerance.AllergyIntoleranceCategoryEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FOOD: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceCategory.FOOD); + break; + case MEDICATION: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceCategory.MEDICATION); + break; + case ENVIRONMENT: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceCategory.ENVIRONMENT); + break; + case BIOLOGIC: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceCategory.BIOLOGIC); + break; + default: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceCategory.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertAllergyIntoleranceCategory(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceCategoryEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case FOOD: - tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceCategory.FOOD); - break; - case MEDICATION: - tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceCategory.MEDICATION); - break; - case ENVIRONMENT: - tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceCategory.ENVIRONMENT); - break; - case BIOLOGIC: - tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceCategory.BIOLOGIC); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceCategory.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceCategoryEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FOOD: + tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceCategory.FOOD); + break; + case MEDICATION: + tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceCategory.MEDICATION); + break; + case ENVIRONMENT: + tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceCategory.ENVIRONMENT); + break; + case BIOLOGIC: + tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceCategory.BIOLOGIC); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceCategory.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertAllergyIntoleranceCriticality(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticalityEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case LOW: - tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality.LOW); - break; - case HIGH: - tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality.HIGH); - break; - case UNABLETOASSESS: - tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality.UNABLETOASSESS); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new AllergyIntolerance.AllergyIntoleranceCriticalityEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case LOW: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceCriticality.LOW); + break; + case HIGH: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceCriticality.HIGH); + break; + case UNABLETOASSESS: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceCriticality.UNABLETOASSESS); + break; + default: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceCriticality.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertAllergyIntoleranceCriticality(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceCriticalityEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case LOW: - tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceCriticality.LOW); - break; - case HIGH: - tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceCriticality.HIGH); - break; - case UNABLETOASSESS: - tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceCriticality.UNABLETOASSESS); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceCriticality.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceCriticalityEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case LOW: + tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceCriticality.LOW); + break; + case HIGH: + tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceCriticality.HIGH); + break; + case UNABLETOASSESS: + tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceCriticality.UNABLETOASSESS); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceCriticality.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceReactionComponent convertAllergyIntoleranceReactionComponent(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceReactionComponent src) throws FHIRException { @@ -300,46 +318,54 @@ public static org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceReacti } static public org.hl7.fhir.r5.model.Enumeration convertAllergyIntoleranceSeverity(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverityEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case MILD: - tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity.MILD); - break; - case MODERATE: - tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity.MODERATE); - break; - case SEVERE: - tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity.SEVERE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new AllergyIntolerance.AllergyIntoleranceSeverityEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MILD: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceSeverity.MILD); + break; + case MODERATE: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceSeverity.MODERATE); + break; + case SEVERE: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceSeverity.SEVERE); + break; + default: + tgt.setValue(AllergyIntolerance.AllergyIntoleranceSeverity.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertAllergyIntoleranceSeverity(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceSeverityEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case MILD: - tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceSeverity.MILD); - break; - case MODERATE: - tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceSeverity.MODERATE); - break; - case SEVERE: - tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceSeverity.SEVERE); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceSeverity.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceSeverityEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MILD: + tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceSeverity.MILD); + break; + case MODERATE: + tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceSeverity.MODERATE); + break; + case SEVERE: + tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceSeverity.SEVERE); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceSeverity.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Appointment43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Appointment43_50.java index 786b150581..b4258408e9 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Appointment43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Appointment43_50.java @@ -12,8 +12,7 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4b.model.UnsignedIntType; -import org.hl7.fhir.r5.model.CodeableConcept; -import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.*; /* Copyright (c) 2011+, HL7, Inc. @@ -170,89 +169,97 @@ public static int convertAppointmentPriorityFromR5(org.hl7.fhir.r5.model.Codeabl } static public org.hl7.fhir.r5.model.Enumeration convertAppointmentStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Appointment.AppointmentStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSED: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.PROPOSED); - break; - case PENDING: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.PENDING); - break; - case BOOKED: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.BOOKED); - break; - case ARRIVED: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.ARRIVED); - break; - case FULFILLED: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.FULFILLED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.CANCELLED); - break; - case NOSHOW: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.NOSHOW); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.ENTEREDINERROR); - break; - case CHECKEDIN: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.CHECKEDIN); - break; - case WAITLIST: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.WAITLIST); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Appointment.AppointmentStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSED: + tgt.setValue(Appointment.AppointmentStatus.PROPOSED); + break; + case PENDING: + tgt.setValue(Appointment.AppointmentStatus.PENDING); + break; + case BOOKED: + tgt.setValue(Appointment.AppointmentStatus.BOOKED); + break; + case ARRIVED: + tgt.setValue(Appointment.AppointmentStatus.ARRIVED); + break; + case FULFILLED: + tgt.setValue(Appointment.AppointmentStatus.FULFILLED); + break; + case CANCELLED: + tgt.setValue(Appointment.AppointmentStatus.CANCELLED); + break; + case NOSHOW: + tgt.setValue(Appointment.AppointmentStatus.NOSHOW); + break; + case ENTEREDINERROR: + tgt.setValue(Appointment.AppointmentStatus.ENTEREDINERROR); + break; + case CHECKEDIN: + tgt.setValue(Appointment.AppointmentStatus.CHECKEDIN); + break; + case WAITLIST: + tgt.setValue(Appointment.AppointmentStatus.WAITLIST); + break; + default: + tgt.setValue(Appointment.AppointmentStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertAppointmentStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Appointment.AppointmentStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSED: - tgt.setValue(org.hl7.fhir.r4b.model.Appointment.AppointmentStatus.PROPOSED); - break; - case PENDING: - tgt.setValue(org.hl7.fhir.r4b.model.Appointment.AppointmentStatus.PENDING); - break; - case BOOKED: - tgt.setValue(org.hl7.fhir.r4b.model.Appointment.AppointmentStatus.BOOKED); - break; - case ARRIVED: - tgt.setValue(org.hl7.fhir.r4b.model.Appointment.AppointmentStatus.ARRIVED); - break; - case FULFILLED: - tgt.setValue(org.hl7.fhir.r4b.model.Appointment.AppointmentStatus.FULFILLED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4b.model.Appointment.AppointmentStatus.CANCELLED); - break; - case NOSHOW: - tgt.setValue(org.hl7.fhir.r4b.model.Appointment.AppointmentStatus.NOSHOW); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.Appointment.AppointmentStatus.ENTEREDINERROR); - break; - case CHECKEDIN: - tgt.setValue(org.hl7.fhir.r4b.model.Appointment.AppointmentStatus.CHECKEDIN); - break; - case WAITLIST: - tgt.setValue(org.hl7.fhir.r4b.model.Appointment.AppointmentStatus.WAITLIST); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Appointment.AppointmentStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Appointment.AppointmentStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSED: + tgt.setValue(org.hl7.fhir.r4b.model.Appointment.AppointmentStatus.PROPOSED); + break; + case PENDING: + tgt.setValue(org.hl7.fhir.r4b.model.Appointment.AppointmentStatus.PENDING); + break; + case BOOKED: + tgt.setValue(org.hl7.fhir.r4b.model.Appointment.AppointmentStatus.BOOKED); + break; + case ARRIVED: + tgt.setValue(org.hl7.fhir.r4b.model.Appointment.AppointmentStatus.ARRIVED); + break; + case FULFILLED: + tgt.setValue(org.hl7.fhir.r4b.model.Appointment.AppointmentStatus.FULFILLED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4b.model.Appointment.AppointmentStatus.CANCELLED); + break; + case NOSHOW: + tgt.setValue(org.hl7.fhir.r4b.model.Appointment.AppointmentStatus.NOSHOW); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.Appointment.AppointmentStatus.ENTEREDINERROR); + break; + case CHECKEDIN: + tgt.setValue(org.hl7.fhir.r4b.model.Appointment.AppointmentStatus.CHECKEDIN); + break; + case WAITLIST: + tgt.setValue(org.hl7.fhir.r4b.model.Appointment.AppointmentStatus.WAITLIST); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Appointment.AppointmentStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Appointment.AppointmentParticipantComponent convertAppointmentParticipantComponent(org.hl7.fhir.r4b.model.Appointment.AppointmentParticipantComponent src) throws FHIRException { @@ -292,24 +299,28 @@ public static org.hl7.fhir.r4b.model.Appointment.AppointmentParticipantComponent } static public org.hl7.fhir.r5.model.BooleanType convertParticipantRequired(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.BooleanType tgt = new org.hl7.fhir.r5.model.BooleanType(); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case REQUIRED: - tgt.setValue(true); - break; - case OPTIONAL: - tgt.setValue(false); - break; - case INFORMATIONONLY: - tgt.setValue(false); - break; - default: - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + BooleanType tgt = new BooleanType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REQUIRED: + tgt.setValue(true); + break; + case OPTIONAL: + tgt.setValue(false); + break; + case INFORMATIONONLY: + tgt.setValue(false); + break; + default: + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertParticipantRequired(org.hl7.fhir.r5.model.BooleanType src) throws FHIRException { @@ -326,52 +337,60 @@ static public org.hl7.fhir.r4b.model.Enumeration convertParticipationStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Appointment.ParticipationStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACCEPTED: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.ParticipationStatus.ACCEPTED); - break; - case DECLINED: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.ParticipationStatus.DECLINED); - break; - case TENTATIVE: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.ParticipationStatus.TENTATIVE); - break; - case NEEDSACTION: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.ParticipationStatus.NEEDSACTION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Appointment.ParticipationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Appointment.ParticipationStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACCEPTED: + tgt.setValue(Appointment.ParticipationStatus.ACCEPTED); + break; + case DECLINED: + tgt.setValue(Appointment.ParticipationStatus.DECLINED); + break; + case TENTATIVE: + tgt.setValue(Appointment.ParticipationStatus.TENTATIVE); + break; + case NEEDSACTION: + tgt.setValue(Appointment.ParticipationStatus.NEEDSACTION); + break; + default: + tgt.setValue(Appointment.ParticipationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertParticipationStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.ParticipationStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACCEPTED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ParticipationStatus.ACCEPTED); - break; - case DECLINED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ParticipationStatus.DECLINED); - break; - case TENTATIVE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ParticipationStatus.TENTATIVE); - break; - case NEEDSACTION: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ParticipationStatus.NEEDSACTION); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ParticipationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.ParticipationStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACCEPTED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ParticipationStatus.ACCEPTED); + break; + case DECLINED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ParticipationStatus.DECLINED); + break; + case TENTATIVE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ParticipationStatus.TENTATIVE); + break; + case NEEDSACTION: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ParticipationStatus.NEEDSACTION); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ParticipationStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/AppointmentResponse43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/AppointmentResponse43_50.java index 5c176302c0..22c0458597 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/AppointmentResponse43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/AppointmentResponse43_50.java @@ -7,6 +7,9 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4b.model.Enumerations; +import org.hl7.fhir.r5.model.AppointmentResponse; +import org.hl7.fhir.r5.model.Enumeration; /* Copyright (c) 2011+, HL7, Inc. @@ -88,52 +91,60 @@ public static org.hl7.fhir.r4b.model.AppointmentResponse convertAppointmentRespo } static public org.hl7.fhir.r5.model.Enumeration convertParticipantStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.AppointmentResponse.AppointmentResponseStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACCEPTED: - tgt.setValue(org.hl7.fhir.r5.model.AppointmentResponse.AppointmentResponseStatus.ACCEPTED); - break; - case DECLINED: - tgt.setValue(org.hl7.fhir.r5.model.AppointmentResponse.AppointmentResponseStatus.DECLINED); - break; - case TENTATIVE: - tgt.setValue(org.hl7.fhir.r5.model.AppointmentResponse.AppointmentResponseStatus.TENTATIVE); - break; - case NEEDSACTION: - tgt.setValue(org.hl7.fhir.r5.model.AppointmentResponse.AppointmentResponseStatus.NEEDSACTION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.AppointmentResponse.AppointmentResponseStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new AppointmentResponse.AppointmentResponseStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACCEPTED: + tgt.setValue(AppointmentResponse.AppointmentResponseStatus.ACCEPTED); + break; + case DECLINED: + tgt.setValue(AppointmentResponse.AppointmentResponseStatus.DECLINED); + break; + case TENTATIVE: + tgt.setValue(AppointmentResponse.AppointmentResponseStatus.TENTATIVE); + break; + case NEEDSACTION: + tgt.setValue(AppointmentResponse.AppointmentResponseStatus.NEEDSACTION); + break; + default: + tgt.setValue(AppointmentResponse.AppointmentResponseStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertParticipantStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.ParticipationStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACCEPTED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ParticipationStatus.ACCEPTED); - break; - case DECLINED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ParticipationStatus.DECLINED); - break; - case TENTATIVE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ParticipationStatus.TENTATIVE); - break; - case NEEDSACTION: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ParticipationStatus.NEEDSACTION); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ParticipationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new Enumerations.ParticipationStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACCEPTED: + tgt.setValue(Enumerations.ParticipationStatus.ACCEPTED); + break; + case DECLINED: + tgt.setValue(Enumerations.ParticipationStatus.DECLINED); + break; + case TENTATIVE: + tgt.setValue(Enumerations.ParticipationStatus.TENTATIVE); + break; + case NEEDSACTION: + tgt.setValue(Enumerations.ParticipationStatus.NEEDSACTION); + break; + default: + tgt.setValue(Enumerations.ParticipationStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/AuditEvent43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/AuditEvent43_50.java index bd4166eb6f..da7e2a86f9 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/AuditEvent43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/AuditEvent43_50.java @@ -11,7 +11,9 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.AuditEvent; import org.hl7.fhir.r5.model.CodeableConcept; +import org.hl7.fhir.r5.model.Enumeration; /* Copyright (c) 2011+, HL7, Inc. @@ -104,59 +106,67 @@ public static org.hl7.fhir.r4b.model.AuditEvent convertAuditEvent(org.hl7.fhir.r } static public org.hl7.fhir.r5.model.Enumeration convertAuditEventAction(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.AuditEvent.AuditEventActionEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case C: - tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.C); - break; - case R: - tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.R); - break; - case U: - tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.U); - break; - case D: - tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.D); - break; - case E: - tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.E); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new AuditEvent.AuditEventActionEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case C: + tgt.setValue(AuditEvent.AuditEventAction.C); + break; + case R: + tgt.setValue(AuditEvent.AuditEventAction.R); + break; + case U: + tgt.setValue(AuditEvent.AuditEventAction.U); + break; + case D: + tgt.setValue(AuditEvent.AuditEventAction.D); + break; + case E: + tgt.setValue(AuditEvent.AuditEventAction.E); + break; + default: + tgt.setValue(AuditEvent.AuditEventAction.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertAuditEventAction(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.AuditEvent.AuditEventActionEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case C: - tgt.setValue(org.hl7.fhir.r4b.model.AuditEvent.AuditEventAction.C); - break; - case R: - tgt.setValue(org.hl7.fhir.r4b.model.AuditEvent.AuditEventAction.R); - break; - case U: - tgt.setValue(org.hl7.fhir.r4b.model.AuditEvent.AuditEventAction.U); - break; - case D: - tgt.setValue(org.hl7.fhir.r4b.model.AuditEvent.AuditEventAction.D); - break; - case E: - tgt.setValue(org.hl7.fhir.r4b.model.AuditEvent.AuditEventAction.E); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.AuditEvent.AuditEventAction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.AuditEvent.AuditEventActionEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case C: + tgt.setValue(org.hl7.fhir.r4b.model.AuditEvent.AuditEventAction.C); + break; + case R: + tgt.setValue(org.hl7.fhir.r4b.model.AuditEvent.AuditEventAction.R); + break; + case U: + tgt.setValue(org.hl7.fhir.r4b.model.AuditEvent.AuditEventAction.U); + break; + case D: + tgt.setValue(org.hl7.fhir.r4b.model.AuditEvent.AuditEventAction.D); + break; + case E: + tgt.setValue(org.hl7.fhir.r4b.model.AuditEvent.AuditEventAction.E); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.AuditEvent.AuditEventAction.NULL); + break; + } + } + return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Bundle43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Bundle43_50.java index 9714aa16d4..43924dc3d7 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Bundle43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Bundle43_50.java @@ -9,7 +9,9 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.UnsignedInt43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Bundle; import org.hl7.fhir.r5.model.Bundle.LinkRelationTypes; +import org.hl7.fhir.r5.model.Enumeration; /* Copyright (c) 2011+, HL7, Inc. @@ -85,83 +87,91 @@ public static org.hl7.fhir.r4b.model.Bundle convertBundle(org.hl7.fhir.r5.model. } static public org.hl7.fhir.r5.model.Enumeration convertBundleType(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Bundle.BundleTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case DOCUMENT: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.DOCUMENT); - break; - case MESSAGE: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.MESSAGE); - break; - case TRANSACTION: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.TRANSACTION); - break; - case TRANSACTIONRESPONSE: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.TRANSACTIONRESPONSE); - break; - case BATCH: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.BATCH); - break; - case BATCHRESPONSE: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.BATCHRESPONSE); - break; - case HISTORY: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.HISTORY); - break; - case SEARCHSET: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.SEARCHSET); - break; - case COLLECTION: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.COLLECTION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Bundle.BundleTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DOCUMENT: + tgt.setValue(Bundle.BundleType.DOCUMENT); + break; + case MESSAGE: + tgt.setValue(Bundle.BundleType.MESSAGE); + break; + case TRANSACTION: + tgt.setValue(Bundle.BundleType.TRANSACTION); + break; + case TRANSACTIONRESPONSE: + tgt.setValue(Bundle.BundleType.TRANSACTIONRESPONSE); + break; + case BATCH: + tgt.setValue(Bundle.BundleType.BATCH); + break; + case BATCHRESPONSE: + tgt.setValue(Bundle.BundleType.BATCHRESPONSE); + break; + case HISTORY: + tgt.setValue(Bundle.BundleType.HISTORY); + break; + case SEARCHSET: + tgt.setValue(Bundle.BundleType.SEARCHSET); + break; + case COLLECTION: + tgt.setValue(Bundle.BundleType.COLLECTION); + break; + default: + tgt.setValue(Bundle.BundleType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertBundleType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Bundle.BundleTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case DOCUMENT: - tgt.setValue(org.hl7.fhir.r4b.model.Bundle.BundleType.DOCUMENT); - break; - case MESSAGE: - tgt.setValue(org.hl7.fhir.r4b.model.Bundle.BundleType.MESSAGE); - break; - case TRANSACTION: - tgt.setValue(org.hl7.fhir.r4b.model.Bundle.BundleType.TRANSACTION); - break; - case TRANSACTIONRESPONSE: - tgt.setValue(org.hl7.fhir.r4b.model.Bundle.BundleType.TRANSACTIONRESPONSE); - break; - case BATCH: - tgt.setValue(org.hl7.fhir.r4b.model.Bundle.BundleType.BATCH); - break; - case BATCHRESPONSE: - tgt.setValue(org.hl7.fhir.r4b.model.Bundle.BundleType.BATCHRESPONSE); - break; - case HISTORY: - tgt.setValue(org.hl7.fhir.r4b.model.Bundle.BundleType.HISTORY); - break; - case SEARCHSET: - tgt.setValue(org.hl7.fhir.r4b.model.Bundle.BundleType.SEARCHSET); - break; - case COLLECTION: - tgt.setValue(org.hl7.fhir.r4b.model.Bundle.BundleType.COLLECTION); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Bundle.BundleType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Bundle.BundleTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DOCUMENT: + tgt.setValue(org.hl7.fhir.r4b.model.Bundle.BundleType.DOCUMENT); + break; + case MESSAGE: + tgt.setValue(org.hl7.fhir.r4b.model.Bundle.BundleType.MESSAGE); + break; + case TRANSACTION: + tgt.setValue(org.hl7.fhir.r4b.model.Bundle.BundleType.TRANSACTION); + break; + case TRANSACTIONRESPONSE: + tgt.setValue(org.hl7.fhir.r4b.model.Bundle.BundleType.TRANSACTIONRESPONSE); + break; + case BATCH: + tgt.setValue(org.hl7.fhir.r4b.model.Bundle.BundleType.BATCH); + break; + case BATCHRESPONSE: + tgt.setValue(org.hl7.fhir.r4b.model.Bundle.BundleType.BATCHRESPONSE); + break; + case HISTORY: + tgt.setValue(org.hl7.fhir.r4b.model.Bundle.BundleType.HISTORY); + break; + case SEARCHSET: + tgt.setValue(org.hl7.fhir.r4b.model.Bundle.BundleType.SEARCHSET); + break; + case COLLECTION: + tgt.setValue(org.hl7.fhir.r4b.model.Bundle.BundleType.COLLECTION); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Bundle.BundleType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Bundle.BundleLinkComponent convertBundleLinkComponent(org.hl7.fhir.r4b.model.Bundle.BundleLinkComponent src) throws FHIRException { @@ -251,47 +261,55 @@ public static org.hl7.fhir.r4b.model.Bundle.BundleEntrySearchComponent convertBu } static public org.hl7.fhir.r5.model.Enumeration convertSearchEntryMode(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Bundle.SearchEntryModeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case MATCH: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.SearchEntryMode.MATCH); - break; - case INCLUDE: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.SearchEntryMode.INCLUDE); - break; - case OUTCOME: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.SearchEntryMode.OUTCOME); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.SearchEntryMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Bundle.SearchEntryModeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MATCH: + tgt.setValue(Bundle.SearchEntryMode.MATCH); + break; + case INCLUDE: + tgt.setValue(Bundle.SearchEntryMode.INCLUDE); + break; + case OUTCOME: + tgt.setValue(Bundle.SearchEntryMode.OUTCOME); + break; + default: + tgt.setValue(Bundle.SearchEntryMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertSearchEntryMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Bundle.SearchEntryModeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case MATCH: - tgt.setValue(org.hl7.fhir.r4b.model.Bundle.SearchEntryMode.MATCH); - break; - case INCLUDE: - tgt.setValue(org.hl7.fhir.r4b.model.Bundle.SearchEntryMode.INCLUDE); - break; - case OUTCOME: - tgt.setValue(org.hl7.fhir.r4b.model.Bundle.SearchEntryMode.OUTCOME); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Bundle.SearchEntryMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Bundle.SearchEntryModeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MATCH: + tgt.setValue(org.hl7.fhir.r4b.model.Bundle.SearchEntryMode.MATCH); + break; + case INCLUDE: + tgt.setValue(org.hl7.fhir.r4b.model.Bundle.SearchEntryMode.INCLUDE); + break; + case OUTCOME: + tgt.setValue(org.hl7.fhir.r4b.model.Bundle.SearchEntryMode.OUTCOME); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Bundle.SearchEntryMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Bundle.BundleEntryRequestComponent convertBundleEntryRequestComponent(org.hl7.fhir.r4b.model.Bundle.BundleEntryRequestComponent src) throws FHIRException { @@ -335,65 +353,73 @@ public static org.hl7.fhir.r4b.model.Bundle.BundleEntryRequestComponent convertB } static public org.hl7.fhir.r5.model.Enumeration convertHTTPVerb(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Bundle.HTTPVerbEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case GET: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.GET); - break; - case HEAD: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.HEAD); - break; - case POST: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.POST); - break; - case PUT: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.PUT); - break; - case DELETE: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.DELETE); - break; - case PATCH: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.PATCH); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Bundle.HTTPVerbEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case GET: + tgt.setValue(Bundle.HTTPVerb.GET); + break; + case HEAD: + tgt.setValue(Bundle.HTTPVerb.HEAD); + break; + case POST: + tgt.setValue(Bundle.HTTPVerb.POST); + break; + case PUT: + tgt.setValue(Bundle.HTTPVerb.PUT); + break; + case DELETE: + tgt.setValue(Bundle.HTTPVerb.DELETE); + break; + case PATCH: + tgt.setValue(Bundle.HTTPVerb.PATCH); + break; + default: + tgt.setValue(Bundle.HTTPVerb.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertHTTPVerb(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Bundle.HTTPVerbEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case GET: - tgt.setValue(org.hl7.fhir.r4b.model.Bundle.HTTPVerb.GET); - break; - case HEAD: - tgt.setValue(org.hl7.fhir.r4b.model.Bundle.HTTPVerb.HEAD); - break; - case POST: - tgt.setValue(org.hl7.fhir.r4b.model.Bundle.HTTPVerb.POST); - break; - case PUT: - tgt.setValue(org.hl7.fhir.r4b.model.Bundle.HTTPVerb.PUT); - break; - case DELETE: - tgt.setValue(org.hl7.fhir.r4b.model.Bundle.HTTPVerb.DELETE); - break; - case PATCH: - tgt.setValue(org.hl7.fhir.r4b.model.Bundle.HTTPVerb.PATCH); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Bundle.HTTPVerb.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Bundle.HTTPVerbEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case GET: + tgt.setValue(org.hl7.fhir.r4b.model.Bundle.HTTPVerb.GET); + break; + case HEAD: + tgt.setValue(org.hl7.fhir.r4b.model.Bundle.HTTPVerb.HEAD); + break; + case POST: + tgt.setValue(org.hl7.fhir.r4b.model.Bundle.HTTPVerb.POST); + break; + case PUT: + tgt.setValue(org.hl7.fhir.r4b.model.Bundle.HTTPVerb.PUT); + break; + case DELETE: + tgt.setValue(org.hl7.fhir.r4b.model.Bundle.HTTPVerb.DELETE); + break; + case PATCH: + tgt.setValue(org.hl7.fhir.r4b.model.Bundle.HTTPVerb.PATCH); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Bundle.HTTPVerb.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Bundle.BundleEntryResponseComponent convertBundleEntryResponseComponent(org.hl7.fhir.r4b.model.Bundle.BundleEntryResponseComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CapabilityStatement43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CapabilityStatement43_50.java index 1b844c3c44..955c50f500 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CapabilityStatement43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CapabilityStatement43_50.java @@ -18,6 +18,9 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Url43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.CapabilityStatement; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -167,47 +170,55 @@ public static org.hl7.fhir.r4b.model.CapabilityStatement convertCapabilityStatem } static public org.hl7.fhir.r5.model.Enumeration convertCapabilityStatementKind(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKindEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.INSTANCE); - break; - case CAPABILITY: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.CAPABILITY); - break; - case REQUIREMENTS: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.REQUIREMENTS); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.CapabilityStatementKindEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(Enumerations.CapabilityStatementKind.INSTANCE); + break; + case CAPABILITY: + tgt.setValue(Enumerations.CapabilityStatementKind.CAPABILITY); + break; + case REQUIREMENTS: + tgt.setValue(Enumerations.CapabilityStatementKind.REQUIREMENTS); + break; + default: + tgt.setValue(Enumerations.CapabilityStatementKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertCapabilityStatementKind(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.CapabilityStatementKindEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CapabilityStatementKind.INSTANCE); - break; - case CAPABILITY: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CapabilityStatementKind.CAPABILITY); - break; - case REQUIREMENTS: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CapabilityStatementKind.REQUIREMENTS); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CapabilityStatementKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.CapabilityStatementKindEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CapabilityStatementKind.INSTANCE); + break; + case CAPABILITY: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CapabilityStatementKind.CAPABILITY); + break; + case REQUIREMENTS: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CapabilityStatementKind.REQUIREMENTS); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CapabilityStatementKind.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementSoftwareComponent convertCapabilityStatementSoftwareComponent(org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementSoftwareComponent src) throws FHIRException { @@ -315,41 +326,49 @@ public static org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRest } static public org.hl7.fhir.r5.model.Enumeration convertRestfulCapabilityMode(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.RestfulCapabilityModeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case CLIENT: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.RestfulCapabilityMode.CLIENT); - break; - case SERVER: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.RestfulCapabilityMode.SERVER); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.RestfulCapabilityMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CapabilityStatement.RestfulCapabilityModeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CLIENT: + tgt.setValue(CapabilityStatement.RestfulCapabilityMode.CLIENT); + break; + case SERVER: + tgt.setValue(CapabilityStatement.RestfulCapabilityMode.SERVER); + break; + default: + tgt.setValue(CapabilityStatement.RestfulCapabilityMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertRestfulCapabilityMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CapabilityStatement.RestfulCapabilityModeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case CLIENT: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.RestfulCapabilityMode.CLIENT); - break; - case SERVER: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.RestfulCapabilityMode.SERVER); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.RestfulCapabilityMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CapabilityStatement.RestfulCapabilityModeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CLIENT: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.RestfulCapabilityMode.CLIENT); + break; + case SERVER: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.RestfulCapabilityMode.SERVER); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.RestfulCapabilityMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestSecurityComponent convertCapabilityStatementRestSecurityComponent(org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRestSecurityComponent src) throws FHIRException { @@ -467,197 +486,229 @@ public static org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRest } static public org.hl7.fhir.r5.model.Enumeration convertResourceVersionPolicy(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicyEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case NOVERSION: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy.NOVERSION); - break; - case VERSIONED: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy.VERSIONED); - break; - case VERSIONEDUPDATE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy.VERSIONEDUPDATE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CapabilityStatement.ResourceVersionPolicyEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOVERSION: + tgt.setValue(CapabilityStatement.ResourceVersionPolicy.NOVERSION); + break; + case VERSIONED: + tgt.setValue(CapabilityStatement.ResourceVersionPolicy.VERSIONED); + break; + case VERSIONEDUPDATE: + tgt.setValue(CapabilityStatement.ResourceVersionPolicy.VERSIONEDUPDATE); + break; + default: + tgt.setValue(CapabilityStatement.ResourceVersionPolicy.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertResourceVersionPolicy(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CapabilityStatement.ResourceVersionPolicyEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case NOVERSION: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.ResourceVersionPolicy.NOVERSION); - break; - case VERSIONED: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.ResourceVersionPolicy.VERSIONED); - break; - case VERSIONEDUPDATE: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.ResourceVersionPolicy.VERSIONEDUPDATE); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.ResourceVersionPolicy.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CapabilityStatement.ResourceVersionPolicyEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOVERSION: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.ResourceVersionPolicy.NOVERSION); + break; + case VERSIONED: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.ResourceVersionPolicy.VERSIONED); + break; + case VERSIONEDUPDATE: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.ResourceVersionPolicy.VERSIONEDUPDATE); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.ResourceVersionPolicy.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertConditionalReadStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus.NOTSUPPORTED); - break; - case MODIFIEDSINCE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus.MODIFIEDSINCE); - break; - case NOTMATCH: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus.NOTMATCH); - break; - case FULLSUPPORT: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus.FULLSUPPORT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CapabilityStatement.ConditionalReadStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTSUPPORTED: + tgt.setValue(CapabilityStatement.ConditionalReadStatus.NOTSUPPORTED); + break; + case MODIFIEDSINCE: + tgt.setValue(CapabilityStatement.ConditionalReadStatus.MODIFIEDSINCE); + break; + case NOTMATCH: + tgt.setValue(CapabilityStatement.ConditionalReadStatus.NOTMATCH); + break; + case FULLSUPPORT: + tgt.setValue(CapabilityStatement.ConditionalReadStatus.FULLSUPPORT); + break; + default: + tgt.setValue(CapabilityStatement.ConditionalReadStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertConditionalReadStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CapabilityStatement.ConditionalReadStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.ConditionalReadStatus.NOTSUPPORTED); - break; - case MODIFIEDSINCE: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.ConditionalReadStatus.MODIFIEDSINCE); - break; - case NOTMATCH: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.ConditionalReadStatus.NOTMATCH); - break; - case FULLSUPPORT: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.ConditionalReadStatus.FULLSUPPORT); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.ConditionalReadStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CapabilityStatement.ConditionalReadStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTSUPPORTED: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.ConditionalReadStatus.NOTSUPPORTED); + break; + case MODIFIEDSINCE: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.ConditionalReadStatus.MODIFIEDSINCE); + break; + case NOTMATCH: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.ConditionalReadStatus.NOTMATCH); + break; + case FULLSUPPORT: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.ConditionalReadStatus.FULLSUPPORT); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.ConditionalReadStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertConditionalDeleteStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus.NOTSUPPORTED); - break; - case SINGLE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus.SINGLE); - break; - case MULTIPLE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus.MULTIPLE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CapabilityStatement.ConditionalDeleteStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTSUPPORTED: + tgt.setValue(CapabilityStatement.ConditionalDeleteStatus.NOTSUPPORTED); + break; + case SINGLE: + tgt.setValue(CapabilityStatement.ConditionalDeleteStatus.SINGLE); + break; + case MULTIPLE: + tgt.setValue(CapabilityStatement.ConditionalDeleteStatus.MULTIPLE); + break; + default: + tgt.setValue(CapabilityStatement.ConditionalDeleteStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertConditionalDeleteStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CapabilityStatement.ConditionalDeleteStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.ConditionalDeleteStatus.NOTSUPPORTED); - break; - case SINGLE: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.ConditionalDeleteStatus.SINGLE); - break; - case MULTIPLE: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.ConditionalDeleteStatus.MULTIPLE); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.ConditionalDeleteStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CapabilityStatement.ConditionalDeleteStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTSUPPORTED: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.ConditionalDeleteStatus.NOTSUPPORTED); + break; + case SINGLE: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.ConditionalDeleteStatus.SINGLE); + break; + case MULTIPLE: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.ConditionalDeleteStatus.MULTIPLE); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.ConditionalDeleteStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertReferenceHandlingPolicy(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicyEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case LITERAL: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.LITERAL); - break; - case LOGICAL: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.LOGICAL); - break; - case RESOLVES: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.RESOLVES); - break; - case ENFORCED: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.ENFORCED); - break; - case LOCAL: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.LOCAL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CapabilityStatement.ReferenceHandlingPolicyEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case LITERAL: + tgt.setValue(CapabilityStatement.ReferenceHandlingPolicy.LITERAL); + break; + case LOGICAL: + tgt.setValue(CapabilityStatement.ReferenceHandlingPolicy.LOGICAL); + break; + case RESOLVES: + tgt.setValue(CapabilityStatement.ReferenceHandlingPolicy.RESOLVES); + break; + case ENFORCED: + tgt.setValue(CapabilityStatement.ReferenceHandlingPolicy.ENFORCED); + break; + case LOCAL: + tgt.setValue(CapabilityStatement.ReferenceHandlingPolicy.LOCAL); + break; + default: + tgt.setValue(CapabilityStatement.ReferenceHandlingPolicy.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertReferenceHandlingPolicy(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CapabilityStatement.ReferenceHandlingPolicyEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case LITERAL: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.ReferenceHandlingPolicy.LITERAL); - break; - case LOGICAL: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.ReferenceHandlingPolicy.LOGICAL); - break; - case RESOLVES: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.ReferenceHandlingPolicy.RESOLVES); - break; - case ENFORCED: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.ReferenceHandlingPolicy.ENFORCED); - break; - case LOCAL: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.ReferenceHandlingPolicy.LOCAL); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.ReferenceHandlingPolicy.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CapabilityStatement.ReferenceHandlingPolicyEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case LITERAL: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.ReferenceHandlingPolicy.LITERAL); + break; + case LOGICAL: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.ReferenceHandlingPolicy.LOGICAL); + break; + case RESOLVES: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.ReferenceHandlingPolicy.RESOLVES); + break; + case ENFORCED: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.ReferenceHandlingPolicy.ENFORCED); + break; + case LOCAL: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.ReferenceHandlingPolicy.LOCAL); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.ReferenceHandlingPolicy.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.CapabilityStatement.ResourceInteractionComponent convertResourceInteractionComponent(org.hl7.fhir.r4b.model.CapabilityStatement.ResourceInteractionComponent src) throws FHIRException { @@ -685,83 +736,91 @@ public static org.hl7.fhir.r4b.model.CapabilityStatement.ResourceInteractionComp } static public org.hl7.fhir.r5.model.Enumeration convertTypeRestfulInteraction(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteractionEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case READ: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.READ); - break; - case VREAD: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.VREAD); - break; - case UPDATE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.UPDATE); - break; - case PATCH: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.PATCH); - break; - case DELETE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.DELETE); - break; - case HISTORYINSTANCE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.HISTORYINSTANCE); - break; - case HISTORYTYPE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.HISTORYTYPE); - break; - case CREATE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.CREATE); - break; - case SEARCHTYPE: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.SEARCHTYPE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CapabilityStatement.TypeRestfulInteractionEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case READ: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.READ); + break; + case VREAD: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.VREAD); + break; + case UPDATE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.UPDATE); + break; + case PATCH: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.PATCH); + break; + case DELETE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.DELETE); + break; + case HISTORYINSTANCE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.HISTORYINSTANCE); + break; + case HISTORYTYPE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.HISTORYTYPE); + break; + case CREATE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.CREATE); + break; + case SEARCHTYPE: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.SEARCHTYPE); + break; + default: + tgt.setValue(CapabilityStatement.TypeRestfulInteraction.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertTypeRestfulInteraction(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CapabilityStatement.TypeRestfulInteractionEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case READ: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.TypeRestfulInteraction.READ); - break; - case VREAD: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.TypeRestfulInteraction.VREAD); - break; - case UPDATE: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.TypeRestfulInteraction.UPDATE); - break; - case PATCH: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.TypeRestfulInteraction.PATCH); - break; - case DELETE: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.TypeRestfulInteraction.DELETE); - break; - case HISTORYINSTANCE: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.TypeRestfulInteraction.HISTORYINSTANCE); - break; - case HISTORYTYPE: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.TypeRestfulInteraction.HISTORYTYPE); - break; - case CREATE: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.TypeRestfulInteraction.CREATE); - break; - case SEARCHTYPE: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.TypeRestfulInteraction.SEARCHTYPE); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.TypeRestfulInteraction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CapabilityStatement.TypeRestfulInteractionEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case READ: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.TypeRestfulInteraction.READ); + break; + case VREAD: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.TypeRestfulInteraction.VREAD); + break; + case UPDATE: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.TypeRestfulInteraction.UPDATE); + break; + case PATCH: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.TypeRestfulInteraction.PATCH); + break; + case DELETE: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.TypeRestfulInteraction.DELETE); + break; + case HISTORYINSTANCE: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.TypeRestfulInteraction.HISTORYINSTANCE); + break; + case HISTORYTYPE: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.TypeRestfulInteraction.HISTORYTYPE); + break; + case CREATE: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.TypeRestfulInteraction.CREATE); + break; + case SEARCHTYPE: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.TypeRestfulInteraction.SEARCHTYPE); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.TypeRestfulInteraction.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent convertCapabilityStatementRestResourceSearchParamComponent(org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent src) throws FHIRException { @@ -849,53 +908,61 @@ public static org.hl7.fhir.r4b.model.CapabilityStatement.SystemInteractionCompon } static public org.hl7.fhir.r5.model.Enumeration convertSystemRestfulInteraction(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteractionEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case TRANSACTION: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.TRANSACTION); - break; - case BATCH: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.BATCH); - break; - case SEARCHSYSTEM: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.SEARCHSYSTEM); - break; - case HISTORYSYSTEM: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.HISTORYSYSTEM); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CapabilityStatement.SystemRestfulInteractionEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case TRANSACTION: + tgt.setValue(CapabilityStatement.SystemRestfulInteraction.TRANSACTION); + break; + case BATCH: + tgt.setValue(CapabilityStatement.SystemRestfulInteraction.BATCH); + break; + case SEARCHSYSTEM: + tgt.setValue(CapabilityStatement.SystemRestfulInteraction.SEARCHSYSTEM); + break; + case HISTORYSYSTEM: + tgt.setValue(CapabilityStatement.SystemRestfulInteraction.HISTORYSYSTEM); + break; + default: + tgt.setValue(CapabilityStatement.SystemRestfulInteraction.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertSystemRestfulInteraction(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CapabilityStatement.SystemRestfulInteractionEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case TRANSACTION: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.SystemRestfulInteraction.TRANSACTION); - break; - case BATCH: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.SystemRestfulInteraction.BATCH); - break; - case SEARCHSYSTEM: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.SystemRestfulInteraction.SEARCHSYSTEM); - break; - case HISTORYSYSTEM: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.SystemRestfulInteraction.HISTORYSYSTEM); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.SystemRestfulInteraction.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CapabilityStatement.SystemRestfulInteractionEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case TRANSACTION: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.SystemRestfulInteraction.TRANSACTION); + break; + case BATCH: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.SystemRestfulInteraction.BATCH); + break; + case SEARCHSYSTEM: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.SystemRestfulInteraction.SEARCHSYSTEM); + break; + case HISTORYSYSTEM: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.SystemRestfulInteraction.HISTORYSYSTEM); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.SystemRestfulInteraction.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingComponent convertCapabilityStatementMessagingComponent(org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementMessagingComponent src) throws FHIRException { @@ -979,41 +1046,49 @@ public static org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementMess } static public org.hl7.fhir.r5.model.Enumeration convertEventCapabilityMode(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityModeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case SENDER: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityMode.SENDER); - break; - case RECEIVER: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityMode.RECEIVER); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CapabilityStatement.EventCapabilityModeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SENDER: + tgt.setValue(CapabilityStatement.EventCapabilityMode.SENDER); + break; + case RECEIVER: + tgt.setValue(CapabilityStatement.EventCapabilityMode.RECEIVER); + break; + default: + tgt.setValue(CapabilityStatement.EventCapabilityMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertEventCapabilityMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CapabilityStatement.EventCapabilityModeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case SENDER: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.EventCapabilityMode.SENDER); - break; - case RECEIVER: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.EventCapabilityMode.RECEIVER); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.EventCapabilityMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CapabilityStatement.EventCapabilityModeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SENDER: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.EventCapabilityMode.SENDER); + break; + case RECEIVER: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.EventCapabilityMode.RECEIVER); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.EventCapabilityMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementDocumentComponent convertCapabilityStatementDocumentComponent(org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementDocumentComponent src) throws FHIRException { @@ -1045,40 +1120,48 @@ public static org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementDocu } static public org.hl7.fhir.r5.model.Enumeration convertDocumentMode(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CapabilityStatement.DocumentModeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PRODUCER: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.DocumentMode.PRODUCER); - break; - case CONSUMER: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.DocumentMode.CONSUMER); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CapabilityStatement.DocumentMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CapabilityStatement.DocumentModeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRODUCER: + tgt.setValue(CapabilityStatement.DocumentMode.PRODUCER); + break; + case CONSUMER: + tgt.setValue(CapabilityStatement.DocumentMode.CONSUMER); + break; + default: + tgt.setValue(CapabilityStatement.DocumentMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertDocumentMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CapabilityStatement.DocumentModeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PRODUCER: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.DocumentMode.PRODUCER); - break; - case CONSUMER: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.DocumentMode.CONSUMER); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.DocumentMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CapabilityStatement.DocumentModeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRODUCER: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.DocumentMode.PRODUCER); + break; + case CONSUMER: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.DocumentMode.CONSUMER); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.CapabilityStatement.DocumentMode.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CarePlan43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CarePlan43_50.java index 565baac9fc..ade842c2ca 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CarePlan43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CarePlan43_50.java @@ -11,7 +11,10 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.CarePlan; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -142,121 +145,137 @@ public static org.hl7.fhir.r4b.model.CarePlan convertCarePlan(org.hl7.fhir.r5.mo } static public org.hl7.fhir.r5.model.Enumeration convertCarePlanStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ONHOLD); - break; - case REVOKED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.REVOKED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.RequestStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(Enumerations.RequestStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(Enumerations.RequestStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(Enumerations.RequestStatus.ONHOLD); + break; + case REVOKED: + tgt.setValue(Enumerations.RequestStatus.REVOKED); + break; + case COMPLETED: + tgt.setValue(Enumerations.RequestStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.RequestStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Enumerations.RequestStatus.UNKNOWN); + break; + default: + tgt.setValue(Enumerations.RequestStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertCarePlanStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ONHOLD); - break; - case REVOKED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.REVOKED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ONHOLD); + break; + case REVOKED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.REVOKED); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertCarePlanIntent(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CarePlan.CarePlanIntentEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSAL: - tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.PROPOSAL); - break; - case PLAN: - tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.PLAN); - break; - case ORDER: - tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.ORDER); - break; - case OPTION: - tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.OPTION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CarePlan.CarePlanIntentEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSAL: + tgt.setValue(CarePlan.CarePlanIntent.PROPOSAL); + break; + case PLAN: + tgt.setValue(CarePlan.CarePlanIntent.PLAN); + break; + case ORDER: + tgt.setValue(CarePlan.CarePlanIntent.ORDER); + break; + case OPTION: + tgt.setValue(CarePlan.CarePlanIntent.OPTION); + break; + default: + tgt.setValue(CarePlan.CarePlanIntent.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertCarePlanIntent(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CarePlan.CarePlanIntentEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSAL: - tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanIntent.PROPOSAL); - break; - case PLAN: - tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanIntent.PLAN); - break; - case ORDER: - tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanIntent.ORDER); - break; - case OPTION: - tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanIntent.OPTION); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanIntent.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CarePlan.CarePlanIntentEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSAL: + tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanIntent.PROPOSAL); + break; + case PLAN: + tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanIntent.PLAN); + break; + case ORDER: + tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanIntent.ORDER); + break; + case OPTION: + tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanIntent.OPTION); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanIntent.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.CarePlan.CarePlanActivityComponent convertCarePlanActivityComponent(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CareTeam43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CareTeam43_50.java index 700f484e36..016cc0b13f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CareTeam43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CareTeam43_50.java @@ -9,7 +9,9 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.CareTeam; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; /* Copyright (c) 2011+, HL7, Inc. @@ -107,59 +109,67 @@ public static org.hl7.fhir.r4b.model.CareTeam convertCareTeam(org.hl7.fhir.r5.mo } static public org.hl7.fhir.r5.model.Enumeration convertCareTeamStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CareTeam.CareTeamStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSED: - tgt.setValue(org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.PROPOSED); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.ACTIVE); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.SUSPENDED); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CareTeam.CareTeamStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSED: + tgt.setValue(CareTeam.CareTeamStatus.PROPOSED); + break; + case ACTIVE: + tgt.setValue(CareTeam.CareTeamStatus.ACTIVE); + break; + case SUSPENDED: + tgt.setValue(CareTeam.CareTeamStatus.SUSPENDED); + break; + case INACTIVE: + tgt.setValue(CareTeam.CareTeamStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(CareTeam.CareTeamStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(CareTeam.CareTeamStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertCareTeamStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CareTeam.CareTeamStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSED: - tgt.setValue(org.hl7.fhir.r4b.model.CareTeam.CareTeamStatus.PROPOSED); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.CareTeam.CareTeamStatus.ACTIVE); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.r4b.model.CareTeam.CareTeamStatus.SUSPENDED); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.CareTeam.CareTeamStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.CareTeam.CareTeamStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.CareTeam.CareTeamStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CareTeam.CareTeamStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSED: + tgt.setValue(org.hl7.fhir.r4b.model.CareTeam.CareTeamStatus.PROPOSED); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4b.model.CareTeam.CareTeamStatus.ACTIVE); + break; + case SUSPENDED: + tgt.setValue(org.hl7.fhir.r4b.model.CareTeam.CareTeamStatus.SUSPENDED); + break; + case INACTIVE: + tgt.setValue(org.hl7.fhir.r4b.model.CareTeam.CareTeamStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.CareTeam.CareTeamStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.CareTeam.CareTeamStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.CareTeam.CareTeamParticipantComponent convertCareTeamParticipantComponent(org.hl7.fhir.r4b.model.CareTeam.CareTeamParticipantComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ChargeItem43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ChargeItem43_50.java index 5c27e01bc1..b68952d285 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ChargeItem43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ChargeItem43_50.java @@ -11,7 +11,9 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.ChargeItem; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; /* Copyright (c) 2011+, HL7, Inc. @@ -159,71 +161,79 @@ public static org.hl7.fhir.r4b.model.ChargeItem convertChargeItem(org.hl7.fhir.r } static public org.hl7.fhir.r5.model.Enumeration convertChargeItemStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.PLANNED); - break; - case BILLABLE: - tgt.setValue(org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.BILLABLE); - break; - case NOTBILLABLE: - tgt.setValue(org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.NOTBILLABLE); - break; - case ABORTED: - tgt.setValue(org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.ABORTED); - break; - case BILLED: - tgt.setValue(org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.BILLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ChargeItem.ChargeItemStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(ChargeItem.ChargeItemStatus.PLANNED); + break; + case BILLABLE: + tgt.setValue(ChargeItem.ChargeItemStatus.BILLABLE); + break; + case NOTBILLABLE: + tgt.setValue(ChargeItem.ChargeItemStatus.NOTBILLABLE); + break; + case ABORTED: + tgt.setValue(ChargeItem.ChargeItemStatus.ABORTED); + break; + case BILLED: + tgt.setValue(ChargeItem.ChargeItemStatus.BILLED); + break; + case ENTEREDINERROR: + tgt.setValue(ChargeItem.ChargeItemStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(ChargeItem.ChargeItemStatus.UNKNOWN); + break; + default: + tgt.setValue(ChargeItem.ChargeItemStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertChargeItemStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.ChargeItem.ChargeItemStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.r4b.model.ChargeItem.ChargeItemStatus.PLANNED); - break; - case BILLABLE: - tgt.setValue(org.hl7.fhir.r4b.model.ChargeItem.ChargeItemStatus.BILLABLE); - break; - case NOTBILLABLE: - tgt.setValue(org.hl7.fhir.r4b.model.ChargeItem.ChargeItemStatus.NOTBILLABLE); - break; - case ABORTED: - tgt.setValue(org.hl7.fhir.r4b.model.ChargeItem.ChargeItemStatus.ABORTED); - break; - case BILLED: - tgt.setValue(org.hl7.fhir.r4b.model.ChargeItem.ChargeItemStatus.BILLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.ChargeItem.ChargeItemStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4b.model.ChargeItem.ChargeItemStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.ChargeItem.ChargeItemStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.ChargeItem.ChargeItemStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(org.hl7.fhir.r4b.model.ChargeItem.ChargeItemStatus.PLANNED); + break; + case BILLABLE: + tgt.setValue(org.hl7.fhir.r4b.model.ChargeItem.ChargeItemStatus.BILLABLE); + break; + case NOTBILLABLE: + tgt.setValue(org.hl7.fhir.r4b.model.ChargeItem.ChargeItemStatus.NOTBILLABLE); + break; + case ABORTED: + tgt.setValue(org.hl7.fhir.r4b.model.ChargeItem.ChargeItemStatus.ABORTED); + break; + case BILLED: + tgt.setValue(org.hl7.fhir.r4b.model.ChargeItem.ChargeItemStatus.BILLED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.ChargeItem.ChargeItemStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4b.model.ChargeItem.ChargeItemStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.ChargeItem.ChargeItemStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.ChargeItem.ChargeItemPerformerComponent convertChargeItemPerformerComponent(org.hl7.fhir.r4b.model.ChargeItem.ChargeItemPerformerComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Claim43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Claim43_50.java index 999e5ad275..57d806c2d7 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Claim43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Claim43_50.java @@ -14,6 +14,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -169,97 +171,113 @@ public static org.hl7.fhir.r4b.model.Claim convertClaim(org.hl7.fhir.r5.model.Cl } static public org.hl7.fhir.r5.model.Enumeration convertClaimStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodesEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.CANCELLED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.FinancialResourceStatusCodesEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.ACTIVE); + break; + case CANCELLED: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.CANCELLED); + break; + case DRAFT: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); + break; + default: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertClaimStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodesEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.CANCELLED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodesEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.ACTIVE); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.CANCELLED); + break; + case DRAFT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertUse(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.UseEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case CLAIM: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.Use.CLAIM); - break; - case PREAUTHORIZATION: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.Use.PREAUTHORIZATION); - break; - case PREDETERMINATION: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.Use.PREDETERMINATION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.Use.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.UseEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CLAIM: + tgt.setValue(Enumerations.Use.CLAIM); + break; + case PREAUTHORIZATION: + tgt.setValue(Enumerations.Use.PREAUTHORIZATION); + break; + case PREDETERMINATION: + tgt.setValue(Enumerations.Use.PREDETERMINATION); + break; + default: + tgt.setValue(Enumerations.Use.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertUse(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.UseEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case CLAIM: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.Use.CLAIM); - break; - case PREAUTHORIZATION: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.Use.PREAUTHORIZATION); - break; - case PREDETERMINATION: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.Use.PREDETERMINATION); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.Use.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.UseEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CLAIM: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.Use.CLAIM); + break; + case PREAUTHORIZATION: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.Use.PREAUTHORIZATION); + break; + case PREDETERMINATION: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.Use.PREDETERMINATION); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.Use.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Claim.RelatedClaimComponent convertRelatedClaimComponent(org.hl7.fhir.r4b.model.Claim.RelatedClaimComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ClaimResponse43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ClaimResponse43_50.java index 962d9442c5..3a111865b5 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ClaimResponse43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ClaimResponse43_50.java @@ -15,6 +15,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -166,147 +168,171 @@ public static org.hl7.fhir.r4b.model.ClaimResponse convertClaimResponse(org.hl7. } static public org.hl7.fhir.r5.model.Enumeration convertClaimResponseStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodesEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.CANCELLED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.FinancialResourceStatusCodesEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.ACTIVE); + break; + case CANCELLED: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.CANCELLED); + break; + case DRAFT: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); + break; + default: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertClaimResponseStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodesEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.CANCELLED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodesEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.ACTIVE); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.CANCELLED); + break; + case DRAFT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertUse(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.UseEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case CLAIM: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.Use.CLAIM); - break; - case PREAUTHORIZATION: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.Use.PREAUTHORIZATION); - break; - case PREDETERMINATION: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.Use.PREDETERMINATION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.Use.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.UseEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CLAIM: + tgt.setValue(Enumerations.Use.CLAIM); + break; + case PREAUTHORIZATION: + tgt.setValue(Enumerations.Use.PREAUTHORIZATION); + break; + case PREDETERMINATION: + tgt.setValue(Enumerations.Use.PREDETERMINATION); + break; + default: + tgt.setValue(Enumerations.Use.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertUse(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.UseEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case CLAIM: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.Use.CLAIM); - break; - case PREAUTHORIZATION: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.Use.PREAUTHORIZATION); - break; - case PREDETERMINATION: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.Use.PREDETERMINATION); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.Use.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.UseEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CLAIM: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.Use.CLAIM); + break; + case PREAUTHORIZATION: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.Use.PREAUTHORIZATION); + break; + case PREDETERMINATION: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.Use.PREDETERMINATION); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.Use.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertRemittanceOutcome(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodesEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case QUEUED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.QUEUED); - break; - case COMPLETE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.COMPLETE); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.ERROR); - break; - case PARTIAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.PARTIAL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ClaimProcessingCodesEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case QUEUED: + tgt.setValue(Enumerations.ClaimProcessingCodes.QUEUED); + break; + case COMPLETE: + tgt.setValue(Enumerations.ClaimProcessingCodes.COMPLETE); + break; + case ERROR: + tgt.setValue(Enumerations.ClaimProcessingCodes.ERROR); + break; + case PARTIAL: + tgt.setValue(Enumerations.ClaimProcessingCodes.PARTIAL); + break; + default: + tgt.setValue(Enumerations.ClaimProcessingCodes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertRemittanceOutcome(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcomeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case QUEUED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcome.QUEUED); - break; - case COMPLETE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcome.COMPLETE); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcome.ERROR); - break; - case PARTIAL: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcome.PARTIAL); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcome.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcomeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case QUEUED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcome.QUEUED); + break; + case COMPLETE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcome.COMPLETE); + break; + case ERROR: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcome.ERROR); + break; + case PARTIAL: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcome.PARTIAL); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcome.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.ClaimResponse.ItemComponent convertItemComponent(org.hl7.fhir.r4b.model.ClaimResponse.ItemComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ClinicalImpression43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ClinicalImpression43_50.java index 17a2967272..b63c321b24 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ClinicalImpression43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ClinicalImpression43_50.java @@ -9,6 +9,9 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4b.model.ClinicalImpression; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -128,47 +131,55 @@ public static org.hl7.fhir.r4b.model.ClinicalImpression convertClinicalImpressio } static public org.hl7.fhir.r5.model.Enumeration convertClinicalImpressionStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.EventStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.EventStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(Enumerations.EventStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(Enumerations.EventStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.EventStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Enumerations.EventStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertClinicalImpressionStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.ClinicalImpression.ClinicalImpressionStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r4b.model.ClinicalImpression.ClinicalImpressionStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4b.model.ClinicalImpression.ClinicalImpressionStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.ClinicalImpression.ClinicalImpressionStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.ClinicalImpression.ClinicalImpressionStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new ClinicalImpression.ClinicalImpressionStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(ClinicalImpression.ClinicalImpressionStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(ClinicalImpression.ClinicalImpressionStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(ClinicalImpression.ClinicalImpressionStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(ClinicalImpression.ClinicalImpressionStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.ClinicalImpression.ClinicalImpressionFindingComponent convertClinicalImpressionFindingComponent(org.hl7.fhir.r4b.model.ClinicalImpression.ClinicalImpressionFindingComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CodeSystem43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CodeSystem43_50.java index 54e467030e..2ec278efd3 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CodeSystem43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CodeSystem43_50.java @@ -17,6 +17,9 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.UnsignedInt43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.CodeSystem; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -170,109 +173,125 @@ public static org.hl7.fhir.r4b.model.CodeSystem convertCodeSystem(org.hl7.fhir.r } static public org.hl7.fhir.r5.model.Enumeration convertCodeSystemHierarchyMeaning(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaningEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case GROUPEDBY: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.GROUPEDBY); - break; - case ISA: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.ISA); - break; - case PARTOF: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.PARTOF); - break; - case CLASSIFIEDWITH: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.CLASSIFIEDWITH); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CodeSystem.CodeSystemHierarchyMeaningEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case GROUPEDBY: + tgt.setValue(CodeSystem.CodeSystemHierarchyMeaning.GROUPEDBY); + break; + case ISA: + tgt.setValue(CodeSystem.CodeSystemHierarchyMeaning.ISA); + break; + case PARTOF: + tgt.setValue(CodeSystem.CodeSystemHierarchyMeaning.PARTOF); + break; + case CLASSIFIEDWITH: + tgt.setValue(CodeSystem.CodeSystemHierarchyMeaning.CLASSIFIEDWITH); + break; + default: + tgt.setValue(CodeSystem.CodeSystemHierarchyMeaning.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertCodeSystemHierarchyMeaning(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CodeSystem.CodeSystemHierarchyMeaningEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case GROUPEDBY: - tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemHierarchyMeaning.GROUPEDBY); - break; - case ISA: - tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemHierarchyMeaning.ISA); - break; - case PARTOF: - tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemHierarchyMeaning.PARTOF); - break; - case CLASSIFIEDWITH: - tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemHierarchyMeaning.CLASSIFIEDWITH); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemHierarchyMeaning.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CodeSystem.CodeSystemHierarchyMeaningEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case GROUPEDBY: + tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemHierarchyMeaning.GROUPEDBY); + break; + case ISA: + tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemHierarchyMeaning.ISA); + break; + case PARTOF: + tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemHierarchyMeaning.PARTOF); + break; + case CLASSIFIEDWITH: + tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemHierarchyMeaning.CLASSIFIEDWITH); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemHierarchyMeaning.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertCodeSystemContentMode(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.CodeSystemContentModeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case NOTPRESENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CodeSystemContentMode.NOTPRESENT); - break; - case EXAMPLE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CodeSystemContentMode.EXAMPLE); - break; - case FRAGMENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CodeSystemContentMode.FRAGMENT); - break; - case COMPLETE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CodeSystemContentMode.COMPLETE); - break; - case SUPPLEMENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CodeSystemContentMode.SUPPLEMENT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CodeSystemContentMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.CodeSystemContentModeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTPRESENT: + tgt.setValue(Enumerations.CodeSystemContentMode.NOTPRESENT); + break; + case EXAMPLE: + tgt.setValue(Enumerations.CodeSystemContentMode.EXAMPLE); + break; + case FRAGMENT: + tgt.setValue(Enumerations.CodeSystemContentMode.FRAGMENT); + break; + case COMPLETE: + tgt.setValue(Enumerations.CodeSystemContentMode.COMPLETE); + break; + case SUPPLEMENT: + tgt.setValue(Enumerations.CodeSystemContentMode.SUPPLEMENT); + break; + default: + tgt.setValue(Enumerations.CodeSystemContentMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertCodeSystemContentMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CodeSystem.CodeSystemContentModeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case NOTPRESENT: - tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemContentMode.NOTPRESENT); - break; - case EXAMPLE: - tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemContentMode.EXAMPLE); - break; - case FRAGMENT: - tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemContentMode.FRAGMENT); - break; - case COMPLETE: - tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemContentMode.COMPLETE); - break; - case SUPPLEMENT: - tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemContentMode.SUPPLEMENT); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemContentMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CodeSystem.CodeSystemContentModeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTPRESENT: + tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemContentMode.NOTPRESENT); + break; + case EXAMPLE: + tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemContentMode.EXAMPLE); + break; + case FRAGMENT: + tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemContentMode.FRAGMENT); + break; + case COMPLETE: + tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemContentMode.COMPLETE); + break; + case SUPPLEMENT: + tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemContentMode.SUPPLEMENT); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemContentMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent convertCodeSystemFilterComponent(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemFilterComponent src) throws FHIRException { @@ -310,83 +329,91 @@ public static org.hl7.fhir.r4b.model.CodeSystem.CodeSystemFilterComponent conver } static public org.hl7.fhir.r5.model.Enumeration convertFilterOperator(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.FilterOperatorEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case EQUAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.EQUAL); - break; - case ISA: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.ISA); - break; - case DESCENDENTOF: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.DESCENDENTOF); - break; - case ISNOTA: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.ISNOTA); - break; - case REGEX: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.REGEX); - break; - case IN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.NOTIN); - break; - case GENERALIZES: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.GENERALIZES); - break; - case EXISTS: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.EXISTS); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.FilterOperatorEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUAL: + tgt.setValue(Enumerations.FilterOperator.EQUAL); + break; + case ISA: + tgt.setValue(Enumerations.FilterOperator.ISA); + break; + case DESCENDENTOF: + tgt.setValue(Enumerations.FilterOperator.DESCENDENTOF); + break; + case ISNOTA: + tgt.setValue(Enumerations.FilterOperator.ISNOTA); + break; + case REGEX: + tgt.setValue(Enumerations.FilterOperator.REGEX); + break; + case IN: + tgt.setValue(Enumerations.FilterOperator.IN); + break; + case NOTIN: + tgt.setValue(Enumerations.FilterOperator.NOTIN); + break; + case GENERALIZES: + tgt.setValue(Enumerations.FilterOperator.GENERALIZES); + break; + case EXISTS: + tgt.setValue(Enumerations.FilterOperator.EXISTS); + break; + default: + tgt.setValue(Enumerations.FilterOperator.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertFilterOperator(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.FilterOperatorEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case EQUAL: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.EQUAL); - break; - case ISA: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.ISA); - break; - case DESCENDENTOF: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.DESCENDENTOF); - break; - case ISNOTA: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.ISNOTA); - break; - case REGEX: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.REGEX); - break; - case IN: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.NOTIN); - break; - case GENERALIZES: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.GENERALIZES); - break; - case EXISTS: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.EXISTS); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.FilterOperatorEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUAL: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.EQUAL); + break; + case ISA: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.ISA); + break; + case DESCENDENTOF: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.DESCENDENTOF); + break; + case ISNOTA: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.ISNOTA); + break; + case REGEX: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.REGEX); + break; + case IN: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.IN); + break; + case NOTIN: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.NOTIN); + break; + case GENERALIZES: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.GENERALIZES); + break; + case EXISTS: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.EXISTS); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.CodeSystem.PropertyComponent convertPropertyComponent(org.hl7.fhir.r4b.model.CodeSystem.PropertyComponent src) throws FHIRException { @@ -422,71 +449,79 @@ public static org.hl7.fhir.r4b.model.CodeSystem.PropertyComponent convertPropert } static public org.hl7.fhir.r5.model.Enumeration convertPropertyType(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CodeSystem.PropertyTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case CODE: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.CODE); - break; - case CODING: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.CODING); - break; - case STRING: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.STRING); - break; - case INTEGER: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.INTEGER); - break; - case BOOLEAN: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.BOOLEAN); - break; - case DATETIME: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.DATETIME); - break; - case DECIMAL: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.DECIMAL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CodeSystem.PropertyTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CODE: + tgt.setValue(CodeSystem.PropertyType.CODE); + break; + case CODING: + tgt.setValue(CodeSystem.PropertyType.CODING); + break; + case STRING: + tgt.setValue(CodeSystem.PropertyType.STRING); + break; + case INTEGER: + tgt.setValue(CodeSystem.PropertyType.INTEGER); + break; + case BOOLEAN: + tgt.setValue(CodeSystem.PropertyType.BOOLEAN); + break; + case DATETIME: + tgt.setValue(CodeSystem.PropertyType.DATETIME); + break; + case DECIMAL: + tgt.setValue(CodeSystem.PropertyType.DECIMAL); + break; + default: + tgt.setValue(CodeSystem.PropertyType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertPropertyType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CodeSystem.PropertyTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case CODE: - tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.PropertyType.CODE); - break; - case CODING: - tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.PropertyType.CODING); - break; - case STRING: - tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.PropertyType.STRING); - break; - case INTEGER: - tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.PropertyType.INTEGER); - break; - case BOOLEAN: - tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.PropertyType.BOOLEAN); - break; - case DATETIME: - tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.PropertyType.DATETIME); - break; - case DECIMAL: - tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.PropertyType.DECIMAL); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.PropertyType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CodeSystem.PropertyTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CODE: + tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.PropertyType.CODE); + break; + case CODING: + tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.PropertyType.CODING); + break; + case STRING: + tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.PropertyType.STRING); + break; + case INTEGER: + tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.PropertyType.INTEGER); + break; + case BOOLEAN: + tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.PropertyType.BOOLEAN); + break; + case DATETIME: + tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.PropertyType.DATETIME); + break; + case DECIMAL: + tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.PropertyType.DECIMAL); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.PropertyType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent convertConceptDefinitionComponent(org.hl7.fhir.r4b.model.CodeSystem.ConceptDefinitionComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Communication43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Communication43_50.java index 8d3db8fc47..a7d7ca2a91 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Communication43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Communication43_50.java @@ -12,6 +12,8 @@ import org.hl7.fhir.r4b.model.StringType; import org.hl7.fhir.r5.model.CodeableConcept; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -145,127 +147,143 @@ public static org.hl7.fhir.r4b.model.Communication convertCommunication(org.hl7. } static public org.hl7.fhir.r5.model.Enumeration convertCommunicationStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.EventStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PREPARATION: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.PREPARATION); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.INPROGRESS); - break; - case NOTDONE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.NOTDONE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.ONHOLD); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.STOPPED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.EventStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PREPARATION: + tgt.setValue(Enumerations.EventStatus.PREPARATION); + break; + case INPROGRESS: + tgt.setValue(Enumerations.EventStatus.INPROGRESS); + break; + case NOTDONE: + tgt.setValue(Enumerations.EventStatus.NOTDONE); + break; + case ONHOLD: + tgt.setValue(Enumerations.EventStatus.ONHOLD); + break; + case STOPPED: + tgt.setValue(Enumerations.EventStatus.STOPPED); + break; + case COMPLETED: + tgt.setValue(Enumerations.EventStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.EventStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Enumerations.EventStatus.UNKNOWN); + break; + default: + tgt.setValue(Enumerations.EventStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertCommunicationStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.EventStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PREPARATION: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.PREPARATION); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.INPROGRESS); - break; - case NOTDONE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.NOTDONE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.ONHOLD); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.STOPPED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.EventStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PREPARATION: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.PREPARATION); + break; + case INPROGRESS: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.INPROGRESS); + break; + case NOTDONE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.NOTDONE); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.ONHOLD); + break; + case STOPPED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.STOPPED); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertCommunicationPriority(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestPriorityEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP); - break; - case STAT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.RequestPriorityEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(Enumerations.RequestPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(Enumerations.RequestPriority.URGENT); + break; + case ASAP: + tgt.setValue(Enumerations.RequestPriority.ASAP); + break; + case STAT: + tgt.setValue(Enumerations.RequestPriority.STAT); + break; + default: + tgt.setValue(Enumerations.RequestPriority.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertCommunicationPriority(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestPriorityEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.URGENT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ASAP); - break; - case STAT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.STAT); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestPriorityEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.URGENT); + break; + case ASAP: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ASAP); + break; + case STAT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.STAT); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Communication.CommunicationPayloadComponent convertCommunicationPayloadComponent(org.hl7.fhir.r4b.model.Communication.CommunicationPayloadComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CommunicationRequest43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CommunicationRequest43_50.java index e93b8c264b..89547ecaae 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CommunicationRequest43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CommunicationRequest43_50.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -140,121 +142,137 @@ public static org.hl7.fhir.r4b.model.CommunicationRequest convertCommunicationRe } static public org.hl7.fhir.r5.model.Enumeration convertCommunicationRequestStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ONHOLD); - break; - case REVOKED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.REVOKED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.RequestStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(Enumerations.RequestStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(Enumerations.RequestStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(Enumerations.RequestStatus.ONHOLD); + break; + case REVOKED: + tgt.setValue(Enumerations.RequestStatus.REVOKED); + break; + case COMPLETED: + tgt.setValue(Enumerations.RequestStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.RequestStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Enumerations.RequestStatus.UNKNOWN); + break; + default: + tgt.setValue(Enumerations.RequestStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertCommunicationRequestStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ONHOLD); - break; - case REVOKED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.REVOKED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ONHOLD); + break; + case REVOKED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.REVOKED); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertCommunicationPriority(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestPriorityEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP); - break; - case STAT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.RequestPriorityEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(Enumerations.RequestPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(Enumerations.RequestPriority.URGENT); + break; + case ASAP: + tgt.setValue(Enumerations.RequestPriority.ASAP); + break; + case STAT: + tgt.setValue(Enumerations.RequestPriority.STAT); + break; + default: + tgt.setValue(Enumerations.RequestPriority.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertCommunicationPriority(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestPriorityEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.URGENT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ASAP); - break; - case STAT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.STAT); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestPriorityEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.URGENT); + break; + case ASAP: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ASAP); + break; + case STAT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.STAT); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.CommunicationRequest.CommunicationRequestPayloadComponent convertCommunicationRequestPayloadComponent(org.hl7.fhir.r4b.model.CommunicationRequest.CommunicationRequestPayloadComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CompartmentDefinition43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CompartmentDefinition43_50.java index 05c4c92712..76a2eabbfa 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CompartmentDefinition43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CompartmentDefinition43_50.java @@ -10,6 +10,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -115,59 +117,67 @@ public static org.hl7.fhir.r4b.model.CompartmentDefinition convertCompartmentDef } static public org.hl7.fhir.r5.model.Enumeration convertCompartmentType(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.CompartmentTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PATIENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.PATIENT); - break; - case ENCOUNTER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.ENCOUNTER); - break; - case RELATEDPERSON: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.RELATEDPERSON); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.PRACTITIONER); - break; - case DEVICE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.DEVICE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.CompartmentTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PATIENT: + tgt.setValue(Enumerations.CompartmentType.PATIENT); + break; + case ENCOUNTER: + tgt.setValue(Enumerations.CompartmentType.ENCOUNTER); + break; + case RELATEDPERSON: + tgt.setValue(Enumerations.CompartmentType.RELATEDPERSON); + break; + case PRACTITIONER: + tgt.setValue(Enumerations.CompartmentType.PRACTITIONER); + break; + case DEVICE: + tgt.setValue(Enumerations.CompartmentType.DEVICE); + break; + default: + tgt.setValue(Enumerations.CompartmentType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertCompartmentType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.CompartmentTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PATIENT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompartmentType.PATIENT); - break; - case ENCOUNTER: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompartmentType.ENCOUNTER); - break; - case RELATEDPERSON: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompartmentType.RELATEDPERSON); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompartmentType.PRACTITIONER); - break; - case DEVICE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompartmentType.DEVICE); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompartmentType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.CompartmentTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PATIENT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompartmentType.PATIENT); + break; + case ENCOUNTER: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompartmentType.ENCOUNTER); + break; + case RELATEDPERSON: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompartmentType.RELATEDPERSON); + break; + case PRACTITIONER: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompartmentType.PRACTITIONER); + break; + case DEVICE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompartmentType.DEVICE); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompartmentType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.CompartmentDefinition.CompartmentDefinitionResourceComponent convertCompartmentDefinitionResourceComponent(org.hl7.fhir.r4b.model.CompartmentDefinition.CompartmentDefinitionResourceComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Composition43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Composition43_50.java index 23bb7acf55..f8e28027ad 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Composition43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Composition43_50.java @@ -10,8 +10,7 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Narrative43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.r5.model.CodeableReference; -import org.hl7.fhir.r5.model.RelatedArtifact; +import org.hl7.fhir.r5.model.*; /* Copyright (c) 2011+, HL7, Inc. @@ -119,53 +118,61 @@ public static org.hl7.fhir.r4b.model.Composition convertComposition(org.hl7.fhir } static public org.hl7.fhir.r5.model.Enumeration convertCompositionStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.CompositionStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.AMENDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.CompositionStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRELIMINARY: + tgt.setValue(Enumerations.CompositionStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(Enumerations.CompositionStatus.FINAL); + break; + case AMENDED: + tgt.setValue(Enumerations.CompositionStatus.AMENDED); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.CompositionStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Enumerations.CompositionStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertCompositionStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.CompositionStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompositionStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompositionStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompositionStatus.AMENDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompositionStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompositionStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.CompositionStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRELIMINARY: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompositionStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompositionStatus.FINAL); + break; + case AMENDED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompositionStatus.AMENDED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompositionStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompositionStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Composition.CompositionAttesterComponent convertCompositionAttesterComponent(org.hl7.fhir.r4b.model.Composition.CompositionAttesterComponent src) throws FHIRException { @@ -197,27 +204,31 @@ public static org.hl7.fhir.r4b.model.Composition.CompositionAttesterComponent co } static public org.hl7.fhir.r5.model.CodeableConcept convertCompositionAttestationMode(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.CodeableConcept tgt = new org.hl7.fhir.r5.model.CodeableConcept(); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PERSONAL: - tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("personal"); - break; - case PROFESSIONAL: - tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("professional"); - break; - case LEGAL: - tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("legal"); - break; - case OFFICIAL: - tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("official"); - break; - default: - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + CodeableConcept tgt = new CodeableConcept(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + // Add nothing + } else { + switch (src.getValue()) { + case PERSONAL: + tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("personal"); + break; + case PROFESSIONAL: + tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("professional"); + break; + case LEGAL: + tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("legal"); + break; + case OFFICIAL: + tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("official"); + break; + default: + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertCompositionAttestationMode(org.hl7.fhir.r5.model.CodeableConcept src) throws FHIRException { @@ -270,53 +281,61 @@ public static org.hl7.fhir.r4b.model.Composition.CompositionRelatesToComponent c } static public org.hl7.fhir.r5.model.Enumeration convertDocumentRelationshipType(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case REPLACES: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.REPLACES); - break; - case TRANSFORMS: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.TRANSFORMS); - break; - case SIGNS: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.SIGNS); - break; - case APPENDS: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.APPENDS); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new RelatedArtifact.RelatedArtifactTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REPLACES: + tgt.setValue(RelatedArtifact.RelatedArtifactType.REPLACES); + break; + case TRANSFORMS: + tgt.setValue(RelatedArtifact.RelatedArtifactType.TRANSFORMS); + break; + case SIGNS: + tgt.setValue(RelatedArtifact.RelatedArtifactType.SIGNS); + break; + case APPENDS: + tgt.setValue(RelatedArtifact.RelatedArtifactType.APPENDS); + break; + default: + tgt.setValue(RelatedArtifact.RelatedArtifactType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertDocumentRelationshipType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.DocumentRelationshipTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case REPLACES: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DocumentRelationshipType.REPLACES); - break; - case TRANSFORMS: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DocumentRelationshipType.TRANSFORMS); - break; - case SIGNS: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DocumentRelationshipType.SIGNS); - break; - case APPENDS: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DocumentRelationshipType.APPENDS); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DocumentRelationshipType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.DocumentRelationshipTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REPLACES: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DocumentRelationshipType.REPLACES); + break; + case TRANSFORMS: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DocumentRelationshipType.TRANSFORMS); + break; + case SIGNS: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DocumentRelationshipType.SIGNS); + break; + case APPENDS: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DocumentRelationshipType.APPENDS); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DocumentRelationshipType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Composition.CompositionEventComponent convertCompositionEventComponent(org.hl7.fhir.r4b.model.Composition.CompositionEventComponent src) throws FHIRException { @@ -403,46 +422,54 @@ public static org.hl7.fhir.r4b.model.Composition.SectionComponent convertSection } static public org.hl7.fhir.r5.model.Enumeration convertSectionMode(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ListModeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case WORKING: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ListMode.WORKING); - break; - case SNAPSHOT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ListMode.SNAPSHOT); - break; - case CHANGES: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ListMode.CHANGES); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ListMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ListModeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case WORKING: + tgt.setValue(Enumerations.ListMode.WORKING); + break; + case SNAPSHOT: + tgt.setValue(Enumerations.ListMode.SNAPSHOT); + break; + case CHANGES: + tgt.setValue(Enumerations.ListMode.CHANGES); + break; + default: + tgt.setValue(Enumerations.ListMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertSectionMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.ListModeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case WORKING: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ListMode.WORKING); - break; - case SNAPSHOT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ListMode.SNAPSHOT); - break; - case CHANGES: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ListMode.CHANGES); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ListMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.ListModeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case WORKING: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ListMode.WORKING); + break; + case SNAPSHOT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ListMode.SNAPSHOT); + break; + case CHANGES: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ListMode.CHANGES); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ListMode.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ConceptMap43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ConceptMap43_50.java index 86e6e25968..5c6e484b46 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ConceptMap43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ConceptMap43_50.java @@ -14,6 +14,7 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4b.model.ConceptMap; import org.hl7.fhir.r5.model.CanonicalType; import org.hl7.fhir.r5.model.Coding; import org.hl7.fhir.r5.model.Enumeration; @@ -281,72 +282,80 @@ public static org.hl7.fhir.r4b.model.Enumeration convertConceptMapRelationship(org.hl7.fhir.r4b.model.Enumeration src, org.hl7.fhir.r5.model.ConceptMap.TargetElementComponent tgtCtxt) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - Enumeration tgt = new Enumeration(new Enumerations.ConceptMapRelationshipEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - ToolingExtensions.setCodeExtensionMod(tgtCtxt, VersionConvertorConstants.EXT_OLD_CONCEPTMAP_EQUIVALENCE, src.getValueAsString()); - switch (src.getValue()) { - case EQUIVALENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.EQUIVALENT); - break; - case EQUAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.EQUIVALENT); - break; - case WIDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.SOURCEISNARROWERTHANTARGET); - break; - case SUBSUMES: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.SOURCEISNARROWERTHANTARGET); - break; - case NARROWER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.SOURCEISBROADERTHANTARGET); - break; - case SPECIALIZES: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.SOURCEISBROADERTHANTARGET); - break; - case RELATEDTO: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.RELATEDTO); - break; - case INEXACT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.RELATEDTO); - break; - case UNMATCHED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NULL); - break; - case DISJOINT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NOTRELATEDTO); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration(new Enumerations.ConceptMapRelationshipEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + ToolingExtensions.setCodeExtensionMod(tgtCtxt, VersionConvertorConstants.EXT_OLD_CONCEPTMAP_EQUIVALENCE, src.getValueAsString()); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUIVALENT: + tgt.setValue(ConceptMapRelationship.EQUIVALENT); + break; + case EQUAL: + tgt.setValue(ConceptMapRelationship.EQUIVALENT); + break; + case WIDER: + tgt.setValue(ConceptMapRelationship.SOURCEISNARROWERTHANTARGET); + break; + case SUBSUMES: + tgt.setValue(ConceptMapRelationship.SOURCEISNARROWERTHANTARGET); + break; + case NARROWER: + tgt.setValue(ConceptMapRelationship.SOURCEISBROADERTHANTARGET); + break; + case SPECIALIZES: + tgt.setValue(ConceptMapRelationship.SOURCEISBROADERTHANTARGET); + break; + case RELATEDTO: + tgt.setValue(ConceptMapRelationship.RELATEDTO); + break; + case INEXACT: + tgt.setValue(ConceptMapRelationship.RELATEDTO); + break; + case UNMATCHED: + tgt.setValue(ConceptMapRelationship.NULL); + break; + case DISJOINT: + tgt.setValue(ConceptMapRelationship.NOTRELATEDTO); + break; + default: + tgt.setValue(ConceptMapRelationship.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent convertOtherElementComponent(org.hl7.fhir.r4b.model.ConceptMap.OtherElementComponent src, org.hl7.fhir.r5.model.ConceptMap tgtMap) throws FHIRException { @@ -416,46 +425,54 @@ public static org.hl7.fhir.r4b.model.ConceptMap.ConceptMapGroupUnmappedComponent } static public org.hl7.fhir.r5.model.Enumeration convertConceptMapGroupUnmappedMode(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedModeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROVIDED: - tgt.setValue(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode.USESOURCECODE); - break; - case FIXED: - tgt.setValue(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode.FIXED); - break; - case OTHERMAP: - tgt.setValue(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode.OTHERMAP); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedModeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROVIDED: + tgt.setValue(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode.USESOURCECODE); + break; + case FIXED: + tgt.setValue(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode.FIXED); + break; + case OTHERMAP: + tgt.setValue(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode.OTHERMAP); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertConceptMapGroupUnmappedMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.ConceptMap.ConceptMapGroupUnmappedModeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case USESOURCECODE: - tgt.setValue(org.hl7.fhir.r4b.model.ConceptMap.ConceptMapGroupUnmappedMode.PROVIDED); - break; - case FIXED: - tgt.setValue(org.hl7.fhir.r4b.model.ConceptMap.ConceptMapGroupUnmappedMode.FIXED); - break; - case OTHERMAP: - tgt.setValue(org.hl7.fhir.r4b.model.ConceptMap.ConceptMapGroupUnmappedMode.OTHERMAP); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.ConceptMap.ConceptMapGroupUnmappedMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new ConceptMap.ConceptMapGroupUnmappedModeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case USESOURCECODE: + tgt.setValue(ConceptMap.ConceptMapGroupUnmappedMode.PROVIDED); + break; + case FIXED: + tgt.setValue(ConceptMap.ConceptMapGroupUnmappedMode.FIXED); + break; + case OTHERMAP: + tgt.setValue(ConceptMap.ConceptMapGroupUnmappedMode.OTHERMAP); + break; + default: + tgt.setValue(ConceptMap.ConceptMapGroupUnmappedMode.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Consent43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Consent43_50.java index 331ca47304..0c82ff5aca 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Consent43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Consent43_50.java @@ -10,6 +10,9 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.DateTime43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Consent; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -113,59 +116,67 @@ public static org.hl7.fhir.r4b.model.Consent convertConsent(org.hl7.fhir.r5.mode } static public org.hl7.fhir.r5.model.Enumeration convertConsentState(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Consent.ConsentStateEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.Consent.ConsentState.DRAFT); - break; - case PROPOSED: - tgt.setValue(org.hl7.fhir.r5.model.Consent.ConsentState.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Consent.ConsentState.ACTIVE); - break; - case REJECTED: - tgt.setValue(org.hl7.fhir.r5.model.Consent.ConsentState.INACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Consent.ConsentState.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Consent.ConsentState.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Consent.ConsentState.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Consent.ConsentStateEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(Consent.ConsentState.DRAFT); + break; + case PROPOSED: + tgt.setValue(Consent.ConsentState.DRAFT); + break; + case ACTIVE: + tgt.setValue(Consent.ConsentState.ACTIVE); + break; + case REJECTED: + tgt.setValue(Consent.ConsentState.INACTIVE); + break; + case INACTIVE: + tgt.setValue(Consent.ConsentState.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(Consent.ConsentState.ENTEREDINERROR); + break; + default: + tgt.setValue(Consent.ConsentState.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertConsentState(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Consent.ConsentStateEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r4b.model.Consent.ConsentState.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.Consent.ConsentState.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.Consent.ConsentState.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.Consent.ConsentState.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Consent.ConsentState.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Consent.ConsentStateEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(org.hl7.fhir.r4b.model.Consent.ConsentState.DRAFT); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4b.model.Consent.ConsentState.ACTIVE); + break; + case INACTIVE: + tgt.setValue(org.hl7.fhir.r4b.model.Consent.ConsentState.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.Consent.ConsentState.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Consent.ConsentState.NULL); + break; + } + } + return tgt; } // public static org.hl7.fhir.r5.model.Consent.ConsentPolicyComponent convertConsentPolicyComponent(org.hl7.fhir.r4b.model.Consent.ConsentPolicyComponent src) throws FHIRException { @@ -275,41 +286,49 @@ public static org.hl7.fhir.r4b.model.Consent.ProvisionComponent convertprovision } static public org.hl7.fhir.r5.model.Enumeration convertConsentProvisionType(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ConsentProvisionTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case DENY: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConsentProvisionType.DENY); - break; - case PERMIT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConsentProvisionType.PERMIT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConsentProvisionType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ConsentProvisionTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DENY: + tgt.setValue(Enumerations.ConsentProvisionType.DENY); + break; + case PERMIT: + tgt.setValue(Enumerations.ConsentProvisionType.PERMIT); + break; + default: + tgt.setValue(Enumerations.ConsentProvisionType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertConsentProvisionType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Consent.ConsentProvisionTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case DENY: - tgt.setValue(org.hl7.fhir.r4b.model.Consent.ConsentProvisionType.DENY); - break; - case PERMIT: - tgt.setValue(org.hl7.fhir.r4b.model.Consent.ConsentProvisionType.PERMIT); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Consent.ConsentProvisionType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Consent.ConsentProvisionTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DENY: + tgt.setValue(org.hl7.fhir.r4b.model.Consent.ConsentProvisionType.DENY); + break; + case PERMIT: + tgt.setValue(org.hl7.fhir.r4b.model.Consent.ConsentProvisionType.PERMIT); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Consent.ConsentProvisionType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Consent.ProvisionActorComponent convertprovisionActorComponent(org.hl7.fhir.r4b.model.Consent.ProvisionActorComponent src) throws FHIRException { @@ -361,52 +380,60 @@ public static org.hl7.fhir.r4b.model.Consent.ProvisionDataComponent convertprovi } static public org.hl7.fhir.r5.model.Enumeration convertConsentDataMeaning(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ConsentDataMeaningEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConsentDataMeaning.INSTANCE); - break; - case RELATED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConsentDataMeaning.RELATED); - break; - case DEPENDENTS: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConsentDataMeaning.DEPENDENTS); - break; - case AUTHOREDBY: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConsentDataMeaning.AUTHOREDBY); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConsentDataMeaning.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ConsentDataMeaningEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(Enumerations.ConsentDataMeaning.INSTANCE); + break; + case RELATED: + tgt.setValue(Enumerations.ConsentDataMeaning.RELATED); + break; + case DEPENDENTS: + tgt.setValue(Enumerations.ConsentDataMeaning.DEPENDENTS); + break; + case AUTHOREDBY: + tgt.setValue(Enumerations.ConsentDataMeaning.AUTHOREDBY); + break; + default: + tgt.setValue(Enumerations.ConsentDataMeaning.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertConsentDataMeaning(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Consent.ConsentDataMeaningEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.r4b.model.Consent.ConsentDataMeaning.INSTANCE); - break; - case RELATED: - tgt.setValue(org.hl7.fhir.r4b.model.Consent.ConsentDataMeaning.RELATED); - break; - case DEPENDENTS: - tgt.setValue(org.hl7.fhir.r4b.model.Consent.ConsentDataMeaning.DEPENDENTS); - break; - case AUTHOREDBY: - tgt.setValue(org.hl7.fhir.r4b.model.Consent.ConsentDataMeaning.AUTHOREDBY); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Consent.ConsentDataMeaning.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Consent.ConsentDataMeaningEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(org.hl7.fhir.r4b.model.Consent.ConsentDataMeaning.INSTANCE); + break; + case RELATED: + tgt.setValue(org.hl7.fhir.r4b.model.Consent.ConsentDataMeaning.RELATED); + break; + case DEPENDENTS: + tgt.setValue(org.hl7.fhir.r4b.model.Consent.ConsentDataMeaning.DEPENDENTS); + break; + case AUTHOREDBY: + tgt.setValue(org.hl7.fhir.r4b.model.Consent.ConsentDataMeaning.AUTHOREDBY); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Consent.ConsentDataMeaning.NULL); + break; + } + } + return tgt; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Contract43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Contract43_50.java index 5f0b7dd019..f21764232f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Contract43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Contract43_50.java @@ -19,6 +19,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Contract; +import org.hl7.fhir.r5.model.Enumeration; /* Copyright (c) 2011+, HL7, Inc. @@ -188,119 +190,127 @@ public static org.hl7.fhir.r4b.model.Contract convertContract(org.hl7.fhir.r5.mo } static public org.hl7.fhir.r5.model.Enumeration convertContractStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodesEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case AMENDED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.AMENDED); - break; - case APPENDED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.APPENDED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.CANCELLED); - break; - case DISPUTED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.DISPUTED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.ENTEREDINERROR); - break; - case EXECUTABLE: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.EXECUTABLE); - break; - case EXECUTED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.EXECUTED); - break; - case NEGOTIABLE: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.NEGOTIABLE); - break; - case OFFERED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.OFFERED); - break; - case POLICY: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.POLICY); - break; - case REJECTED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.REJECTED); - break; - case RENEWED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.RENEWED); - break; - case REVOKED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.REVOKED); - break; - case RESOLVED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.RESOLVED); - break; - case TERMINATED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.TERMINATED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Contract.ContractResourceStatusCodesEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case AMENDED: + tgt.setValue(Contract.ContractResourceStatusCodes.AMENDED); + break; + case APPENDED: + tgt.setValue(Contract.ContractResourceStatusCodes.APPENDED); + break; + case CANCELLED: + tgt.setValue(Contract.ContractResourceStatusCodes.CANCELLED); + break; + case DISPUTED: + tgt.setValue(Contract.ContractResourceStatusCodes.DISPUTED); + break; + case ENTEREDINERROR: + tgt.setValue(Contract.ContractResourceStatusCodes.ENTEREDINERROR); + break; + case EXECUTABLE: + tgt.setValue(Contract.ContractResourceStatusCodes.EXECUTABLE); + break; + case EXECUTED: + tgt.setValue(Contract.ContractResourceStatusCodes.EXECUTED); + break; + case NEGOTIABLE: + tgt.setValue(Contract.ContractResourceStatusCodes.NEGOTIABLE); + break; + case OFFERED: + tgt.setValue(Contract.ContractResourceStatusCodes.OFFERED); + break; + case POLICY: + tgt.setValue(Contract.ContractResourceStatusCodes.POLICY); + break; + case REJECTED: + tgt.setValue(Contract.ContractResourceStatusCodes.REJECTED); + break; + case RENEWED: + tgt.setValue(Contract.ContractResourceStatusCodes.RENEWED); + break; + case REVOKED: + tgt.setValue(Contract.ContractResourceStatusCodes.REVOKED); + break; + case RESOLVED: + tgt.setValue(Contract.ContractResourceStatusCodes.RESOLVED); + break; + case TERMINATED: + tgt.setValue(Contract.ContractResourceStatusCodes.TERMINATED); + break; + default: + tgt.setValue(Contract.ContractResourceStatusCodes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertContractStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodesEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case AMENDED: - tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.AMENDED); - break; - case APPENDED: - tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.APPENDED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.CANCELLED); - break; - case DISPUTED: - tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.DISPUTED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.ENTEREDINERROR); - break; - case EXECUTABLE: - tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.EXECUTABLE); - break; - case EXECUTED: - tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.EXECUTED); - break; - case NEGOTIABLE: - tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.NEGOTIABLE); - break; - case OFFERED: - tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.OFFERED); - break; - case POLICY: - tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.POLICY); - break; - case REJECTED: - tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.REJECTED); - break; - case RENEWED: - tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.RENEWED); - break; - case REVOKED: - tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.REVOKED); - break; - case RESOLVED: - tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.RESOLVED); - break; - case TERMINATED: - tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.TERMINATED); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodesEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case AMENDED: + tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.AMENDED); + break; + case APPENDED: + tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.APPENDED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.CANCELLED); + break; + case DISPUTED: + tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.DISPUTED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.ENTEREDINERROR); + break; + case EXECUTABLE: + tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.EXECUTABLE); + break; + case EXECUTED: + tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.EXECUTED); + break; + case NEGOTIABLE: + tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.NEGOTIABLE); + break; + case OFFERED: + tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.OFFERED); + break; + case POLICY: + tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.POLICY); + break; + case REJECTED: + tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.REJECTED); + break; + case RENEWED: + tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.RENEWED); + break; + case REVOKED: + tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.REVOKED); + break; + case RESOLVED: + tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.RESOLVED); + break; + case TERMINATED: + tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.TERMINATED); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Contract.ContentDefinitionComponent convertContentDefinitionComponent(org.hl7.fhir.r4b.model.Contract.ContentDefinitionComponent src) throws FHIRException { @@ -344,119 +354,127 @@ public static org.hl7.fhir.r4b.model.Contract.ContentDefinitionComponent convert } static public org.hl7.fhir.r5.model.Enumeration convertContractPublicationStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodesEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case AMENDED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.AMENDED); - break; - case APPENDED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.APPENDED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.CANCELLED); - break; - case DISPUTED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.DISPUTED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.ENTEREDINERROR); - break; - case EXECUTABLE: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.EXECUTABLE); - break; - case EXECUTED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.EXECUTED); - break; - case NEGOTIABLE: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.NEGOTIABLE); - break; - case OFFERED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.OFFERED); - break; - case POLICY: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.POLICY); - break; - case REJECTED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.REJECTED); - break; - case RENEWED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.RENEWED); - break; - case REVOKED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.REVOKED); - break; - case RESOLVED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.RESOLVED); - break; - case TERMINATED: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.TERMINATED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Contract.ContractResourcePublicationStatusCodesEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case AMENDED: + tgt.setValue(Contract.ContractResourcePublicationStatusCodes.AMENDED); + break; + case APPENDED: + tgt.setValue(Contract.ContractResourcePublicationStatusCodes.APPENDED); + break; + case CANCELLED: + tgt.setValue(Contract.ContractResourcePublicationStatusCodes.CANCELLED); + break; + case DISPUTED: + tgt.setValue(Contract.ContractResourcePublicationStatusCodes.DISPUTED); + break; + case ENTEREDINERROR: + tgt.setValue(Contract.ContractResourcePublicationStatusCodes.ENTEREDINERROR); + break; + case EXECUTABLE: + tgt.setValue(Contract.ContractResourcePublicationStatusCodes.EXECUTABLE); + break; + case EXECUTED: + tgt.setValue(Contract.ContractResourcePublicationStatusCodes.EXECUTED); + break; + case NEGOTIABLE: + tgt.setValue(Contract.ContractResourcePublicationStatusCodes.NEGOTIABLE); + break; + case OFFERED: + tgt.setValue(Contract.ContractResourcePublicationStatusCodes.OFFERED); + break; + case POLICY: + tgt.setValue(Contract.ContractResourcePublicationStatusCodes.POLICY); + break; + case REJECTED: + tgt.setValue(Contract.ContractResourcePublicationStatusCodes.REJECTED); + break; + case RENEWED: + tgt.setValue(Contract.ContractResourcePublicationStatusCodes.RENEWED); + break; + case REVOKED: + tgt.setValue(Contract.ContractResourcePublicationStatusCodes.REVOKED); + break; + case RESOLVED: + tgt.setValue(Contract.ContractResourcePublicationStatusCodes.RESOLVED); + break; + case TERMINATED: + tgt.setValue(Contract.ContractResourcePublicationStatusCodes.TERMINATED); + break; + default: + tgt.setValue(Contract.ContractResourcePublicationStatusCodes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertContractPublicationStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodesEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case AMENDED: - tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.AMENDED); - break; - case APPENDED: - tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.APPENDED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.CANCELLED); - break; - case DISPUTED: - tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.DISPUTED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.ENTEREDINERROR); - break; - case EXECUTABLE: - tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.EXECUTABLE); - break; - case EXECUTED: - tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.EXECUTED); - break; - case NEGOTIABLE: - tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.NEGOTIABLE); - break; - case OFFERED: - tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.OFFERED); - break; - case POLICY: - tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.POLICY); - break; - case REJECTED: - tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.REJECTED); - break; - case RENEWED: - tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.RENEWED); - break; - case REVOKED: - tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.REVOKED); - break; - case RESOLVED: - tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.RESOLVED); - break; - case TERMINATED: - tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.TERMINATED); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodesEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case AMENDED: + tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.AMENDED); + break; + case APPENDED: + tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.APPENDED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.CANCELLED); + break; + case DISPUTED: + tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.DISPUTED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.ENTEREDINERROR); + break; + case EXECUTABLE: + tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.EXECUTABLE); + break; + case EXECUTED: + tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.EXECUTED); + break; + case NEGOTIABLE: + tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.NEGOTIABLE); + break; + case OFFERED: + tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.OFFERED); + break; + case POLICY: + tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.POLICY); + break; + case REJECTED: + tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.REJECTED); + break; + case RENEWED: + tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.RENEWED); + break; + case REVOKED: + tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.REVOKED); + break; + case RESOLVED: + tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.RESOLVED); + break; + case TERMINATED: + tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.TERMINATED); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Contract.TermComponent convertTermComponent(org.hl7.fhir.r4b.model.Contract.TermComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Coverage43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Coverage43_50.java index 92c3a33820..9f7c768302 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Coverage43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Coverage43_50.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -120,53 +122,61 @@ public static org.hl7.fhir.r4b.model.Coverage convertCoverage(org.hl7.fhir.r5.mo } static public org.hl7.fhir.r5.model.Enumeration convertCoverageStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodesEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.CANCELLED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.FinancialResourceStatusCodesEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.ACTIVE); + break; + case CANCELLED: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.CANCELLED); + break; + case DRAFT: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); + break; + default: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertCoverageStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodesEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.CANCELLED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodesEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.ACTIVE); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.CANCELLED); + break; + case DRAFT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Coverage.ClassComponent convertClassComponent(org.hl7.fhir.r4b.model.Coverage.ClassComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CoverageEligibilityRequest43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CoverageEligibilityRequest43_50.java index 2661feee03..bda712e280 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CoverageEligibilityRequest43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CoverageEligibilityRequest43_50.java @@ -13,6 +13,9 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.CoverageEligibilityRequest; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -120,103 +123,119 @@ public static org.hl7.fhir.r4b.model.CoverageEligibilityRequest convertCoverageE } static public org.hl7.fhir.r5.model.Enumeration convertEligibilityRequestStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodesEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.CANCELLED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.FinancialResourceStatusCodesEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.ACTIVE); + break; + case CANCELLED: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.CANCELLED); + break; + case DRAFT: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); + break; + default: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertEligibilityRequestStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodesEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.CANCELLED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodesEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.ACTIVE); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.CANCELLED); + break; + case DRAFT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertEligibilityRequestPurpose(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurposeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case AUTHREQUIREMENTS: - tgt.setValue(org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose.AUTHREQUIREMENTS); - break; - case BENEFITS: - tgt.setValue(org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose.BENEFITS); - break; - case DISCOVERY: - tgt.setValue(org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose.DISCOVERY); - break; - case VALIDATION: - tgt.setValue(org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose.VALIDATION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new CoverageEligibilityRequest.EligibilityRequestPurposeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case AUTHREQUIREMENTS: + tgt.setValue(CoverageEligibilityRequest.EligibilityRequestPurpose.AUTHREQUIREMENTS); + break; + case BENEFITS: + tgt.setValue(CoverageEligibilityRequest.EligibilityRequestPurpose.BENEFITS); + break; + case DISCOVERY: + tgt.setValue(CoverageEligibilityRequest.EligibilityRequestPurpose.DISCOVERY); + break; + case VALIDATION: + tgt.setValue(CoverageEligibilityRequest.EligibilityRequestPurpose.VALIDATION); + break; + default: + tgt.setValue(CoverageEligibilityRequest.EligibilityRequestPurpose.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertEligibilityRequestPurpose(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CoverageEligibilityRequest.EligibilityRequestPurposeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case AUTHREQUIREMENTS: - tgt.setValue(org.hl7.fhir.r4b.model.CoverageEligibilityRequest.EligibilityRequestPurpose.AUTHREQUIREMENTS); - break; - case BENEFITS: - tgt.setValue(org.hl7.fhir.r4b.model.CoverageEligibilityRequest.EligibilityRequestPurpose.BENEFITS); - break; - case DISCOVERY: - tgt.setValue(org.hl7.fhir.r4b.model.CoverageEligibilityRequest.EligibilityRequestPurpose.DISCOVERY); - break; - case VALIDATION: - tgt.setValue(org.hl7.fhir.r4b.model.CoverageEligibilityRequest.EligibilityRequestPurpose.VALIDATION); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.CoverageEligibilityRequest.EligibilityRequestPurpose.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CoverageEligibilityRequest.EligibilityRequestPurposeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case AUTHREQUIREMENTS: + tgt.setValue(org.hl7.fhir.r4b.model.CoverageEligibilityRequest.EligibilityRequestPurpose.AUTHREQUIREMENTS); + break; + case BENEFITS: + tgt.setValue(org.hl7.fhir.r4b.model.CoverageEligibilityRequest.EligibilityRequestPurpose.BENEFITS); + break; + case DISCOVERY: + tgt.setValue(org.hl7.fhir.r4b.model.CoverageEligibilityRequest.EligibilityRequestPurpose.DISCOVERY); + break; + case VALIDATION: + tgt.setValue(org.hl7.fhir.r4b.model.CoverageEligibilityRequest.EligibilityRequestPurpose.VALIDATION); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.CoverageEligibilityRequest.EligibilityRequestPurpose.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.CoverageEligibilityRequest.SupportingInformationComponent convertSupportingInformationComponent(org.hl7.fhir.r4b.model.CoverageEligibilityRequest.SupportingInformationComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DetectedIssue43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DetectedIssue43_50.java index 49c0345729..9b432f69f4 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DetectedIssue43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DetectedIssue43_50.java @@ -8,6 +8,9 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4b.model.Enumerations; +import org.hl7.fhir.r5.model.DetectedIssue; +import org.hl7.fhir.r5.model.Enumeration; /* Copyright (c) 2011+, HL7, Inc. @@ -103,109 +106,125 @@ public static org.hl7.fhir.r4b.model.DetectedIssue convertDetectedIssue(org.hl7. } static public org.hl7.fhir.r5.model.Enumeration convertDetectedIssueStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.PRELIMINARY); - break; - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.FINAL); - break; - case CORRECTED: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.MITIGATED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.MITIGATED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.NULL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DetectedIssue.DetectedIssueStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(DetectedIssue.DetectedIssueStatus.PRELIMINARY); + break; + case PRELIMINARY: + tgt.setValue(DetectedIssue.DetectedIssueStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(DetectedIssue.DetectedIssueStatus.FINAL); + break; + case AMENDED: + tgt.setValue(DetectedIssue.DetectedIssueStatus.FINAL); + break; + case CORRECTED: + tgt.setValue(DetectedIssue.DetectedIssueStatus.MITIGATED); + break; + case CANCELLED: + tgt.setValue(DetectedIssue.DetectedIssueStatus.MITIGATED); + break; + case ENTEREDINERROR: + tgt.setValue(DetectedIssue.DetectedIssueStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(DetectedIssue.DetectedIssueStatus.NULL); + break; + default: + tgt.setValue(DetectedIssue.DetectedIssueStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertDetectedIssueStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.ObservationStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.FINAL); - break; - case MITIGATED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.CORRECTED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new Enumerations.ObservationStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRELIMINARY: + tgt.setValue(Enumerations.ObservationStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(Enumerations.ObservationStatus.FINAL); + break; + case MITIGATED: + tgt.setValue(Enumerations.ObservationStatus.CORRECTED); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.ObservationStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Enumerations.ObservationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertDetectedIssueSeverity(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverityEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case HIGH: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity.HIGH); - break; - case MODERATE: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity.MODERATE); - break; - case LOW: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity.LOW); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DetectedIssue.DetectedIssueSeverityEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case HIGH: + tgt.setValue(DetectedIssue.DetectedIssueSeverity.HIGH); + break; + case MODERATE: + tgt.setValue(DetectedIssue.DetectedIssueSeverity.MODERATE); + break; + case LOW: + tgt.setValue(DetectedIssue.DetectedIssueSeverity.LOW); + break; + default: + tgt.setValue(DetectedIssue.DetectedIssueSeverity.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertDetectedIssueSeverity(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.DetectedIssue.DetectedIssueSeverityEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case HIGH: - tgt.setValue(org.hl7.fhir.r4b.model.DetectedIssue.DetectedIssueSeverity.HIGH); - break; - case MODERATE: - tgt.setValue(org.hl7.fhir.r4b.model.DetectedIssue.DetectedIssueSeverity.MODERATE); - break; - case LOW: - tgt.setValue(org.hl7.fhir.r4b.model.DetectedIssue.DetectedIssueSeverity.LOW); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.DetectedIssue.DetectedIssueSeverity.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.DetectedIssue.DetectedIssueSeverityEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case HIGH: + tgt.setValue(org.hl7.fhir.r4b.model.DetectedIssue.DetectedIssueSeverity.HIGH); + break; + case MODERATE: + tgt.setValue(org.hl7.fhir.r4b.model.DetectedIssue.DetectedIssueSeverity.MODERATE); + break; + case LOW: + tgt.setValue(org.hl7.fhir.r4b.model.DetectedIssue.DetectedIssueSeverity.LOW); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.DetectedIssue.DetectedIssueSeverity.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueEvidenceComponent convertDetectedIssueEvidenceComponent(org.hl7.fhir.r4b.model.DetectedIssue.DetectedIssueEvidenceComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Device43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Device43_50.java index f387ef80ec..97200ec435 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Device43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Device43_50.java @@ -12,6 +12,9 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Device; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -163,50 +166,58 @@ public static org.hl7.fhir.r4b.model.Device convertDevice(org.hl7.fhir.r5.model. } static public org.hl7.fhir.r5.model.Enumeration convertFHIRDeviceStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Device.FHIRDeviceStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Device.FHIRDeviceStatus.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Device.FHIRDeviceStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Device.FHIRDeviceStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.Device.FHIRDeviceStatus.NULL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Device.FHIRDeviceStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Device.FHIRDeviceStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Device.FHIRDeviceStatus.ACTIVE); + break; + case INACTIVE: + tgt.setValue(Device.FHIRDeviceStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(Device.FHIRDeviceStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Device.FHIRDeviceStatus.NULL); + break; + default: + tgt.setValue(Device.FHIRDeviceStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertFHIRDeviceStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Device.FHIRDeviceStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.Device.FHIRDeviceStatus.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.Device.FHIRDeviceStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.Device.FHIRDeviceStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Device.FHIRDeviceStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Device.FHIRDeviceStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4b.model.Device.FHIRDeviceStatus.ACTIVE); + break; + case INACTIVE: + tgt.setValue(org.hl7.fhir.r4b.model.Device.FHIRDeviceStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.Device.FHIRDeviceStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Device.FHIRDeviceStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Device.DeviceUdiCarrierComponent convertDeviceUdiCarrierComponent(org.hl7.fhir.r4b.model.Device.DeviceUdiCarrierComponent src) throws FHIRException { @@ -250,65 +261,73 @@ public static org.hl7.fhir.r4b.model.Device.DeviceUdiCarrierComponent convertDev } static public org.hl7.fhir.r5.model.Enumeration convertUDIEntryType(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Device.UDIEntryTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case BARCODE: - tgt.setValue(org.hl7.fhir.r5.model.Device.UDIEntryType.BARCODE); - break; - case RFID: - tgt.setValue(org.hl7.fhir.r5.model.Device.UDIEntryType.RFID); - break; - case MANUAL: - tgt.setValue(org.hl7.fhir.r5.model.Device.UDIEntryType.MANUAL); - break; - case CARD: - tgt.setValue(org.hl7.fhir.r5.model.Device.UDIEntryType.CARD); - break; - case SELFREPORTED: - tgt.setValue(org.hl7.fhir.r5.model.Device.UDIEntryType.SELFREPORTED); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.Device.UDIEntryType.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Device.UDIEntryType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Device.UDIEntryTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case BARCODE: + tgt.setValue(Device.UDIEntryType.BARCODE); + break; + case RFID: + tgt.setValue(Device.UDIEntryType.RFID); + break; + case MANUAL: + tgt.setValue(Device.UDIEntryType.MANUAL); + break; + case CARD: + tgt.setValue(Device.UDIEntryType.CARD); + break; + case SELFREPORTED: + tgt.setValue(Device.UDIEntryType.SELFREPORTED); + break; + case UNKNOWN: + tgt.setValue(Device.UDIEntryType.UNKNOWN); + break; + default: + tgt.setValue(Device.UDIEntryType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertUDIEntryType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Device.UDIEntryTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case BARCODE: - tgt.setValue(org.hl7.fhir.r4b.model.Device.UDIEntryType.BARCODE); - break; - case RFID: - tgt.setValue(org.hl7.fhir.r4b.model.Device.UDIEntryType.RFID); - break; - case MANUAL: - tgt.setValue(org.hl7.fhir.r4b.model.Device.UDIEntryType.MANUAL); - break; - case CARD: - tgt.setValue(org.hl7.fhir.r4b.model.Device.UDIEntryType.CARD); - break; - case SELFREPORTED: - tgt.setValue(org.hl7.fhir.r4b.model.Device.UDIEntryType.SELFREPORTED); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4b.model.Device.UDIEntryType.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Device.UDIEntryType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Device.UDIEntryTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case BARCODE: + tgt.setValue(org.hl7.fhir.r4b.model.Device.UDIEntryType.BARCODE); + break; + case RFID: + tgt.setValue(org.hl7.fhir.r4b.model.Device.UDIEntryType.RFID); + break; + case MANUAL: + tgt.setValue(org.hl7.fhir.r4b.model.Device.UDIEntryType.MANUAL); + break; + case CARD: + tgt.setValue(org.hl7.fhir.r4b.model.Device.UDIEntryType.CARD); + break; + case SELFREPORTED: + tgt.setValue(org.hl7.fhir.r4b.model.Device.UDIEntryType.SELFREPORTED); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4b.model.Device.UDIEntryType.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Device.UDIEntryType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Device.DeviceNameComponent convertDeviceDeviceNameComponent(org.hl7.fhir.r4b.model.Device.DeviceDeviceNameComponent src) throws FHIRException { @@ -336,53 +355,61 @@ public static org.hl7.fhir.r4b.model.Device.DeviceDeviceNameComponent convertDev } static public org.hl7.fhir.r5.model.Enumeration convertDeviceNameType(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.DeviceNameTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case USERFRIENDLYNAME: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.USERFRIENDLYNAME); - break; - case PATIENTREPORTEDNAME: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.PATIENTREPORTEDNAME); - break; - case MANUFACTURERNAME: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.REGISTEREDNAME); - break; - case MODELNAME: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.USERFRIENDLYNAME); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.NULL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.DeviceNameTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case USERFRIENDLYNAME: + tgt.setValue(Enumerations.DeviceNameType.USERFRIENDLYNAME); + break; + case PATIENTREPORTEDNAME: + tgt.setValue(Enumerations.DeviceNameType.PATIENTREPORTEDNAME); + break; + case MANUFACTURERNAME: + tgt.setValue(Enumerations.DeviceNameType.REGISTEREDNAME); + break; + case MODELNAME: + tgt.setValue(Enumerations.DeviceNameType.USERFRIENDLYNAME); + break; + case OTHER: + tgt.setValue(Enumerations.DeviceNameType.NULL); + break; + default: + tgt.setValue(Enumerations.DeviceNameType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertDeviceNameType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.DeviceNameTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case USERFRIENDLYNAME: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DeviceNameType.USERFRIENDLYNAME); - break; - case PATIENTREPORTEDNAME: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DeviceNameType.PATIENTREPORTEDNAME); - break; - case REGISTEREDNAME: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DeviceNameType.MANUFACTURERNAME); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DeviceNameType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.DeviceNameTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case USERFRIENDLYNAME: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DeviceNameType.USERFRIENDLYNAME); + break; + case PATIENTREPORTEDNAME: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DeviceNameType.PATIENTREPORTEDNAME); + break; + case REGISTEREDNAME: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DeviceNameType.MANUFACTURERNAME); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DeviceNameType.NULL); + break; + } + } + return tgt; } // public static org.hl7.fhir.r5.model.Device.DeviceSpecializationComponent convertDeviceSpecializationComponent(org.hl7.fhir.r4b.model.Device.DeviceSpecializationComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DeviceDefinition43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DeviceDefinition43_50.java index de7f93029b..1725abb1f8 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DeviceDefinition43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DeviceDefinition43_50.java @@ -13,6 +13,8 @@ import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionClassificationComponent; import org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionVersionComponent; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -192,50 +194,58 @@ public static org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionDeviceName } static public org.hl7.fhir.r5.model.Enumeration convertDeviceNameType(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.DeviceNameTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case USERFRIENDLYNAME: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.USERFRIENDLYNAME); - break; - case PATIENTREPORTEDNAME: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.PATIENTREPORTEDNAME); - break; - case MANUFACTURERNAME: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.REGISTEREDNAME); - break; - case MODELNAME: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.USERFRIENDLYNAME); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.DeviceNameTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case USERFRIENDLYNAME: + tgt.setValue(Enumerations.DeviceNameType.USERFRIENDLYNAME); + break; + case PATIENTREPORTEDNAME: + tgt.setValue(Enumerations.DeviceNameType.PATIENTREPORTEDNAME); + break; + case MANUFACTURERNAME: + tgt.setValue(Enumerations.DeviceNameType.REGISTEREDNAME); + break; + case MODELNAME: + tgt.setValue(Enumerations.DeviceNameType.USERFRIENDLYNAME); + break; + default: + tgt.setValue(Enumerations.DeviceNameType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertDeviceNameType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.DeviceNameTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case USERFRIENDLYNAME: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DeviceNameType.USERFRIENDLYNAME); - break; - case PATIENTREPORTEDNAME: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DeviceNameType.PATIENTREPORTEDNAME); - break; - case REGISTEREDNAME: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DeviceNameType.MANUFACTURERNAME); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DeviceNameType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.DeviceNameTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case USERFRIENDLYNAME: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DeviceNameType.USERFRIENDLYNAME); + break; + case PATIENTREPORTEDNAME: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DeviceNameType.PATIENTREPORTEDNAME); + break; + case REGISTEREDNAME: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DeviceNameType.MANUFACTURERNAME); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DeviceNameType.NULL); + break; + } + } + return tgt; } // // public static org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionSpecializationComponent convertDeviceDefinitionSpecializationComponent(org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionSpecializationComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DeviceMetric43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DeviceMetric43_50.java index 6d9fc3079b..534f747f2f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DeviceMetric43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DeviceMetric43_50.java @@ -6,6 +6,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Instant43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.DeviceMetric; +import org.hl7.fhir.r5.model.Enumeration; /* Copyright (c) 2011+, HL7, Inc. @@ -95,53 +97,61 @@ public static org.hl7.fhir.r4b.model.DeviceMetric convertDeviceMetric(org.hl7.fh } static public org.hl7.fhir.r5.model.Enumeration convertDeviceMetricOperationalStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ON: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus.ON); - break; - case OFF: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus.OFF); - break; - case STANDBY: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus.STANDBY); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DeviceMetric.DeviceMetricOperationalStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ON: + tgt.setValue(DeviceMetric.DeviceMetricOperationalStatus.ON); + break; + case OFF: + tgt.setValue(DeviceMetric.DeviceMetricOperationalStatus.OFF); + break; + case STANDBY: + tgt.setValue(DeviceMetric.DeviceMetricOperationalStatus.STANDBY); + break; + case ENTEREDINERROR: + tgt.setValue(DeviceMetric.DeviceMetricOperationalStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(DeviceMetric.DeviceMetricOperationalStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertDeviceMetricOperationalStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricOperationalStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ON: - tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricOperationalStatus.ON); - break; - case OFF: - tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricOperationalStatus.OFF); - break; - case STANDBY: - tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricOperationalStatus.STANDBY); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricOperationalStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricOperationalStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricOperationalStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ON: + tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricOperationalStatus.ON); + break; + case OFF: + tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricOperationalStatus.OFF); + break; + case STANDBY: + tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricOperationalStatus.STANDBY); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricOperationalStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricOperationalStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.CodeType convertDeviceMetricColor(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { @@ -191,53 +201,61 @@ static public org.hl7.fhir.r4b.model.Enumeration convertDeviceMetricCategory(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategoryEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case MEASUREMENT: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory.MEASUREMENT); - break; - case SETTING: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory.SETTING); - break; - case CALCULATION: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory.CALCULATION); - break; - case UNSPECIFIED: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory.UNSPECIFIED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DeviceMetric.DeviceMetricCategoryEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MEASUREMENT: + tgt.setValue(DeviceMetric.DeviceMetricCategory.MEASUREMENT); + break; + case SETTING: + tgt.setValue(DeviceMetric.DeviceMetricCategory.SETTING); + break; + case CALCULATION: + tgt.setValue(DeviceMetric.DeviceMetricCategory.CALCULATION); + break; + case UNSPECIFIED: + tgt.setValue(DeviceMetric.DeviceMetricCategory.UNSPECIFIED); + break; + default: + tgt.setValue(DeviceMetric.DeviceMetricCategory.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertDeviceMetricCategory(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCategoryEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case MEASUREMENT: - tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCategory.MEASUREMENT); - break; - case SETTING: - tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCategory.SETTING); - break; - case CALCULATION: - tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCategory.CALCULATION); - break; - case UNSPECIFIED: - tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCategory.UNSPECIFIED); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCategory.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCategoryEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MEASUREMENT: + tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCategory.MEASUREMENT); + break; + case SETTING: + tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCategory.SETTING); + break; + case CALCULATION: + tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCategory.CALCULATION); + break; + case UNSPECIFIED: + tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCategory.UNSPECIFIED); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCategory.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationComponent convertDeviceMetricCalibrationComponent(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationComponent src) throws FHIRException { @@ -269,102 +287,118 @@ public static org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationCompone } static public org.hl7.fhir.r5.model.Enumeration convertDeviceMetricCalibrationType(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case UNSPECIFIED: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType.UNSPECIFIED); - break; - case OFFSET: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType.OFFSET); - break; - case GAIN: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType.GAIN); - break; - case TWOPOINT: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType.TWOPOINT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DeviceMetric.DeviceMetricCalibrationTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case UNSPECIFIED: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationType.UNSPECIFIED); + break; + case OFFSET: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationType.OFFSET); + break; + case GAIN: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationType.GAIN); + break; + case TWOPOINT: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationType.TWOPOINT); + break; + default: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertDeviceMetricCalibrationType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case UNSPECIFIED: - tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationType.UNSPECIFIED); - break; - case OFFSET: - tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationType.OFFSET); - break; - case GAIN: - tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationType.GAIN); - break; - case TWOPOINT: - tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationType.TWOPOINT); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case UNSPECIFIED: + tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationType.UNSPECIFIED); + break; + case OFFSET: + tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationType.OFFSET); + break; + case GAIN: + tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationType.GAIN); + break; + case TWOPOINT: + tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationType.TWOPOINT); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertDeviceMetricCalibrationState(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationStateEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case NOTCALIBRATED: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState.NOTCALIBRATED); - break; - case CALIBRATIONREQUIRED: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATIONREQUIRED); - break; - case CALIBRATED: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATED); - break; - case UNSPECIFIED: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState.UNSPECIFIED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DeviceMetric.DeviceMetricCalibrationStateEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTCALIBRATED: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationState.NOTCALIBRATED); + break; + case CALIBRATIONREQUIRED: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationState.CALIBRATIONREQUIRED); + break; + case CALIBRATED: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationState.CALIBRATED); + break; + case UNSPECIFIED: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationState.UNSPECIFIED); + break; + default: + tgt.setValue(DeviceMetric.DeviceMetricCalibrationState.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertDeviceMetricCalibrationState(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationStateEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case NOTCALIBRATED: - tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationState.NOTCALIBRATED); - break; - case CALIBRATIONREQUIRED: - tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATIONREQUIRED); - break; - case CALIBRATED: - tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATED); - break; - case UNSPECIFIED: - tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationState.UNSPECIFIED); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationState.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationStateEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NOTCALIBRATED: + tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationState.NOTCALIBRATED); + break; + case CALIBRATIONREQUIRED: + tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATIONREQUIRED); + break; + case CALIBRATED: + tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATED); + break; + case UNSPECIFIED: + tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationState.UNSPECIFIED); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationState.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DeviceRequest43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DeviceRequest43_50.java index c0191487ae..7a6ab36123 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DeviceRequest43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DeviceRequest43_50.java @@ -10,6 +10,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -156,201 +158,225 @@ public static org.hl7.fhir.r4b.model.DeviceRequest convertDeviceRequest(org.hl7. } static public org.hl7.fhir.r5.model.Enumeration convertDeviceRequestStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ONHOLD); - break; - case REVOKED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.REVOKED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.RequestStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(Enumerations.RequestStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(Enumerations.RequestStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(Enumerations.RequestStatus.ONHOLD); + break; + case REVOKED: + tgt.setValue(Enumerations.RequestStatus.REVOKED); + break; + case COMPLETED: + tgt.setValue(Enumerations.RequestStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.RequestStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Enumerations.RequestStatus.UNKNOWN); + break; + default: + tgt.setValue(Enumerations.RequestStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertDeviceRequestStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ONHOLD); - break; - case REVOKED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.REVOKED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ONHOLD); + break; + case REVOKED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.REVOKED); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertRequestIntent(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestIntentEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.PROPOSAL); - break; - case PLAN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.PLAN); - break; - case DIRECTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.DIRECTIVE); - break; - case ORDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORDER); - break; - case ORIGINALORDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORIGINALORDER); - break; - case REFLEXORDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.REFLEXORDER); - break; - case FILLERORDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.FILLERORDER); - break; - case INSTANCEORDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.INSTANCEORDER); - break; - case OPTION: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.OPTION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.RequestIntentEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSAL: + tgt.setValue(Enumerations.RequestIntent.PROPOSAL); + break; + case PLAN: + tgt.setValue(Enumerations.RequestIntent.PLAN); + break; + case DIRECTIVE: + tgt.setValue(Enumerations.RequestIntent.DIRECTIVE); + break; + case ORDER: + tgt.setValue(Enumerations.RequestIntent.ORDER); + break; + case ORIGINALORDER: + tgt.setValue(Enumerations.RequestIntent.ORIGINALORDER); + break; + case REFLEXORDER: + tgt.setValue(Enumerations.RequestIntent.REFLEXORDER); + break; + case FILLERORDER: + tgt.setValue(Enumerations.RequestIntent.FILLERORDER); + break; + case INSTANCEORDER: + tgt.setValue(Enumerations.RequestIntent.INSTANCEORDER); + break; + case OPTION: + tgt.setValue(Enumerations.RequestIntent.OPTION); + break; + default: + tgt.setValue(Enumerations.RequestIntent.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertRequestIntent(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestIntentEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSAL: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.PROPOSAL); - break; - case PLAN: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.PLAN); - break; - case DIRECTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.DIRECTIVE); - break; - case ORDER: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.ORDER); - break; - case ORIGINALORDER: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.ORIGINALORDER); - break; - case REFLEXORDER: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.REFLEXORDER); - break; - case FILLERORDER: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.FILLERORDER); - break; - case INSTANCEORDER: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.INSTANCEORDER); - break; - case OPTION: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.OPTION); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestIntentEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSAL: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.PROPOSAL); + break; + case PLAN: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.PLAN); + break; + case DIRECTIVE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.DIRECTIVE); + break; + case ORDER: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.ORDER); + break; + case ORIGINALORDER: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.ORIGINALORDER); + break; + case REFLEXORDER: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.REFLEXORDER); + break; + case FILLERORDER: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.FILLERORDER); + break; + case INSTANCEORDER: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.INSTANCEORDER); + break; + case OPTION: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.OPTION); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertRequestPriority(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestPriorityEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP); - break; - case STAT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.RequestPriorityEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(Enumerations.RequestPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(Enumerations.RequestPriority.URGENT); + break; + case ASAP: + tgt.setValue(Enumerations.RequestPriority.ASAP); + break; + case STAT: + tgt.setValue(Enumerations.RequestPriority.STAT); + break; + default: + tgt.setValue(Enumerations.RequestPriority.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertRequestPriority(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestPriorityEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.URGENT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ASAP); - break; - case STAT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.STAT); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestPriorityEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.URGENT); + break; + case ASAP: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ASAP); + break; + case STAT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.STAT); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.DeviceRequest.DeviceRequestParameterComponent convertDeviceRequestParameterComponent(org.hl7.fhir.r4b.model.DeviceRequest.DeviceRequestParameterComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DeviceUseStatement43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DeviceUseStatement43_50.java index 486de6c0a2..fae4fb0f51 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DeviceUseStatement43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DeviceUseStatement43_50.java @@ -7,7 +7,10 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.DateTime43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4b.model.DeviceUseStatement; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.DeviceUsage; +import org.hl7.fhir.r5.model.Enumeration; /* Copyright (c) 2011+, HL7, Inc. @@ -107,64 +110,72 @@ public static org.hl7.fhir.r4b.model.DeviceUseStatement convertDeviceUseStatemen } static public org.hl7.fhir.r5.model.Enumeration convertDeviceUseStatementStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DeviceUsage.DeviceUsageStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.DeviceUsage.DeviceUsageStatus.ACTIVE); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.DeviceUsage.DeviceUsageStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.DeviceUsage.DeviceUsageStatus.ENTEREDINERROR); - break; - case INTENDED: - tgt.setValue(org.hl7.fhir.r5.model.DeviceUsage.DeviceUsageStatus.INTENDED); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r5.model.DeviceUsage.DeviceUsageStatus.STOPPED); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r5.model.DeviceUsage.DeviceUsageStatus.ONHOLD); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.DeviceUsage.DeviceUsageStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DeviceUsage.DeviceUsageStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(DeviceUsage.DeviceUsageStatus.ACTIVE); + break; + case COMPLETED: + tgt.setValue(DeviceUsage.DeviceUsageStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(DeviceUsage.DeviceUsageStatus.ENTEREDINERROR); + break; + case INTENDED: + tgt.setValue(DeviceUsage.DeviceUsageStatus.INTENDED); + break; + case STOPPED: + tgt.setValue(DeviceUsage.DeviceUsageStatus.STOPPED); + break; + case ONHOLD: + tgt.setValue(DeviceUsage.DeviceUsageStatus.ONHOLD); + break; + default: + tgt.setValue(DeviceUsage.DeviceUsageStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertDeviceUseStatementStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.DeviceUseStatement.DeviceUseStatementStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.DeviceUseStatement.DeviceUseStatementStatus.ACTIVE); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4b.model.DeviceUseStatement.DeviceUseStatementStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.DeviceUseStatement.DeviceUseStatementStatus.ENTEREDINERROR); - break; - case INTENDED: - tgt.setValue(org.hl7.fhir.r4b.model.DeviceUseStatement.DeviceUseStatementStatus.INTENDED); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r4b.model.DeviceUseStatement.DeviceUseStatementStatus.STOPPED); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r4b.model.DeviceUseStatement.DeviceUseStatementStatus.ONHOLD); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.DeviceUseStatement.DeviceUseStatementStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new DeviceUseStatement.DeviceUseStatementStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(DeviceUseStatement.DeviceUseStatementStatus.ACTIVE); + break; + case COMPLETED: + tgt.setValue(DeviceUseStatement.DeviceUseStatementStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(DeviceUseStatement.DeviceUseStatementStatus.ENTEREDINERROR); + break; + case INTENDED: + tgt.setValue(DeviceUseStatement.DeviceUseStatementStatus.INTENDED); + break; + case STOPPED: + tgt.setValue(DeviceUseStatement.DeviceUseStatementStatus.STOPPED); + break; + case ONHOLD: + tgt.setValue(DeviceUseStatement.DeviceUseStatementStatus.ONHOLD); + break; + default: + tgt.setValue(DeviceUseStatement.DeviceUseStatementStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DiagnosticReport43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DiagnosticReport43_50.java index 810020f531..de26469009 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DiagnosticReport43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DiagnosticReport43_50.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.DiagnosticReport; +import org.hl7.fhir.r5.model.Enumeration; /* Copyright (c) 2011+, HL7, Inc. @@ -117,89 +119,97 @@ public static org.hl7.fhir.r4b.model.DiagnosticReport convertDiagnosticReport(or } static public org.hl7.fhir.r5.model.Enumeration convertDiagnosticReportStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.REGISTERED); - break; - case PARTIAL: - tgt.setValue(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.PARTIAL); - break; - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.AMENDED); - break; - case CORRECTED: - tgt.setValue(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.CORRECTED); - break; - case APPENDED: - tgt.setValue(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.APPENDED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DiagnosticReport.DiagnosticReportStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.REGISTERED); + break; + case PARTIAL: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.PARTIAL); + break; + case PRELIMINARY: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.FINAL); + break; + case AMENDED: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.AMENDED); + break; + case CORRECTED: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.CORRECTED); + break; + case APPENDED: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.APPENDED); + break; + case CANCELLED: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.UNKNOWN); + break; + default: + tgt.setValue(DiagnosticReport.DiagnosticReportStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertDiagnosticReportStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.DiagnosticReport.DiagnosticReportStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.r4b.model.DiagnosticReport.DiagnosticReportStatus.REGISTERED); - break; - case PARTIAL: - tgt.setValue(org.hl7.fhir.r4b.model.DiagnosticReport.DiagnosticReportStatus.PARTIAL); - break; - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.r4b.model.DiagnosticReport.DiagnosticReportStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r4b.model.DiagnosticReport.DiagnosticReportStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r4b.model.DiagnosticReport.DiagnosticReportStatus.AMENDED); - break; - case CORRECTED: - tgt.setValue(org.hl7.fhir.r4b.model.DiagnosticReport.DiagnosticReportStatus.CORRECTED); - break; - case APPENDED: - tgt.setValue(org.hl7.fhir.r4b.model.DiagnosticReport.DiagnosticReportStatus.APPENDED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4b.model.DiagnosticReport.DiagnosticReportStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.DiagnosticReport.DiagnosticReportStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4b.model.DiagnosticReport.DiagnosticReportStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.DiagnosticReport.DiagnosticReportStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.DiagnosticReport.DiagnosticReportStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(org.hl7.fhir.r4b.model.DiagnosticReport.DiagnosticReportStatus.REGISTERED); + break; + case PARTIAL: + tgt.setValue(org.hl7.fhir.r4b.model.DiagnosticReport.DiagnosticReportStatus.PARTIAL); + break; + case PRELIMINARY: + tgt.setValue(org.hl7.fhir.r4b.model.DiagnosticReport.DiagnosticReportStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(org.hl7.fhir.r4b.model.DiagnosticReport.DiagnosticReportStatus.FINAL); + break; + case AMENDED: + tgt.setValue(org.hl7.fhir.r4b.model.DiagnosticReport.DiagnosticReportStatus.AMENDED); + break; + case CORRECTED: + tgt.setValue(org.hl7.fhir.r4b.model.DiagnosticReport.DiagnosticReportStatus.CORRECTED); + break; + case APPENDED: + tgt.setValue(org.hl7.fhir.r4b.model.DiagnosticReport.DiagnosticReportStatus.APPENDED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4b.model.DiagnosticReport.DiagnosticReportStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.DiagnosticReport.DiagnosticReportStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4b.model.DiagnosticReport.DiagnosticReportStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.DiagnosticReport.DiagnosticReportStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportMediaComponent convertDiagnosticReportMediaComponent(org.hl7.fhir.r4b.model.DiagnosticReport.DiagnosticReportMediaComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DocumentReference43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DocumentReference43_50.java index 1b90af9d36..52d4daa2d7 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DocumentReference43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DocumentReference43_50.java @@ -10,8 +10,11 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.CodeableConcept; import org.hl7.fhir.r5.model.CodeableReference; import org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceAttesterComponent; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -129,53 +132,61 @@ public static org.hl7.fhir.r4b.model.DocumentReference convertDocumentReference( } static public org.hl7.fhir.r5.model.Enumeration convertReferredDocumentStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.CompositionStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.AMENDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.CompositionStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRELIMINARY: + tgt.setValue(Enumerations.CompositionStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(Enumerations.CompositionStatus.FINAL); + break; + case AMENDED: + tgt.setValue(Enumerations.CompositionStatus.AMENDED); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.CompositionStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Enumerations.CompositionStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertReferredDocumentStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.CompositionStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompositionStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompositionStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompositionStatus.AMENDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompositionStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompositionStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.CompositionStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRELIMINARY: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompositionStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompositionStatus.FINAL); + break; + case AMENDED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompositionStatus.AMENDED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompositionStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompositionStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceRelatesToComponent convertDocumentReferenceRelatesToComponent(org.hl7.fhir.r4b.model.DocumentReference.DocumentReferenceRelatesToComponent src) throws FHIRException { @@ -203,27 +214,31 @@ public static org.hl7.fhir.r4b.model.DocumentReference.DocumentReferenceRelatesT } static public org.hl7.fhir.r5.model.CodeableConcept convertDocumentRelationshipType(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.CodeableConcept tgt = new org.hl7.fhir.r5.model.CodeableConcept(); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case REPLACES: - tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("replaces"); - break; - case TRANSFORMS: - tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("transforms"); - break; - case SIGNS: - tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("signs"); - break; - case APPENDS: - tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("appends"); - break; - default: - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + CodeableConcept tgt = new CodeableConcept(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + // Add nothing + } else { + switch (src.getValue()) { + case REPLACES: + tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("replaces"); + break; + case TRANSFORMS: + tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("transforms"); + break; + case SIGNS: + tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("signs"); + break; + case APPENDS: + tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("appends"); + break; + default: + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertDocumentRelationshipType(org.hl7.fhir.r5.model.CodeableConcept src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Encounter43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Encounter43_50.java index b49c9fff05..1b3d1b94d0 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Encounter43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Encounter43_50.java @@ -8,8 +8,11 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Period43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4b.model.Encounter; import org.hl7.fhir.r5.model.CodeableReference; import org.hl7.fhir.r5.model.Encounter.ReasonComponent; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -151,74 +154,82 @@ public static org.hl7.fhir.r4b.model.Encounter convertEncounter(org.hl7.fhir.r5. } static public org.hl7.fhir.r5.model.Enumeration convertEncounterStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.EncounterStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EncounterStatus.PLANNED); - break; - case ARRIVED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EncounterStatus.INPROGRESS); - break; - case TRIAGED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EncounterStatus.INPROGRESS); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EncounterStatus.INPROGRESS); - break; - case ONLEAVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EncounterStatus.INPROGRESS); - break; - case FINISHED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EncounterStatus.COMPLETED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EncounterStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EncounterStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EncounterStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EncounterStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.EncounterStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(Enumerations.EncounterStatus.PLANNED); + break; + case ARRIVED: + tgt.setValue(Enumerations.EncounterStatus.INPROGRESS); + break; + case TRIAGED: + tgt.setValue(Enumerations.EncounterStatus.INPROGRESS); + break; + case INPROGRESS: + tgt.setValue(Enumerations.EncounterStatus.INPROGRESS); + break; + case ONLEAVE: + tgt.setValue(Enumerations.EncounterStatus.INPROGRESS); + break; + case FINISHED: + tgt.setValue(Enumerations.EncounterStatus.COMPLETED); + break; + case CANCELLED: + tgt.setValue(Enumerations.EncounterStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.EncounterStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Enumerations.EncounterStatus.UNKNOWN); + break; + default: + tgt.setValue(Enumerations.EncounterStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertEncounterStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Encounter.EncounterStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.r4b.model.Encounter.EncounterStatus.PLANNED); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r4b.model.Encounter.EncounterStatus.INPROGRESS); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4b.model.Encounter.EncounterStatus.CANCELLED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4b.model.Encounter.EncounterStatus.FINISHED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.Encounter.EncounterStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4b.model.Encounter.EncounterStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Encounter.EncounterStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new Encounter.EncounterStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(Encounter.EncounterStatus.PLANNED); + break; + case INPROGRESS: + tgt.setValue(Encounter.EncounterStatus.INPROGRESS); + break; + case CANCELLED: + tgt.setValue(Encounter.EncounterStatus.CANCELLED); + break; + case COMPLETED: + tgt.setValue(Encounter.EncounterStatus.FINISHED); + break; + case ENTEREDINERROR: + tgt.setValue(Encounter.EncounterStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Encounter.EncounterStatus.UNKNOWN); + break; + default: + tgt.setValue(Encounter.EncounterStatus.NULL); + break; + } + } + return tgt; } // // public static org.hl7.fhir.r5.model.Encounter.StatusHistoryComponent convertStatusHistoryComponent(org.hl7.fhir.r4b.model.Encounter.StatusHistoryComponent src) throws FHIRException { @@ -410,52 +421,60 @@ public static org.hl7.fhir.r4b.model.Encounter.EncounterLocationComponent conver } static public org.hl7.fhir.r5.model.Enumeration convertEncounterLocationStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Encounter.EncounterLocationStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.PLANNED); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.ACTIVE); - break; - case RESERVED: - tgt.setValue(org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.RESERVED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.COMPLETED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new org.hl7.fhir.r5.model.Encounter.EncounterLocationStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.PLANNED); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.ACTIVE); + break; + case RESERVED: + tgt.setValue(org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.RESERVED); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.COMPLETED); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertEncounterLocationStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Encounter.EncounterLocationStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.r4b.model.Encounter.EncounterLocationStatus.PLANNED); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.Encounter.EncounterLocationStatus.ACTIVE); - break; - case RESERVED: - tgt.setValue(org.hl7.fhir.r4b.model.Encounter.EncounterLocationStatus.RESERVED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4b.model.Encounter.EncounterLocationStatus.COMPLETED); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Encounter.EncounterLocationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new Encounter.EncounterLocationStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(Encounter.EncounterLocationStatus.PLANNED); + break; + case ACTIVE: + tgt.setValue(Encounter.EncounterLocationStatus.ACTIVE); + break; + case RESERVED: + tgt.setValue(Encounter.EncounterLocationStatus.RESERVED); + break; + case COMPLETED: + tgt.setValue(Encounter.EncounterLocationStatus.COMPLETED); + break; + default: + tgt.setValue(Encounter.EncounterLocationStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Endpoint43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Endpoint43_50.java index 71dbe26cb9..d93d6747b8 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Endpoint43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Endpoint43_50.java @@ -11,7 +11,9 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Url43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Endpoint; import org.hl7.fhir.r5.model.Endpoint.EndpointPayloadComponent; +import org.hl7.fhir.r5.model.Enumeration; /* Copyright (c) 2011+, HL7, Inc. @@ -105,58 +107,66 @@ public static org.hl7.fhir.r4b.model.Endpoint convertEndpoint(org.hl7.fhir.r5.mo } static public org.hl7.fhir.r5.model.Enumeration convertEndpointStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Endpoint.EndpointStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Endpoint.EndpointStatus.ACTIVE); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.r5.model.Endpoint.EndpointStatus.SUSPENDED); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.r5.model.Endpoint.EndpointStatus.ERROR); - break; - case OFF: - tgt.setValue(org.hl7.fhir.r5.model.Endpoint.EndpointStatus.OFF); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Endpoint.EndpointStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Endpoint.EndpointStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Endpoint.EndpointStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Endpoint.EndpointStatus.ACTIVE); + break; + case SUSPENDED: + tgt.setValue(Endpoint.EndpointStatus.SUSPENDED); + break; + case ERROR: + tgt.setValue(Endpoint.EndpointStatus.ERROR); + break; + case OFF: + tgt.setValue(Endpoint.EndpointStatus.OFF); + break; + case ENTEREDINERROR: + tgt.setValue(Endpoint.EndpointStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Endpoint.EndpointStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertEndpointStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Endpoint.EndpointStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.Endpoint.EndpointStatus.ACTIVE); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.r4b.model.Endpoint.EndpointStatus.SUSPENDED); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.r4b.model.Endpoint.EndpointStatus.ERROR); - break; - case OFF: - tgt.setValue(org.hl7.fhir.r4b.model.Endpoint.EndpointStatus.OFF); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.Endpoint.EndpointStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Endpoint.EndpointStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Endpoint.EndpointStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4b.model.Endpoint.EndpointStatus.ACTIVE); + break; + case SUSPENDED: + tgt.setValue(org.hl7.fhir.r4b.model.Endpoint.EndpointStatus.SUSPENDED); + break; + case ERROR: + tgt.setValue(org.hl7.fhir.r4b.model.Endpoint.EndpointStatus.ERROR); + break; + case OFF: + tgt.setValue(org.hl7.fhir.r4b.model.Endpoint.EndpointStatus.OFF); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.Endpoint.EndpointStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Endpoint.EndpointStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/EnrollmentRequest43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/EnrollmentRequest43_50.java index 1bb30ccba3..9bae3730c5 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/EnrollmentRequest43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/EnrollmentRequest43_50.java @@ -5,6 +5,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.DateTime43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -82,52 +84,60 @@ public static org.hl7.fhir.r4b.model.EnrollmentRequest convertEnrollmentRequest( } static public org.hl7.fhir.r5.model.Enumeration convertEnrollmentRequestStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodesEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.CANCELLED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.FinancialResourceStatusCodesEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.ACTIVE); + break; + case CANCELLED: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.CANCELLED); + break; + case DRAFT: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); + break; + default: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertEnrollmentRequestStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodesEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.CANCELLED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodesEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.ACTIVE); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.CANCELLED); + break; + case DRAFT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Enumerations43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Enumerations43_50.java index ad4bc7f2cc..6771c716ee 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Enumerations43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Enumerations43_50.java @@ -3,6 +3,10 @@ import org.hl7.fhir.convertors.context.ConversionContext43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Extension43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.DocumentReference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; +import org.hl7.fhir.r5.model.PaymentReconciliation; /* Copyright (c) 2011+, HL7, Inc. @@ -50,497 +54,553 @@ public static void copyEnumeration(org.hl7.fhir.r5.model.Enumeration src, org } static public org.hl7.fhir.r5.model.Enumeration convertBindingStrength(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.BindingStrengthEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case REQUIRED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.BindingStrength.REQUIRED); - break; - case EXTENSIBLE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.BindingStrength.EXTENSIBLE); - break; - case PREFERRED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.BindingStrength.PREFERRED); - break; - case EXAMPLE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.BindingStrength.EXAMPLE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.BindingStrength.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.BindingStrengthEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REQUIRED: + tgt.setValue(Enumerations.BindingStrength.REQUIRED); + break; + case EXTENSIBLE: + tgt.setValue(Enumerations.BindingStrength.EXTENSIBLE); + break; + case PREFERRED: + tgt.setValue(Enumerations.BindingStrength.PREFERRED); + break; + case EXAMPLE: + tgt.setValue(Enumerations.BindingStrength.EXAMPLE); + break; + default: + tgt.setValue(Enumerations.BindingStrength.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertBindingStrength(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.BindingStrengthEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case REQUIRED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.BindingStrength.REQUIRED); - break; - case EXTENSIBLE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.BindingStrength.EXTENSIBLE); - break; - case PREFERRED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.BindingStrength.PREFERRED); - break; - case EXAMPLE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.BindingStrength.EXAMPLE); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.BindingStrength.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.BindingStrengthEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REQUIRED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.BindingStrength.REQUIRED); + break; + case EXTENSIBLE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.BindingStrength.EXTENSIBLE); + break; + case PREFERRED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.BindingStrength.PREFERRED); + break; + case EXAMPLE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.BindingStrength.EXAMPLE); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.BindingStrength.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertPublicationStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.PublicationStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.ACTIVE); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.RETIRED); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.PublicationStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(Enumerations.PublicationStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(Enumerations.PublicationStatus.ACTIVE); + break; + case RETIRED: + tgt.setValue(Enumerations.PublicationStatus.RETIRED); + break; + case UNKNOWN: + tgt.setValue(Enumerations.PublicationStatus.UNKNOWN); + break; + default: + tgt.setValue(Enumerations.PublicationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertPublicationStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.PublicationStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.PublicationStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.PublicationStatus.ACTIVE); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.PublicationStatus.RETIRED); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.PublicationStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.PublicationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.PublicationStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.PublicationStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.PublicationStatus.ACTIVE); + break; + case RETIRED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.PublicationStatus.RETIRED); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.PublicationStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.PublicationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertFHIRVersion(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.FHIRVersionEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case _0_01: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_01); - break; - case _0_05: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_05); - break; - case _0_06: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_06); - break; - case _0_11: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_11); - break; - case _0_0_80: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_0_80); - break; - case _0_0_81: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_0_81); - break; - case _0_0_82: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_0_82); - break; - case _0_4_0: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_4_0); - break; - case _0_5_0: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_5_0); - break; - case _1_0_0: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_0_0); - break; - case _1_0_1: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_0_1); - break; - case _1_0_2: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_0_2); - break; - case _1_1_0: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_1_0); - break; - case _1_4_0: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_4_0); - break; - case _1_6_0: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_6_0); - break; - case _1_8_0: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_8_0); - break; - case _3_0_0: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._3_0_0); - break; - case _3_0_1: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._3_0_1); - break; - case _3_0_2: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._3_0_2); - break; - case _3_3_0: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._3_3_0); - break; - case _3_5_0: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._3_5_0); - break; - case _4_0_0: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._4_0_0); - break; - case _4_0_1: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._4_0_1); - break; - case _4_1_0: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._4_1_0); - break; - case _4_3_0: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._4_3_0); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.FHIRVersionEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case _0_01: + tgt.setValue(Enumerations.FHIRVersion._0_01); + break; + case _0_05: + tgt.setValue(Enumerations.FHIRVersion._0_05); + break; + case _0_06: + tgt.setValue(Enumerations.FHIRVersion._0_06); + break; + case _0_11: + tgt.setValue(Enumerations.FHIRVersion._0_11); + break; + case _0_0_80: + tgt.setValue(Enumerations.FHIRVersion._0_0_80); + break; + case _0_0_81: + tgt.setValue(Enumerations.FHIRVersion._0_0_81); + break; + case _0_0_82: + tgt.setValue(Enumerations.FHIRVersion._0_0_82); + break; + case _0_4_0: + tgt.setValue(Enumerations.FHIRVersion._0_4_0); + break; + case _0_5_0: + tgt.setValue(Enumerations.FHIRVersion._0_5_0); + break; + case _1_0_0: + tgt.setValue(Enumerations.FHIRVersion._1_0_0); + break; + case _1_0_1: + tgt.setValue(Enumerations.FHIRVersion._1_0_1); + break; + case _1_0_2: + tgt.setValue(Enumerations.FHIRVersion._1_0_2); + break; + case _1_1_0: + tgt.setValue(Enumerations.FHIRVersion._1_1_0); + break; + case _1_4_0: + tgt.setValue(Enumerations.FHIRVersion._1_4_0); + break; + case _1_6_0: + tgt.setValue(Enumerations.FHIRVersion._1_6_0); + break; + case _1_8_0: + tgt.setValue(Enumerations.FHIRVersion._1_8_0); + break; + case _3_0_0: + tgt.setValue(Enumerations.FHIRVersion._3_0_0); + break; + case _3_0_1: + tgt.setValue(Enumerations.FHIRVersion._3_0_1); + break; + case _3_0_2: + tgt.setValue(Enumerations.FHIRVersion._3_0_2); + break; + case _3_3_0: + tgt.setValue(Enumerations.FHIRVersion._3_3_0); + break; + case _3_5_0: + tgt.setValue(Enumerations.FHIRVersion._3_5_0); + break; + case _4_0_0: + tgt.setValue(Enumerations.FHIRVersion._4_0_0); + break; + case _4_0_1: + tgt.setValue(Enumerations.FHIRVersion._4_0_1); + break; + case _4_1_0: + tgt.setValue(Enumerations.FHIRVersion._4_1_0); + break; + case _4_3_0: + tgt.setValue(Enumerations.FHIRVersion._4_3_0); + break; + default: + tgt.setValue(Enumerations.FHIRVersion.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertFHIRVersion(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.FHIRVersionEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case _0_01: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._0_01); - break; - case _0_05: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._0_05); - break; - case _0_06: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._0_06); - break; - case _0_11: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._0_11); - break; - case _0_0_80: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._0_0_80); - break; - case _0_0_81: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._0_0_81); - break; - case _0_0_82: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._0_0_82); - break; - case _0_4_0: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._0_4_0); - break; - case _0_5_0: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._0_5_0); - break; - case _1_0_0: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._1_0_0); - break; - case _1_0_1: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._1_0_1); - break; - case _1_0_2: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._1_0_2); - break; - case _1_1_0: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._1_1_0); - break; - case _1_4_0: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._1_4_0); - break; - case _1_6_0: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._1_6_0); - break; - case _1_8_0: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._1_8_0); - break; - case _3_0_0: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._3_0_0); - break; - case _3_0_1: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._3_0_1); - break; - case _3_0_2: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._3_0_2); - break; - case _3_3_0: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._3_3_0); - break; - case _3_5_0: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._3_5_0); - break; - case _4_0_0: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._4_0_0); - break; - case _4_0_1: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._4_0_1); - break; - case _4_1_0: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._4_1_0); - break; - case _4_3_0: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._4_3_0); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.FHIRVersionEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case _0_01: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._0_01); + break; + case _0_05: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._0_05); + break; + case _0_06: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._0_06); + break; + case _0_11: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._0_11); + break; + case _0_0_80: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._0_0_80); + break; + case _0_0_81: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._0_0_81); + break; + case _0_0_82: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._0_0_82); + break; + case _0_4_0: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._0_4_0); + break; + case _0_5_0: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._0_5_0); + break; + case _1_0_0: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._1_0_0); + break; + case _1_0_1: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._1_0_1); + break; + case _1_0_2: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._1_0_2); + break; + case _1_1_0: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._1_1_0); + break; + case _1_4_0: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._1_4_0); + break; + case _1_6_0: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._1_6_0); + break; + case _1_8_0: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._1_8_0); + break; + case _3_0_0: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._3_0_0); + break; + case _3_0_1: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._3_0_1); + break; + case _3_0_2: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._3_0_2); + break; + case _3_3_0: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._3_3_0); + break; + case _3_5_0: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._3_5_0); + break; + case _4_0_0: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._4_0_0); + break; + case _4_0_1: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._4_0_1); + break; + case _4_1_0: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._4_1_0); + break; + case _4_3_0: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._4_3_0); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertSearchParamType(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.SearchParamTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case NUMBER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.NUMBER); - break; - case DATE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.DATE); - break; - case STRING: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.STRING); - break; - case TOKEN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.TOKEN); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.REFERENCE); - break; - case COMPOSITE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.COMPOSITE); - break; - case QUANTITY: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.QUANTITY); - break; - case URI: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.URI); - break; - case SPECIAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.SPECIAL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.SearchParamTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NUMBER: + tgt.setValue(Enumerations.SearchParamType.NUMBER); + break; + case DATE: + tgt.setValue(Enumerations.SearchParamType.DATE); + break; + case STRING: + tgt.setValue(Enumerations.SearchParamType.STRING); + break; + case TOKEN: + tgt.setValue(Enumerations.SearchParamType.TOKEN); + break; + case REFERENCE: + tgt.setValue(Enumerations.SearchParamType.REFERENCE); + break; + case COMPOSITE: + tgt.setValue(Enumerations.SearchParamType.COMPOSITE); + break; + case QUANTITY: + tgt.setValue(Enumerations.SearchParamType.QUANTITY); + break; + case URI: + tgt.setValue(Enumerations.SearchParamType.URI); + break; + case SPECIAL: + tgt.setValue(Enumerations.SearchParamType.SPECIAL); + break; + default: + tgt.setValue(Enumerations.SearchParamType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertSearchParamType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.SearchParamTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case NUMBER: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.SearchParamType.NUMBER); - break; - case DATE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.SearchParamType.DATE); - break; - case STRING: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.SearchParamType.STRING); - break; - case TOKEN: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.SearchParamType.TOKEN); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.SearchParamType.REFERENCE); - break; - case COMPOSITE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.SearchParamType.COMPOSITE); - break; - case QUANTITY: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.SearchParamType.QUANTITY); - break; - case URI: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.SearchParamType.URI); - break; - case SPECIAL: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.SearchParamType.SPECIAL); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.SearchParamType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.SearchParamTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NUMBER: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.SearchParamType.NUMBER); + break; + case DATE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.SearchParamType.DATE); + break; + case STRING: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.SearchParamType.STRING); + break; + case TOKEN: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.SearchParamType.TOKEN); + break; + case REFERENCE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.SearchParamType.REFERENCE); + break; + case COMPOSITE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.SearchParamType.COMPOSITE); + break; + case QUANTITY: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.SearchParamType.QUANTITY); + break; + case URI: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.SearchParamType.URI); + break; + case SPECIAL: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.SearchParamType.SPECIAL); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.SearchParamType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertNoteType(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.PaymentReconciliation.NoteTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case DISPLAY: - tgt.setValue(org.hl7.fhir.r5.model.PaymentReconciliation.NoteType.DISPLAY); - break; - case PRINT: - tgt.setValue(org.hl7.fhir.r5.model.PaymentReconciliation.NoteType.PRINT); - break; - case PRINTOPER: - tgt.setValue(org.hl7.fhir.r5.model.PaymentReconciliation.NoteType.PRINTOPER); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.PaymentReconciliation.NoteType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new PaymentReconciliation.NoteTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DISPLAY: + tgt.setValue(PaymentReconciliation.NoteType.DISPLAY); + break; + case PRINT: + tgt.setValue(PaymentReconciliation.NoteType.PRINT); + break; + case PRINTOPER: + tgt.setValue(PaymentReconciliation.NoteType.PRINTOPER); + break; + default: + tgt.setValue(PaymentReconciliation.NoteType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertNoteType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.NoteTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case DISPLAY: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.NoteType.DISPLAY); - break; - case PRINT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.NoteType.PRINT); - break; - case PRINTOPER: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.NoteType.PRINTOPER); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.NoteType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.NoteTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DISPLAY: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.NoteType.DISPLAY); + break; + case PRINT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.NoteType.PRINT); + break; + case PRINTOPER: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.NoteType.PRINTOPER); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.NoteType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertDocumentReferenceStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case CURRENT: - tgt.setValue(org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceStatus.CURRENT); - break; - case SUPERSEDED: - tgt.setValue(org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceStatus.SUPERSEDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new DocumentReference.DocumentReferenceStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CURRENT: + tgt.setValue(DocumentReference.DocumentReferenceStatus.CURRENT); + break; + case SUPERSEDED: + tgt.setValue(DocumentReference.DocumentReferenceStatus.SUPERSEDED); + break; + case ENTEREDINERROR: + tgt.setValue(DocumentReference.DocumentReferenceStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(DocumentReference.DocumentReferenceStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertDocumentReferenceStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.DocumentReferenceStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case CURRENT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DocumentReferenceStatus.CURRENT); - break; - case SUPERSEDED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DocumentReferenceStatus.SUPERSEDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DocumentReferenceStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DocumentReferenceStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.DocumentReferenceStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CURRENT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DocumentReferenceStatus.CURRENT); + break; + case SUPERSEDED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DocumentReferenceStatus.SUPERSEDED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DocumentReferenceStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DocumentReferenceStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertAdministrativeGender(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.AdministrativeGenderEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case MALE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.MALE); - break; - case FEMALE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.FEMALE); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.OTHER); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.AdministrativeGenderEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MALE: + tgt.setValue(Enumerations.AdministrativeGender.MALE); + break; + case FEMALE: + tgt.setValue(Enumerations.AdministrativeGender.FEMALE); + break; + case OTHER: + tgt.setValue(Enumerations.AdministrativeGender.OTHER); + break; + case UNKNOWN: + tgt.setValue(Enumerations.AdministrativeGender.UNKNOWN); + break; + default: + tgt.setValue(Enumerations.AdministrativeGender.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertAdministrativeGender(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.AdministrativeGenderEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case MALE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.AdministrativeGender.MALE); - break; - case FEMALE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.AdministrativeGender.FEMALE); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.AdministrativeGender.OTHER); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.AdministrativeGender.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.AdministrativeGender.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.AdministrativeGenderEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MALE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.AdministrativeGender.MALE); + break; + case FEMALE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.AdministrativeGender.FEMALE); + break; + case OTHER: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.AdministrativeGender.OTHER); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.AdministrativeGender.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.AdministrativeGender.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/EpisodeOfCare43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/EpisodeOfCare43_50.java index 73b19ae8d9..798aaf033c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/EpisodeOfCare43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/EpisodeOfCare43_50.java @@ -6,6 +6,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Period43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.EpisodeOfCare; /* Copyright (c) 2011+, HL7, Inc. @@ -99,71 +101,79 @@ public static org.hl7.fhir.r4b.model.EpisodeOfCare convertEpisodeOfCare(org.hl7. } static public org.hl7.fhir.r5.model.Enumeration convertEpisodeOfCareStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.PLANNED); - break; - case WAITLIST: - tgt.setValue(org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.WAITLIST); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.ONHOLD); - break; - case FINISHED: - tgt.setValue(org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.FINISHED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new EpisodeOfCare.EpisodeOfCareStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.PLANNED); + break; + case WAITLIST: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.WAITLIST); + break; + case ACTIVE: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.ONHOLD); + break; + case FINISHED: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.FINISHED); + break; + case CANCELLED: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(EpisodeOfCare.EpisodeOfCareStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertEpisodeOfCareStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.EpisodeOfCare.EpisodeOfCareStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PLANNED: - tgt.setValue(org.hl7.fhir.r4b.model.EpisodeOfCare.EpisodeOfCareStatus.PLANNED); - break; - case WAITLIST: - tgt.setValue(org.hl7.fhir.r4b.model.EpisodeOfCare.EpisodeOfCareStatus.WAITLIST); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.EpisodeOfCare.EpisodeOfCareStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r4b.model.EpisodeOfCare.EpisodeOfCareStatus.ONHOLD); - break; - case FINISHED: - tgt.setValue(org.hl7.fhir.r4b.model.EpisodeOfCare.EpisodeOfCareStatus.FINISHED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4b.model.EpisodeOfCare.EpisodeOfCareStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.EpisodeOfCare.EpisodeOfCareStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.EpisodeOfCare.EpisodeOfCareStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.EpisodeOfCare.EpisodeOfCareStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PLANNED: + tgt.setValue(org.hl7.fhir.r4b.model.EpisodeOfCare.EpisodeOfCareStatus.PLANNED); + break; + case WAITLIST: + tgt.setValue(org.hl7.fhir.r4b.model.EpisodeOfCare.EpisodeOfCareStatus.WAITLIST); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4b.model.EpisodeOfCare.EpisodeOfCareStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.r4b.model.EpisodeOfCare.EpisodeOfCareStatus.ONHOLD); + break; + case FINISHED: + tgt.setValue(org.hl7.fhir.r4b.model.EpisodeOfCare.EpisodeOfCareStatus.FINISHED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4b.model.EpisodeOfCare.EpisodeOfCareStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.EpisodeOfCare.EpisodeOfCareStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.EpisodeOfCare.EpisodeOfCareStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent convertEpisodeOfCareStatusHistoryComponent(org.hl7.fhir.r4b.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ExampleScenario43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ExampleScenario43_50.java index 3c4e7ed869..f785daeff9 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ExampleScenario43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ExampleScenario43_50.java @@ -11,6 +11,9 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4b.model.ExampleScenario; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -160,41 +163,49 @@ public static org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioActorCompone } static public org.hl7.fhir.r5.model.Enumeration convertExampleScenarioActorType(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ExampleScenarioActorTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PERSON: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ExampleScenarioActorType.PERSON); - break; - case ENTITY: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ExampleScenarioActorType.SYSTEM); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ExampleScenarioActorType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ExampleScenarioActorTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PERSON: + tgt.setValue(Enumerations.ExampleScenarioActorType.PERSON); + break; + case ENTITY: + tgt.setValue(Enumerations.ExampleScenarioActorType.SYSTEM); + break; + default: + tgt.setValue(Enumerations.ExampleScenarioActorType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertExampleScenarioActorType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioActorTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PERSON: - tgt.setValue(org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioActorType.PERSON); - break; - case SYSTEM: - tgt.setValue(org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioActorType.ENTITY); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioActorType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new ExampleScenario.ExampleScenarioActorTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PERSON: + tgt.setValue(ExampleScenario.ExampleScenarioActorType.PERSON); + break; + case SYSTEM: + tgt.setValue(ExampleScenario.ExampleScenarioActorType.ENTITY); + break; + default: + tgt.setValue(ExampleScenario.ExampleScenarioActorType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceComponent convertExampleScenarioInstanceComponent(org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioInstanceComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ExplanationOfBenefit43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ExplanationOfBenefit43_50.java index 6ba19204fa..8dcef2803e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ExplanationOfBenefit43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ExplanationOfBenefit43_50.java @@ -16,6 +16,9 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; +import org.hl7.fhir.r5.model.ExplanationOfBenefit; /* Copyright (c) 2011+, HL7, Inc. @@ -237,147 +240,171 @@ public static org.hl7.fhir.r4b.model.ExplanationOfBenefit convertExplanationOfBe } static public org.hl7.fhir.r5.model.Enumeration convertExplanationOfBenefitStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ExplanationOfBenefit.ExplanationOfBenefitStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.CANCELLED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ExplanationOfBenefit.ExplanationOfBenefitStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(ExplanationOfBenefit.ExplanationOfBenefitStatus.ACTIVE); + break; + case CANCELLED: + tgt.setValue(ExplanationOfBenefit.ExplanationOfBenefitStatus.CANCELLED); + break; + case DRAFT: + tgt.setValue(ExplanationOfBenefit.ExplanationOfBenefitStatus.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(ExplanationOfBenefit.ExplanationOfBenefitStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(ExplanationOfBenefit.ExplanationOfBenefitStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertExplanationOfBenefitStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.ExplanationOfBenefit.ExplanationOfBenefitStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4b.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.CANCELLED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r4b.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.ExplanationOfBenefit.ExplanationOfBenefitStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4b.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.ACTIVE); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4b.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.CANCELLED); + break; + case DRAFT: + tgt.setValue(org.hl7.fhir.r4b.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.ExplanationOfBenefit.ExplanationOfBenefitStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertUse(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.UseEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case CLAIM: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.Use.CLAIM); - break; - case PREAUTHORIZATION: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.Use.PREAUTHORIZATION); - break; - case PREDETERMINATION: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.Use.PREDETERMINATION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.Use.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.UseEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CLAIM: + tgt.setValue(Enumerations.Use.CLAIM); + break; + case PREAUTHORIZATION: + tgt.setValue(Enumerations.Use.PREAUTHORIZATION); + break; + case PREDETERMINATION: + tgt.setValue(Enumerations.Use.PREDETERMINATION); + break; + default: + tgt.setValue(Enumerations.Use.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertUse(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.UseEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case CLAIM: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.Use.CLAIM); - break; - case PREAUTHORIZATION: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.Use.PREAUTHORIZATION); - break; - case PREDETERMINATION: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.Use.PREDETERMINATION); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.Use.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.UseEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CLAIM: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.Use.CLAIM); + break; + case PREAUTHORIZATION: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.Use.PREAUTHORIZATION); + break; + case PREDETERMINATION: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.Use.PREDETERMINATION); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.Use.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertRemittanceOutcome(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodesEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case QUEUED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.QUEUED); - break; - case COMPLETE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.COMPLETE); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.ERROR); - break; - case PARTIAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.PARTIAL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ClaimProcessingCodesEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case QUEUED: + tgt.setValue(Enumerations.ClaimProcessingCodes.QUEUED); + break; + case COMPLETE: + tgt.setValue(Enumerations.ClaimProcessingCodes.COMPLETE); + break; + case ERROR: + tgt.setValue(Enumerations.ClaimProcessingCodes.ERROR); + break; + case PARTIAL: + tgt.setValue(Enumerations.ClaimProcessingCodes.PARTIAL); + break; + default: + tgt.setValue(Enumerations.ClaimProcessingCodes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertRemittanceOutcome(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcomeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case QUEUED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcome.QUEUED); - break; - case COMPLETE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcome.COMPLETE); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcome.ERROR); - break; - case PARTIAL: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcome.PARTIAL); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcome.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcomeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case QUEUED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcome.QUEUED); + break; + case COMPLETE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcome.COMPLETE); + break; + case ERROR: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcome.ERROR); + break; + case PARTIAL: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcome.PARTIAL); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcome.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.ExplanationOfBenefit.RelatedClaimComponent convertRelatedClaimComponent(org.hl7.fhir.r4b.model.ExplanationOfBenefit.RelatedClaimComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/FamilyMemberHistory43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/FamilyMemberHistory43_50.java index 7cbf49e208..93f6d3d535 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/FamilyMemberHistory43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/FamilyMemberHistory43_50.java @@ -12,6 +12,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.FamilyMemberHistory; /* Copyright (c) 2011+, HL7, Inc. @@ -133,53 +135,61 @@ public static org.hl7.fhir.r4b.model.FamilyMemberHistory convertFamilyMemberHist } static public org.hl7.fhir.r5.model.Enumeration convertFamilyHistoryStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PARTIAL: - tgt.setValue(org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus.PARTIAL); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus.ENTEREDINERROR); - break; - case HEALTHUNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus.HEALTHUNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new FamilyMemberHistory.FamilyHistoryStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PARTIAL: + tgt.setValue(FamilyMemberHistory.FamilyHistoryStatus.PARTIAL); + break; + case COMPLETED: + tgt.setValue(FamilyMemberHistory.FamilyHistoryStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(FamilyMemberHistory.FamilyHistoryStatus.ENTEREDINERROR); + break; + case HEALTHUNKNOWN: + tgt.setValue(FamilyMemberHistory.FamilyHistoryStatus.HEALTHUNKNOWN); + break; + default: + tgt.setValue(FamilyMemberHistory.FamilyHistoryStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertFamilyHistoryStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.FamilyMemberHistory.FamilyHistoryStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PARTIAL: - tgt.setValue(org.hl7.fhir.r4b.model.FamilyMemberHistory.FamilyHistoryStatus.PARTIAL); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4b.model.FamilyMemberHistory.FamilyHistoryStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.FamilyMemberHistory.FamilyHistoryStatus.ENTEREDINERROR); - break; - case HEALTHUNKNOWN: - tgt.setValue(org.hl7.fhir.r4b.model.FamilyMemberHistory.FamilyHistoryStatus.HEALTHUNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.FamilyMemberHistory.FamilyHistoryStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.FamilyMemberHistory.FamilyHistoryStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PARTIAL: + tgt.setValue(org.hl7.fhir.r4b.model.FamilyMemberHistory.FamilyHistoryStatus.PARTIAL); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4b.model.FamilyMemberHistory.FamilyHistoryStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.FamilyMemberHistory.FamilyHistoryStatus.ENTEREDINERROR); + break; + case HEALTHUNKNOWN: + tgt.setValue(org.hl7.fhir.r4b.model.FamilyMemberHistory.FamilyHistoryStatus.HEALTHUNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.FamilyMemberHistory.FamilyHistoryStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent convertFamilyMemberHistoryConditionComponent(org.hl7.fhir.r4b.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Flag43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Flag43_50.java index b305d0a545..a5a7d192ec 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Flag43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Flag43_50.java @@ -6,6 +6,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Period43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Flag; /* Copyright (c) 2011+, HL7, Inc. @@ -87,46 +89,54 @@ public static org.hl7.fhir.r4b.model.Flag convertFlag(org.hl7.fhir.r5.model.Flag } static public org.hl7.fhir.r5.model.Enumeration convertFlagStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Flag.FlagStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Flag.FlagStatus.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Flag.FlagStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Flag.FlagStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Flag.FlagStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Flag.FlagStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Flag.FlagStatus.ACTIVE); + break; + case INACTIVE: + tgt.setValue(Flag.FlagStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(Flag.FlagStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Flag.FlagStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertFlagStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Flag.FlagStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.Flag.FlagStatus.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.Flag.FlagStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.Flag.FlagStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Flag.FlagStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Flag.FlagStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4b.model.Flag.FlagStatus.ACTIVE); + break; + case INACTIVE: + tgt.setValue(org.hl7.fhir.r4b.model.Flag.FlagStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.Flag.FlagStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Flag.FlagStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Goal43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Goal43_50.java index ace148edc0..513720de65 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Goal43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Goal43_50.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Goal; /* Copyright (c) 2011+, HL7, Inc. @@ -116,83 +118,91 @@ public static org.hl7.fhir.r4b.model.Goal convertGoal(org.hl7.fhir.r5.model.Goal } static public org.hl7.fhir.r5.model.Enumeration convertGoalLifecycleStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Goal.GoalLifecycleStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSED: - tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.PROPOSED); - break; - case PLANNED: - tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.PLANNED); - break; - case ACCEPTED: - tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.ACCEPTED); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.ONHOLD); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.COMPLETED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.ENTEREDINERROR); - break; - case REJECTED: - tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.REJECTED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Goal.GoalLifecycleStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSED: + tgt.setValue(Goal.GoalLifecycleStatus.PROPOSED); + break; + case PLANNED: + tgt.setValue(Goal.GoalLifecycleStatus.PLANNED); + break; + case ACCEPTED: + tgt.setValue(Goal.GoalLifecycleStatus.ACCEPTED); + break; + case ACTIVE: + tgt.setValue(Goal.GoalLifecycleStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(Goal.GoalLifecycleStatus.ONHOLD); + break; + case COMPLETED: + tgt.setValue(Goal.GoalLifecycleStatus.COMPLETED); + break; + case CANCELLED: + tgt.setValue(Goal.GoalLifecycleStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(Goal.GoalLifecycleStatus.ENTEREDINERROR); + break; + case REJECTED: + tgt.setValue(Goal.GoalLifecycleStatus.REJECTED); + break; + default: + tgt.setValue(Goal.GoalLifecycleStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertGoalLifecycleStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Goal.GoalLifecycleStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSED: - tgt.setValue(org.hl7.fhir.r4b.model.Goal.GoalLifecycleStatus.PROPOSED); - break; - case PLANNED: - tgt.setValue(org.hl7.fhir.r4b.model.Goal.GoalLifecycleStatus.PLANNED); - break; - case ACCEPTED: - tgt.setValue(org.hl7.fhir.r4b.model.Goal.GoalLifecycleStatus.ACCEPTED); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.Goal.GoalLifecycleStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r4b.model.Goal.GoalLifecycleStatus.ONHOLD); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4b.model.Goal.GoalLifecycleStatus.COMPLETED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4b.model.Goal.GoalLifecycleStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.Goal.GoalLifecycleStatus.ENTEREDINERROR); - break; - case REJECTED: - tgt.setValue(org.hl7.fhir.r4b.model.Goal.GoalLifecycleStatus.REJECTED); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Goal.GoalLifecycleStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Goal.GoalLifecycleStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSED: + tgt.setValue(org.hl7.fhir.r4b.model.Goal.GoalLifecycleStatus.PROPOSED); + break; + case PLANNED: + tgt.setValue(org.hl7.fhir.r4b.model.Goal.GoalLifecycleStatus.PLANNED); + break; + case ACCEPTED: + tgt.setValue(org.hl7.fhir.r4b.model.Goal.GoalLifecycleStatus.ACCEPTED); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4b.model.Goal.GoalLifecycleStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.r4b.model.Goal.GoalLifecycleStatus.ONHOLD); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4b.model.Goal.GoalLifecycleStatus.COMPLETED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4b.model.Goal.GoalLifecycleStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.Goal.GoalLifecycleStatus.ENTEREDINERROR); + break; + case REJECTED: + tgt.setValue(org.hl7.fhir.r4b.model.Goal.GoalLifecycleStatus.REJECTED); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Goal.GoalLifecycleStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Goal.GoalTargetComponent convertGoalTargetComponent(org.hl7.fhir.r4b.model.Goal.GoalTargetComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Group43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Group43_50.java index ac5484d0f8..50239d934a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Group43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Group43_50.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.UnsignedInt43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Group; import org.hl7.fhir.r5.model.Group.GroupMembershipBasis; /* @@ -99,53 +101,61 @@ public static org.hl7.fhir.r4b.model.Group convertGroup(org.hl7.fhir.r5.model.Gr } static public org.hl7.fhir.r5.model.Enumeration convertGroupType(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Group.GroupTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PERSON: - tgt.setValue(org.hl7.fhir.r5.model.Group.GroupType.PERSON); - break; - case ANIMAL: - tgt.setValue(org.hl7.fhir.r5.model.Group.GroupType.ANIMAL); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.r5.model.Group.GroupType.PRACTITIONER); - break; - case DEVICE: - tgt.setValue(org.hl7.fhir.r5.model.Group.GroupType.DEVICE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Group.GroupType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Group.GroupTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PERSON: + tgt.setValue(Group.GroupType.PERSON); + break; + case ANIMAL: + tgt.setValue(Group.GroupType.ANIMAL); + break; + case PRACTITIONER: + tgt.setValue(Group.GroupType.PRACTITIONER); + break; + case DEVICE: + tgt.setValue(Group.GroupType.DEVICE); + break; + default: + tgt.setValue(Group.GroupType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertGroupType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Group.GroupTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PERSON: - tgt.setValue(org.hl7.fhir.r4b.model.Group.GroupType.PERSON); - break; - case ANIMAL: - tgt.setValue(org.hl7.fhir.r4b.model.Group.GroupType.ANIMAL); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.r4b.model.Group.GroupType.PRACTITIONER); - break; - case DEVICE: - tgt.setValue(org.hl7.fhir.r4b.model.Group.GroupType.DEVICE); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Group.GroupType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Group.GroupTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PERSON: + tgt.setValue(org.hl7.fhir.r4b.model.Group.GroupType.PERSON); + break; + case ANIMAL: + tgt.setValue(org.hl7.fhir.r4b.model.Group.GroupType.ANIMAL); + break; + case PRACTITIONER: + tgt.setValue(org.hl7.fhir.r4b.model.Group.GroupType.PRACTITIONER); + break; + case DEVICE: + tgt.setValue(org.hl7.fhir.r4b.model.Group.GroupType.DEVICE); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Group.GroupType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Group.GroupCharacteristicComponent convertGroupCharacteristicComponent(org.hl7.fhir.r4b.model.Group.GroupCharacteristicComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/GuidanceResponse43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/GuidanceResponse43_50.java index 4396f13425..857c73c089 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/GuidanceResponse43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/GuidanceResponse43_50.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.GuidanceResponse; /* Copyright (c) 2011+, HL7, Inc. @@ -118,64 +120,72 @@ public static org.hl7.fhir.r4b.model.GuidanceResponse convertGuidanceResponse(or } static public org.hl7.fhir.r5.model.Enumeration convertGuidanceResponseStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case SUCCESS: - tgt.setValue(org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatus.SUCCESS); - break; - case DATAREQUESTED: - tgt.setValue(org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatus.DATAREQUESTED); - break; - case DATAREQUIRED: - tgt.setValue(org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatus.DATAREQUIRED); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatus.INPROGRESS); - break; - case FAILURE: - tgt.setValue(org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatus.FAILURE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new GuidanceResponse.GuidanceResponseStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SUCCESS: + tgt.setValue(GuidanceResponse.GuidanceResponseStatus.SUCCESS); + break; + case DATAREQUESTED: + tgt.setValue(GuidanceResponse.GuidanceResponseStatus.DATAREQUESTED); + break; + case DATAREQUIRED: + tgt.setValue(GuidanceResponse.GuidanceResponseStatus.DATAREQUIRED); + break; + case INPROGRESS: + tgt.setValue(GuidanceResponse.GuidanceResponseStatus.INPROGRESS); + break; + case FAILURE: + tgt.setValue(GuidanceResponse.GuidanceResponseStatus.FAILURE); + break; + case ENTEREDINERROR: + tgt.setValue(GuidanceResponse.GuidanceResponseStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(GuidanceResponse.GuidanceResponseStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertGuidanceResponseStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.GuidanceResponse.GuidanceResponseStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case SUCCESS: - tgt.setValue(org.hl7.fhir.r4b.model.GuidanceResponse.GuidanceResponseStatus.SUCCESS); - break; - case DATAREQUESTED: - tgt.setValue(org.hl7.fhir.r4b.model.GuidanceResponse.GuidanceResponseStatus.DATAREQUESTED); - break; - case DATAREQUIRED: - tgt.setValue(org.hl7.fhir.r4b.model.GuidanceResponse.GuidanceResponseStatus.DATAREQUIRED); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r4b.model.GuidanceResponse.GuidanceResponseStatus.INPROGRESS); - break; - case FAILURE: - tgt.setValue(org.hl7.fhir.r4b.model.GuidanceResponse.GuidanceResponseStatus.FAILURE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.GuidanceResponse.GuidanceResponseStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.GuidanceResponse.GuidanceResponseStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.GuidanceResponse.GuidanceResponseStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SUCCESS: + tgt.setValue(org.hl7.fhir.r4b.model.GuidanceResponse.GuidanceResponseStatus.SUCCESS); + break; + case DATAREQUESTED: + tgt.setValue(org.hl7.fhir.r4b.model.GuidanceResponse.GuidanceResponseStatus.DATAREQUESTED); + break; + case DATAREQUIRED: + tgt.setValue(org.hl7.fhir.r4b.model.GuidanceResponse.GuidanceResponseStatus.DATAREQUIRED); + break; + case INPROGRESS: + tgt.setValue(org.hl7.fhir.r4b.model.GuidanceResponse.GuidanceResponseStatus.INPROGRESS); + break; + case FAILURE: + tgt.setValue(org.hl7.fhir.r4b.model.GuidanceResponse.GuidanceResponseStatus.FAILURE); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.GuidanceResponse.GuidanceResponseStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.GuidanceResponse.GuidanceResponseStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/HealthcareService43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/HealthcareService43_50.java index 51bdd6c94b..801f696864 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/HealthcareService43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/HealthcareService43_50.java @@ -10,6 +10,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; import org.hl7.fhir.r5.model.ExtendedContactDetail; /* @@ -211,71 +213,79 @@ public static org.hl7.fhir.r4b.model.HealthcareService.HealthcareServiceEligibil // } static public org.hl7.fhir.r5.model.Enumeration convertDaysOfWeek(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.DaysOfWeekEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case MON: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.MON); - break; - case TUE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.TUE); - break; - case WED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.WED); - break; - case THU: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.THU); - break; - case FRI: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.FRI); - break; - case SAT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.SAT); - break; - case SUN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.SUN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.DaysOfWeekEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MON: + tgt.setValue(Enumerations.DaysOfWeek.MON); + break; + case TUE: + tgt.setValue(Enumerations.DaysOfWeek.TUE); + break; + case WED: + tgt.setValue(Enumerations.DaysOfWeek.WED); + break; + case THU: + tgt.setValue(Enumerations.DaysOfWeek.THU); + break; + case FRI: + tgt.setValue(Enumerations.DaysOfWeek.FRI); + break; + case SAT: + tgt.setValue(Enumerations.DaysOfWeek.SAT); + break; + case SUN: + tgt.setValue(Enumerations.DaysOfWeek.SUN); + break; + default: + tgt.setValue(Enumerations.DaysOfWeek.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertDaysOfWeek(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.DaysOfWeekEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case MON: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.MON); - break; - case TUE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.TUE); - break; - case WED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.WED); - break; - case THU: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.THU); - break; - case FRI: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.FRI); - break; - case SAT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.SAT); - break; - case SUN: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.SUN); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.DaysOfWeekEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MON: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.MON); + break; + case TUE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.TUE); + break; + case WED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.WED); + break; + case THU: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.THU); + break; + case FRI: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.FRI); + break; + case SAT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.SAT); + break; + case SUN: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.SUN); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.NULL); + break; + } + } + return tgt; } // // public static org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceNotAvailableComponent convertHealthcareServiceNotAvailableComponent(org.hl7.fhir.r4b.model.HealthcareService.HealthcareServiceNotAvailableComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ImagingStudy43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ImagingStudy43_50.java index 9a827043e3..5cec26b1d5 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ImagingStudy43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ImagingStudy43_50.java @@ -11,9 +11,7 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.UnsignedInt43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.r5.model.CodeableConcept; -import org.hl7.fhir.r5.model.CodeableReference; -import org.hl7.fhir.r5.model.Coding; +import org.hl7.fhir.r5.model.*; /* Copyright (c) 2011+, HL7, Inc. @@ -143,59 +141,67 @@ public static org.hl7.fhir.r4b.model.ImagingStudy convertImagingStudy(org.hl7.fh } static public org.hl7.fhir.r5.model.Enumeration convertImagingStudyStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyStatus.REGISTERED); - break; - case AVAILABLE: - tgt.setValue(org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyStatus.AVAILABLE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ImagingStudy.ImagingStudyStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(ImagingStudy.ImagingStudyStatus.REGISTERED); + break; + case AVAILABLE: + tgt.setValue(ImagingStudy.ImagingStudyStatus.AVAILABLE); + break; + case CANCELLED: + tgt.setValue(ImagingStudy.ImagingStudyStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(ImagingStudy.ImagingStudyStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(ImagingStudy.ImagingStudyStatus.UNKNOWN); + break; + default: + tgt.setValue(ImagingStudy.ImagingStudyStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertImagingStudyStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.ImagingStudy.ImagingStudyStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.r4b.model.ImagingStudy.ImagingStudyStatus.REGISTERED); - break; - case AVAILABLE: - tgt.setValue(org.hl7.fhir.r4b.model.ImagingStudy.ImagingStudyStatus.AVAILABLE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4b.model.ImagingStudy.ImagingStudyStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.ImagingStudy.ImagingStudyStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4b.model.ImagingStudy.ImagingStudyStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.ImagingStudy.ImagingStudyStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.ImagingStudy.ImagingStudyStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(org.hl7.fhir.r4b.model.ImagingStudy.ImagingStudyStatus.REGISTERED); + break; + case AVAILABLE: + tgt.setValue(org.hl7.fhir.r4b.model.ImagingStudy.ImagingStudyStatus.AVAILABLE); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4b.model.ImagingStudy.ImagingStudyStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.ImagingStudy.ImagingStudyStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4b.model.ImagingStudy.ImagingStudyStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.ImagingStudy.ImagingStudyStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesComponent convertImagingStudySeriesComponent(org.hl7.fhir.r4b.model.ImagingStudy.ImagingStudySeriesComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Immunization43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Immunization43_50.java index b7a745a4b6..6bc6bd4f18 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Immunization43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Immunization43_50.java @@ -12,6 +12,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Immunization; /* Copyright (c) 2011+, HL7, Inc. @@ -173,47 +175,55 @@ public static org.hl7.fhir.r4b.model.Immunization convertImmunization(org.hl7.fh } static public org.hl7.fhir.r5.model.Enumeration convertImmunizationStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Immunization.ImmunizationStatusCodesEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.Immunization.ImmunizationStatusCodes.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Immunization.ImmunizationStatusCodes.ENTEREDINERROR); - break; - case NOTDONE: - tgt.setValue(org.hl7.fhir.r5.model.Immunization.ImmunizationStatusCodes.NOTDONE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Immunization.ImmunizationStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Immunization.ImmunizationStatusCodesEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case COMPLETED: + tgt.setValue(Immunization.ImmunizationStatusCodes.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(Immunization.ImmunizationStatusCodes.ENTEREDINERROR); + break; + case NOTDONE: + tgt.setValue(Immunization.ImmunizationStatusCodes.NOTDONE); + break; + default: + tgt.setValue(Immunization.ImmunizationStatusCodes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertImmunizationStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Immunization.ImmunizationStatusCodesEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4b.model.Immunization.ImmunizationStatusCodes.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.Immunization.ImmunizationStatusCodes.ENTEREDINERROR); - break; - case NOTDONE: - tgt.setValue(org.hl7.fhir.r4b.model.Immunization.ImmunizationStatusCodes.NOTDONE); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Immunization.ImmunizationStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Immunization.ImmunizationStatusCodesEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4b.model.Immunization.ImmunizationStatusCodes.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.Immunization.ImmunizationStatusCodes.ENTEREDINERROR); + break; + case NOTDONE: + tgt.setValue(org.hl7.fhir.r4b.model.Immunization.ImmunizationStatusCodes.NOTDONE); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Immunization.ImmunizationStatusCodes.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Immunization.ImmunizationPerformerComponent convertImmunizationPerformerComponent(org.hl7.fhir.r4b.model.Immunization.ImmunizationPerformerComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ImmunizationEvaluation43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ImmunizationEvaluation43_50.java index 13bb0ca4dc..16aefb6185 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ImmunizationEvaluation43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ImmunizationEvaluation43_50.java @@ -7,6 +7,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.ImmunizationEvaluation; /* Copyright (c) 2011+, HL7, Inc. @@ -108,40 +110,48 @@ public static org.hl7.fhir.r4b.model.ImmunizationEvaluation convertImmunizationE } static public org.hl7.fhir.r5.model.Enumeration convertImmunizationEvaluationStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ImmunizationEvaluation.ImmunizationEvaluationStatusCodesEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.ImmunizationEvaluation.ImmunizationEvaluationStatusCodes.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.ImmunizationEvaluation.ImmunizationEvaluationStatusCodes.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ImmunizationEvaluation.ImmunizationEvaluationStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ImmunizationEvaluation.ImmunizationEvaluationStatusCodesEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case COMPLETED: + tgt.setValue(ImmunizationEvaluation.ImmunizationEvaluationStatusCodes.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(ImmunizationEvaluation.ImmunizationEvaluationStatusCodes.ENTEREDINERROR); + break; + default: + tgt.setValue(ImmunizationEvaluation.ImmunizationEvaluationStatusCodes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertImmunizationEvaluationStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.ImmunizationEvaluation.ImmunizationEvaluationStatusCodesEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4b.model.ImmunizationEvaluation.ImmunizationEvaluationStatusCodes.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.ImmunizationEvaluation.ImmunizationEvaluationStatusCodes.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.ImmunizationEvaluation.ImmunizationEvaluationStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.ImmunizationEvaluation.ImmunizationEvaluationStatusCodesEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4b.model.ImmunizationEvaluation.ImmunizationEvaluationStatusCodes.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.ImmunizationEvaluation.ImmunizationEvaluationStatusCodes.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.ImmunizationEvaluation.ImmunizationEvaluationStatusCodes.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ImplementationGuide43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ImplementationGuide43_50.java index 199716cb3a..b66028003d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ImplementationGuide43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ImplementationGuide43_50.java @@ -21,6 +21,8 @@ import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4.model.Extension; import org.hl7.fhir.r5.model.CanonicalType; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.ImplementationGuide; import org.hl7.fhir.utilities.Utilities; /* @@ -397,53 +399,61 @@ public static org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideDefi } static public org.hl7.fhir.r5.model.Enumeration convertGuidePageGeneration(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ImplementationGuide.GuidePageGenerationEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case HTML: - tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.GuidePageGeneration.HTML); - break; - case MARKDOWN: - tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.GuidePageGeneration.MARKDOWN); - break; - case XML: - tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.GuidePageGeneration.XML); - break; - case GENERATED: - tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.GuidePageGeneration.GENERATED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.GuidePageGeneration.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ImplementationGuide.GuidePageGenerationEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case HTML: + tgt.setValue(ImplementationGuide.GuidePageGeneration.HTML); + break; + case MARKDOWN: + tgt.setValue(ImplementationGuide.GuidePageGeneration.MARKDOWN); + break; + case XML: + tgt.setValue(ImplementationGuide.GuidePageGeneration.XML); + break; + case GENERATED: + tgt.setValue(ImplementationGuide.GuidePageGeneration.GENERATED); + break; + default: + tgt.setValue(ImplementationGuide.GuidePageGeneration.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertGuidePageGeneration(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.ImplementationGuide.GuidePageGenerationEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case HTML: - tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.GuidePageGeneration.HTML); - break; - case MARKDOWN: - tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.GuidePageGeneration.MARKDOWN); - break; - case XML: - tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.GuidePageGeneration.XML); - break; - case GENERATED: - tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.GuidePageGeneration.GENERATED); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.GuidePageGeneration.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.ImplementationGuide.GuidePageGenerationEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case HTML: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.GuidePageGeneration.HTML); + break; + case MARKDOWN: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.GuidePageGeneration.MARKDOWN); + break; + case XML: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.GuidePageGeneration.XML); + break; + case GENERATED: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.GuidePageGeneration.GENERATED); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.GuidePageGeneration.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionParameterComponent convertImplementationGuideDefinitionParameterComponent(org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideDefinitionParameterComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Invoice43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Invoice43_50.java index 740c312c14..ea988c7e07 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Invoice43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Invoice43_50.java @@ -11,6 +11,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Invoice; /* Copyright (c) 2011+, HL7, Inc. @@ -122,59 +124,67 @@ public static org.hl7.fhir.r4b.model.Invoice convertInvoice(org.hl7.fhir.r5.mode } static public org.hl7.fhir.r5.model.Enumeration convertInvoiceStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Invoice.InvoiceStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.Invoice.InvoiceStatus.DRAFT); - break; - case ISSUED: - tgt.setValue(org.hl7.fhir.r5.model.Invoice.InvoiceStatus.ISSUED); - break; - case BALANCED: - tgt.setValue(org.hl7.fhir.r5.model.Invoice.InvoiceStatus.BALANCED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Invoice.InvoiceStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Invoice.InvoiceStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Invoice.InvoiceStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Invoice.InvoiceStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(Invoice.InvoiceStatus.DRAFT); + break; + case ISSUED: + tgt.setValue(Invoice.InvoiceStatus.ISSUED); + break; + case BALANCED: + tgt.setValue(Invoice.InvoiceStatus.BALANCED); + break; + case CANCELLED: + tgt.setValue(Invoice.InvoiceStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(Invoice.InvoiceStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Invoice.InvoiceStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertInvoiceStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Invoice.InvoiceStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r4b.model.Invoice.InvoiceStatus.DRAFT); - break; - case ISSUED: - tgt.setValue(org.hl7.fhir.r4b.model.Invoice.InvoiceStatus.ISSUED); - break; - case BALANCED: - tgt.setValue(org.hl7.fhir.r4b.model.Invoice.InvoiceStatus.BALANCED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4b.model.Invoice.InvoiceStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.Invoice.InvoiceStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Invoice.InvoiceStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Invoice.InvoiceStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(org.hl7.fhir.r4b.model.Invoice.InvoiceStatus.DRAFT); + break; + case ISSUED: + tgt.setValue(org.hl7.fhir.r4b.model.Invoice.InvoiceStatus.ISSUED); + break; + case BALANCED: + tgt.setValue(org.hl7.fhir.r4b.model.Invoice.InvoiceStatus.BALANCED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4b.model.Invoice.InvoiceStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.Invoice.InvoiceStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Invoice.InvoiceStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Invoice.InvoiceParticipantComponent convertInvoiceParticipantComponent(org.hl7.fhir.r4b.model.Invoice.InvoiceParticipantComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Linkage43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Linkage43_50.java index 99b55b28f6..dc9e4fbece 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Linkage43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Linkage43_50.java @@ -4,6 +4,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Boolean43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Linkage; /* Copyright (c) 2011+, HL7, Inc. @@ -89,46 +91,54 @@ public static org.hl7.fhir.r4b.model.Linkage.LinkageItemComponent convertLinkage } static public org.hl7.fhir.r5.model.Enumeration convertLinkageType(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Linkage.LinkageTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case SOURCE: - tgt.setValue(org.hl7.fhir.r5.model.Linkage.LinkageType.SOURCE); - break; - case ALTERNATE: - tgt.setValue(org.hl7.fhir.r5.model.Linkage.LinkageType.ALTERNATE); - break; - case HISTORICAL: - tgt.setValue(org.hl7.fhir.r5.model.Linkage.LinkageType.HISTORICAL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Linkage.LinkageType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Linkage.LinkageTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SOURCE: + tgt.setValue(Linkage.LinkageType.SOURCE); + break; + case ALTERNATE: + tgt.setValue(Linkage.LinkageType.ALTERNATE); + break; + case HISTORICAL: + tgt.setValue(Linkage.LinkageType.HISTORICAL); + break; + default: + tgt.setValue(Linkage.LinkageType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertLinkageType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Linkage.LinkageTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case SOURCE: - tgt.setValue(org.hl7.fhir.r4b.model.Linkage.LinkageType.SOURCE); - break; - case ALTERNATE: - tgt.setValue(org.hl7.fhir.r4b.model.Linkage.LinkageType.ALTERNATE); - break; - case HISTORICAL: - tgt.setValue(org.hl7.fhir.r4b.model.Linkage.LinkageType.HISTORICAL); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Linkage.LinkageType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Linkage.LinkageTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SOURCE: + tgt.setValue(org.hl7.fhir.r4b.model.Linkage.LinkageType.SOURCE); + break; + case ALTERNATE: + tgt.setValue(org.hl7.fhir.r4b.model.Linkage.LinkageType.ALTERNATE); + break; + case HISTORICAL: + tgt.setValue(org.hl7.fhir.r4b.model.Linkage.LinkageType.HISTORICAL); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Linkage.LinkageType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ListResource43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ListResource43_50.java index bdb1d2cf75..fe115d3d6d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ListResource43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ListResource43_50.java @@ -9,6 +9,9 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; +import org.hl7.fhir.r5.model.ListResource; /* Copyright (c) 2011+, HL7, Inc. @@ -108,91 +111,107 @@ public static org.hl7.fhir.r4b.model.ListResource convertListResource(org.hl7.fh } static public org.hl7.fhir.r5.model.Enumeration convertListStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ListResource.ListStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case CURRENT: - tgt.setValue(org.hl7.fhir.r5.model.ListResource.ListStatus.CURRENT); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.r5.model.ListResource.ListStatus.RETIRED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.ListResource.ListStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ListResource.ListStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ListResource.ListStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CURRENT: + tgt.setValue(ListResource.ListStatus.CURRENT); + break; + case RETIRED: + tgt.setValue(ListResource.ListStatus.RETIRED); + break; + case ENTEREDINERROR: + tgt.setValue(ListResource.ListStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(ListResource.ListStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertListStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.ListResource.ListStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case CURRENT: - tgt.setValue(org.hl7.fhir.r4b.model.ListResource.ListStatus.CURRENT); - break; - case RETIRED: - tgt.setValue(org.hl7.fhir.r4b.model.ListResource.ListStatus.RETIRED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.ListResource.ListStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.ListResource.ListStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.ListResource.ListStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CURRENT: + tgt.setValue(org.hl7.fhir.r4b.model.ListResource.ListStatus.CURRENT); + break; + case RETIRED: + tgt.setValue(org.hl7.fhir.r4b.model.ListResource.ListStatus.RETIRED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.ListResource.ListStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.ListResource.ListStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertListMode(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ListModeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case WORKING: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ListMode.WORKING); - break; - case SNAPSHOT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ListMode.SNAPSHOT); - break; - case CHANGES: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ListMode.CHANGES); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ListMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ListModeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case WORKING: + tgt.setValue(Enumerations.ListMode.WORKING); + break; + case SNAPSHOT: + tgt.setValue(Enumerations.ListMode.SNAPSHOT); + break; + case CHANGES: + tgt.setValue(Enumerations.ListMode.CHANGES); + break; + default: + tgt.setValue(Enumerations.ListMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertListMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.ListModeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case WORKING: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ListMode.WORKING); - break; - case SNAPSHOT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ListMode.SNAPSHOT); - break; - case CHANGES: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ListMode.CHANGES); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ListMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.ListModeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case WORKING: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ListMode.WORKING); + break; + case SNAPSHOT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ListMode.SNAPSHOT); + break; + case CHANGES: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ListMode.CHANGES); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ListMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.ListResource.ListResourceEntryComponent convertListEntryComponent(org.hl7.fhir.r4b.model.ListResource.ListResourceEntryComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Location43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Location43_50.java index 5ad705c4cc..1d62f2ecbd 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Location43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Location43_50.java @@ -10,8 +10,7 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.r5.model.ContactPoint; -import org.hl7.fhir.r5.model.ExtendedContactDetail; +import org.hl7.fhir.r5.model.*; /* Copyright (c) 2011+, HL7, Inc. @@ -126,85 +125,101 @@ public static org.hl7.fhir.r4b.model.Location convertLocation(org.hl7.fhir.r5.mo } static public org.hl7.fhir.r5.model.Enumeration convertLocationStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Location.LocationStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Location.LocationStatus.ACTIVE); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.r5.model.Location.LocationStatus.SUSPENDED); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Location.LocationStatus.INACTIVE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Location.LocationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Location.LocationStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Location.LocationStatus.ACTIVE); + break; + case SUSPENDED: + tgt.setValue(Location.LocationStatus.SUSPENDED); + break; + case INACTIVE: + tgt.setValue(Location.LocationStatus.INACTIVE); + break; + default: + tgt.setValue(Location.LocationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertLocationStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Location.LocationStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.Location.LocationStatus.ACTIVE); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.r4b.model.Location.LocationStatus.SUSPENDED); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.Location.LocationStatus.INACTIVE); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Location.LocationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Location.LocationStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4b.model.Location.LocationStatus.ACTIVE); + break; + case SUSPENDED: + tgt.setValue(org.hl7.fhir.r4b.model.Location.LocationStatus.SUSPENDED); + break; + case INACTIVE: + tgt.setValue(org.hl7.fhir.r4b.model.Location.LocationStatus.INACTIVE); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Location.LocationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertLocationMode(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Location.LocationModeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.r5.model.Location.LocationMode.INSTANCE); - break; - case KIND: - tgt.setValue(org.hl7.fhir.r5.model.Location.LocationMode.KIND); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Location.LocationMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Location.LocationModeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(Location.LocationMode.INSTANCE); + break; + case KIND: + tgt.setValue(Location.LocationMode.KIND); + break; + default: + tgt.setValue(Location.LocationMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertLocationMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Location.LocationModeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.r4b.model.Location.LocationMode.INSTANCE); - break; - case KIND: - tgt.setValue(org.hl7.fhir.r4b.model.Location.LocationMode.KIND); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Location.LocationMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Location.LocationModeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(org.hl7.fhir.r4b.model.Location.LocationMode.INSTANCE); + break; + case KIND: + tgt.setValue(org.hl7.fhir.r4b.model.Location.LocationMode.KIND); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Location.LocationMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Location.LocationPositionComponent convertLocationPositionComponent(org.hl7.fhir.r4b.model.Location.LocationPositionComponent src) throws FHIRException { @@ -270,70 +285,78 @@ public static org.hl7.fhir.r4b.model.Location.LocationPositionComponent convertL // } static public org.hl7.fhir.r5.model.Enumeration convertDaysOfWeek(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.DaysOfWeekEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case MON: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.MON); - break; - case TUE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.TUE); - break; - case WED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.WED); - break; - case THU: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.THU); - break; - case FRI: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.FRI); - break; - case SAT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.SAT); - break; - case SUN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.SUN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.DaysOfWeekEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MON: + tgt.setValue(Enumerations.DaysOfWeek.MON); + break; + case TUE: + tgt.setValue(Enumerations.DaysOfWeek.TUE); + break; + case WED: + tgt.setValue(Enumerations.DaysOfWeek.WED); + break; + case THU: + tgt.setValue(Enumerations.DaysOfWeek.THU); + break; + case FRI: + tgt.setValue(Enumerations.DaysOfWeek.FRI); + break; + case SAT: + tgt.setValue(Enumerations.DaysOfWeek.SAT); + break; + case SUN: + tgt.setValue(Enumerations.DaysOfWeek.SUN); + break; + default: + tgt.setValue(Enumerations.DaysOfWeek.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertDaysOfWeek(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.DaysOfWeekEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case MON: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.MON); - break; - case TUE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.TUE); - break; - case WED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.WED); - break; - case THU: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.THU); - break; - case FRI: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.FRI); - break; - case SAT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.SAT); - break; - case SUN: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.SUN); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.DaysOfWeekEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MON: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.MON); + break; + case TUE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.TUE); + break; + case WED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.WED); + break; + case THU: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.THU); + break; + case FRI: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.FRI); + break; + case SAT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.SAT); + break; + case SUN: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.SUN); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MeasureReport43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MeasureReport43_50.java index 1f1866f7a2..636e56fc19 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MeasureReport43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MeasureReport43_50.java @@ -10,6 +10,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Integer43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.MeasureReport; /* Copyright (c) 2011+, HL7, Inc. @@ -103,97 +105,113 @@ public static org.hl7.fhir.r4b.model.MeasureReport convertMeasureReport(org.hl7. } static public org.hl7.fhir.r5.model.Enumeration convertMeasureReportStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.MeasureReport.MeasureReportStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case COMPLETE: - tgt.setValue(org.hl7.fhir.r5.model.MeasureReport.MeasureReportStatus.COMPLETE); - break; - case PENDING: - tgt.setValue(org.hl7.fhir.r5.model.MeasureReport.MeasureReportStatus.PENDING); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.r5.model.MeasureReport.MeasureReportStatus.ERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.MeasureReport.MeasureReportStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new MeasureReport.MeasureReportStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case COMPLETE: + tgt.setValue(MeasureReport.MeasureReportStatus.COMPLETE); + break; + case PENDING: + tgt.setValue(MeasureReport.MeasureReportStatus.PENDING); + break; + case ERROR: + tgt.setValue(MeasureReport.MeasureReportStatus.ERROR); + break; + default: + tgt.setValue(MeasureReport.MeasureReportStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertMeasureReportStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.MeasureReport.MeasureReportStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case COMPLETE: - tgt.setValue(org.hl7.fhir.r4b.model.MeasureReport.MeasureReportStatus.COMPLETE); - break; - case PENDING: - tgt.setValue(org.hl7.fhir.r4b.model.MeasureReport.MeasureReportStatus.PENDING); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.r4b.model.MeasureReport.MeasureReportStatus.ERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.MeasureReport.MeasureReportStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.MeasureReport.MeasureReportStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case COMPLETE: + tgt.setValue(org.hl7.fhir.r4b.model.MeasureReport.MeasureReportStatus.COMPLETE); + break; + case PENDING: + tgt.setValue(org.hl7.fhir.r4b.model.MeasureReport.MeasureReportStatus.PENDING); + break; + case ERROR: + tgt.setValue(org.hl7.fhir.r4b.model.MeasureReport.MeasureReportStatus.ERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.MeasureReport.MeasureReportStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertMeasureReportType(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.MeasureReport.MeasureReportTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case INDIVIDUAL: - tgt.setValue(org.hl7.fhir.r5.model.MeasureReport.MeasureReportType.INDIVIDUAL); - break; - case SUBJECTLIST: - tgt.setValue(org.hl7.fhir.r5.model.MeasureReport.MeasureReportType.SUBJECTLIST); - break; - case SUMMARY: - tgt.setValue(org.hl7.fhir.r5.model.MeasureReport.MeasureReportType.SUMMARY); - break; - case DATACOLLECTION: - tgt.setValue(org.hl7.fhir.r5.model.MeasureReport.MeasureReportType.DATAEXCHANGE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.MeasureReport.MeasureReportType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new MeasureReport.MeasureReportTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INDIVIDUAL: + tgt.setValue(MeasureReport.MeasureReportType.INDIVIDUAL); + break; + case SUBJECTLIST: + tgt.setValue(MeasureReport.MeasureReportType.SUBJECTLIST); + break; + case SUMMARY: + tgt.setValue(MeasureReport.MeasureReportType.SUMMARY); + break; + case DATACOLLECTION: + tgt.setValue(MeasureReport.MeasureReportType.DATAEXCHANGE); + break; + default: + tgt.setValue(MeasureReport.MeasureReportType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertMeasureReportType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.MeasureReport.MeasureReportTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case INDIVIDUAL: - tgt.setValue(org.hl7.fhir.r4b.model.MeasureReport.MeasureReportType.INDIVIDUAL); - break; - case SUBJECTLIST: - tgt.setValue(org.hl7.fhir.r4b.model.MeasureReport.MeasureReportType.SUBJECTLIST); - break; - case SUMMARY: - tgt.setValue(org.hl7.fhir.r4b.model.MeasureReport.MeasureReportType.SUMMARY); - break; - case DATAEXCHANGE: - tgt.setValue(org.hl7.fhir.r4b.model.MeasureReport.MeasureReportType.DATACOLLECTION); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.MeasureReport.MeasureReportType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.MeasureReport.MeasureReportTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INDIVIDUAL: + tgt.setValue(org.hl7.fhir.r4b.model.MeasureReport.MeasureReportType.INDIVIDUAL); + break; + case SUBJECTLIST: + tgt.setValue(org.hl7.fhir.r4b.model.MeasureReport.MeasureReportType.SUBJECTLIST); + break; + case SUMMARY: + tgt.setValue(org.hl7.fhir.r4b.model.MeasureReport.MeasureReportType.SUMMARY); + break; + case DATAEXCHANGE: + tgt.setValue(org.hl7.fhir.r4b.model.MeasureReport.MeasureReportType.DATACOLLECTION); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.MeasureReport.MeasureReportType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupComponent convertMeasureReportGroupComponent(org.hl7.fhir.r4b.model.MeasureReport.MeasureReportGroupComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Medication43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Medication43_50.java index 1bf50f668a..ff3775578e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Medication43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Medication43_50.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Medication; /* Copyright (c) 2011+, HL7, Inc. @@ -90,47 +92,55 @@ public static org.hl7.fhir.r4b.model.Medication convertMedication(org.hl7.fhir.r } static public org.hl7.fhir.r5.model.Enumeration convertMedicationStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Medication.MedicationStatusCodesEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Medication.MedicationStatusCodes.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Medication.MedicationStatusCodes.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Medication.MedicationStatusCodes.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Medication.MedicationStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Medication.MedicationStatusCodesEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Medication.MedicationStatusCodes.ACTIVE); + break; + case INACTIVE: + tgt.setValue(Medication.MedicationStatusCodes.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(Medication.MedicationStatusCodes.ENTEREDINERROR); + break; + default: + tgt.setValue(Medication.MedicationStatusCodes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertMedicationStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Medication.MedicationStatusCodesEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.Medication.MedicationStatusCodes.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.Medication.MedicationStatusCodes.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.Medication.MedicationStatusCodes.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Medication.MedicationStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Medication.MedicationStatusCodesEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4b.model.Medication.MedicationStatusCodes.ACTIVE); + break; + case INACTIVE: + tgt.setValue(org.hl7.fhir.r4b.model.Medication.MedicationStatusCodes.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.Medication.MedicationStatusCodes.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Medication.MedicationStatusCodes.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Medication.MedicationIngredientComponent convertMedicationIngredientComponent(org.hl7.fhir.r4b.model.Medication.MedicationIngredientComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MedicationAdministration43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MedicationAdministration43_50.java index cc8ac9775b..f5a1ebee9b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MedicationAdministration43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MedicationAdministration43_50.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.MedicationAdministration; /* Copyright (c) 2011+, HL7, Inc. @@ -134,73 +136,81 @@ public static org.hl7.fhir.r4b.model.MedicationAdministration convertMedicationA } private static org.hl7.fhir.r5.model.Enumeration convertMedicationAdministrationStatus(org.hl7.fhir.r4b.model.Enumeration src) { - if (src == null) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationStatusCodesEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - // - switch (src.getValue()) { - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationStatusCodes.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationStatusCodes.ENTEREDINERROR); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationStatusCodes.INPROGRESS); - break; - case NOTDONE: - tgt.setValue(org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationStatusCodes.NOTDONE); - break; - case NULL: - tgt.setValue(org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationStatusCodes.NULL); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationStatusCodes.ONHOLD); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationStatusCodes.STOPPED); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationStatusCodes.UNKNOWN); - break; - } - return tgt; + if (src == null) + return null; + Enumeration tgt = new Enumeration<>(new MedicationAdministration.MedicationAdministrationStatusCodesEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + // + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case COMPLETED: + tgt.setValue(MedicationAdministration.MedicationAdministrationStatusCodes.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(MedicationAdministration.MedicationAdministrationStatusCodes.ENTEREDINERROR); + break; + case INPROGRESS: + tgt.setValue(MedicationAdministration.MedicationAdministrationStatusCodes.INPROGRESS); + break; + case NOTDONE: + tgt.setValue(MedicationAdministration.MedicationAdministrationStatusCodes.NOTDONE); + break; + case NULL: + tgt.setValue(MedicationAdministration.MedicationAdministrationStatusCodes.NULL); + break; + case ONHOLD: + tgt.setValue(MedicationAdministration.MedicationAdministrationStatusCodes.ONHOLD); + break; + case STOPPED: + tgt.setValue(MedicationAdministration.MedicationAdministrationStatusCodes.STOPPED); + break; + case UNKNOWN: + tgt.setValue(MedicationAdministration.MedicationAdministrationStatusCodes.UNKNOWN); + break; + } + } + return tgt; } private static org.hl7.fhir.r4b.model.Enumeration convertMedicationAdministrationStatus(org.hl7.fhir.r5.model.Enumeration src) { - if (src == null) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.MedicationAdministration.MedicationAdministrationStatusCodesEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - // - switch (src.getValue()) { - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationAdministration.MedicationAdministrationStatusCodes.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationAdministration.MedicationAdministrationStatusCodes.ENTEREDINERROR); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationAdministration.MedicationAdministrationStatusCodes.INPROGRESS); - break; - case NOTDONE: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationAdministration.MedicationAdministrationStatusCodes.NOTDONE); - break; - case NULL: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationAdministration.MedicationAdministrationStatusCodes.NULL); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationAdministration.MedicationAdministrationStatusCodes.ONHOLD); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationAdministration.MedicationAdministrationStatusCodes.STOPPED); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationAdministration.MedicationAdministrationStatusCodes.UNKNOWN); - break; - } - return tgt; + if (src == null) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.MedicationAdministration.MedicationAdministrationStatusCodesEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + // + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4b.model.MedicationAdministration.MedicationAdministrationStatusCodes.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.MedicationAdministration.MedicationAdministrationStatusCodes.ENTEREDINERROR); + break; + case INPROGRESS: + tgt.setValue(org.hl7.fhir.r4b.model.MedicationAdministration.MedicationAdministrationStatusCodes.INPROGRESS); + break; + case NOTDONE: + tgt.setValue(org.hl7.fhir.r4b.model.MedicationAdministration.MedicationAdministrationStatusCodes.NOTDONE); + break; + case NULL: + tgt.setValue(org.hl7.fhir.r4b.model.MedicationAdministration.MedicationAdministrationStatusCodes.NULL); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.r4b.model.MedicationAdministration.MedicationAdministrationStatusCodes.ONHOLD); + break; + case STOPPED: + tgt.setValue(org.hl7.fhir.r4b.model.MedicationAdministration.MedicationAdministrationStatusCodes.STOPPED); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4b.model.MedicationAdministration.MedicationAdministrationStatusCodes.UNKNOWN); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationPerformerComponent convertMedicationAdministrationPerformerComponent(org.hl7.fhir.r4b.model.MedicationAdministration.MedicationAdministrationPerformerComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MedicationDispense43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MedicationDispense43_50.java index 402fe6ef9c..1b7e740b03 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MedicationDispense43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MedicationDispense43_50.java @@ -10,6 +10,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Dosage43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4b.model.Enumeration; +import org.hl7.fhir.r4b.model.MedicationDispense; import org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodesEnumFactory; /* @@ -158,83 +160,91 @@ public static org.hl7.fhir.r4b.model.MedicationDispense convertMedicationDispens } private static org.hl7.fhir.r4b.model.Enumeration convertStatus(org.hl7.fhir.r5.model.Enumeration src) { - if (src == null) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.MedicationDispense.MedicationDispenseStatusCodesEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationDispense.MedicationDispenseStatusCodes.CANCELLED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationDispense.MedicationDispenseStatusCodes.COMPLETED); - break; - case DECLINED: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationDispense.MedicationDispenseStatusCodes.DECLINED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationDispense.MedicationDispenseStatusCodes.ENTEREDINERROR); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationDispense.MedicationDispenseStatusCodes.INPROGRESS); - break; - case NULL: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationDispense.MedicationDispenseStatusCodes.NULL); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationDispense.MedicationDispenseStatusCodes.ONHOLD); - break; - case PREPARATION: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationDispense.MedicationDispenseStatusCodes.PREPARATION); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationDispense.MedicationDispenseStatusCodes.STOPPED); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationDispense.MedicationDispenseStatusCodes.UNKNOWN); - break; - } - return tgt; + if (src == null) + return null; + Enumeration tgt = new Enumeration<>(new MedicationDispense.MedicationDispenseStatusCodesEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CANCELLED: + tgt.setValue(MedicationDispense.MedicationDispenseStatusCodes.CANCELLED); + break; + case COMPLETED: + tgt.setValue(MedicationDispense.MedicationDispenseStatusCodes.COMPLETED); + break; + case DECLINED: + tgt.setValue(MedicationDispense.MedicationDispenseStatusCodes.DECLINED); + break; + case ENTEREDINERROR: + tgt.setValue(MedicationDispense.MedicationDispenseStatusCodes.ENTEREDINERROR); + break; + case INPROGRESS: + tgt.setValue(MedicationDispense.MedicationDispenseStatusCodes.INPROGRESS); + break; + case NULL: + tgt.setValue(MedicationDispense.MedicationDispenseStatusCodes.NULL); + break; + case ONHOLD: + tgt.setValue(MedicationDispense.MedicationDispenseStatusCodes.ONHOLD); + break; + case PREPARATION: + tgt.setValue(MedicationDispense.MedicationDispenseStatusCodes.PREPARATION); + break; + case STOPPED: + tgt.setValue(MedicationDispense.MedicationDispenseStatusCodes.STOPPED); + break; + case UNKNOWN: + tgt.setValue(MedicationDispense.MedicationDispenseStatusCodes.UNKNOWN); + break; + } + } + return tgt; } private static org.hl7.fhir.r5.model.Enumeration convertMedicationStatus(org.hl7.fhir.r4b.model.Enumeration src) { - if (src == null) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new MedicationDispenseStatusCodesEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.CANCELLED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.COMPLETED); - break; - case DECLINED: - tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.DECLINED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.ENTEREDINERROR); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.INPROGRESS); - break; - case NULL: - tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.NULL); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.ONHOLD); - break; - case PREPARATION: - tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.PREPARATION); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.STOPPED); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.UNKNOWN); - break; - } - return tgt; + if (src == null) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new MedicationDispenseStatusCodesEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CANCELLED: + tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.CANCELLED); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.COMPLETED); + break; + case DECLINED: + tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.DECLINED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.ENTEREDINERROR); + break; + case INPROGRESS: + tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.INPROGRESS); + break; + case NULL: + tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.NULL); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.ONHOLD); + break; + case PREPARATION: + tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.PREPARATION); + break; + case STOPPED: + tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.STOPPED); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes.UNKNOWN); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.MedicationDispense.MedicationDispensePerformerComponent convertMedicationDispensePerformerComponent(org.hl7.fhir.r4b.model.MedicationDispense.MedicationDispensePerformerComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MedicationKnowledge43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MedicationKnowledge43_50.java index 67541b5eb6..1761200504 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MedicationKnowledge43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MedicationKnowledge43_50.java @@ -10,6 +10,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4b.model.Enumeration; +import org.hl7.fhir.r4b.model.MedicationKnowledge; import org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgePackagingComponent; import org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeStatusCodesEnumFactory; @@ -147,47 +149,55 @@ public static org.hl7.fhir.r4b.model.MedicationKnowledge convertMedicationKnowle } private static org.hl7.fhir.r4b.model.Enumeration convertMedicationKnowledgeStatus(org.hl7.fhir.r5.model.Enumeration src) { - if (src == null) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeStatusCodesEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeStatusCodes.ACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeStatusCodes.ENTEREDINERROR); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeStatusCodes.INACTIVE); - break; - case NULL: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeStatusCodes.NULL); - break; - } - return tgt; + if (src == null) + return null; + Enumeration tgt = new Enumeration<>(new MedicationKnowledge.MedicationKnowledgeStatusCodesEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(MedicationKnowledge.MedicationKnowledgeStatusCodes.ACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(MedicationKnowledge.MedicationKnowledgeStatusCodes.ENTEREDINERROR); + break; + case INACTIVE: + tgt.setValue(MedicationKnowledge.MedicationKnowledgeStatusCodes.INACTIVE); + break; + case NULL: + tgt.setValue(MedicationKnowledge.MedicationKnowledgeStatusCodes.NULL); + break; + } + } + return tgt; } private static org.hl7.fhir.r5.model.Enumeration convertMedicationKnowledgeStatus(org.hl7.fhir.r4b.model.Enumeration src) { - if (src == null) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new MedicationKnowledgeStatusCodesEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeStatusCodes.ACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeStatusCodes.ENTEREDINERROR); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeStatusCodes.INACTIVE); - break; - case NULL: - tgt.setValue(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeStatusCodes.NULL); - break; - } - return tgt; + if (src == null) + return null; + org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new MedicationKnowledgeStatusCodesEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeStatusCodes.ACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeStatusCodes.ENTEREDINERROR); + break; + case INACTIVE: + tgt.setValue(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeStatusCodes.INACTIVE); + break; + case NULL: + tgt.setValue(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeStatusCodes.NULL); + break; + } + } + return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MedicationRequest43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MedicationRequest43_50.java index 5a6bf1efdf..96b3aa19b4 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MedicationRequest43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MedicationRequest43_50.java @@ -13,6 +13,9 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Dosage43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; +import org.hl7.fhir.r5.model.MedicationRequest; /* Copyright (c) 2011+, HL7, Inc. @@ -194,201 +197,225 @@ public static org.hl7.fhir.r4b.model.MedicationRequest convertMedicationRequest( } static public org.hl7.fhir.r5.model.Enumeration convertMedicationRequestStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.ONHOLD); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.CANCELLED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.ENTEREDINERROR); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.STOPPED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.DRAFT); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationrequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new MedicationRequest.MedicationrequestStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(MedicationRequest.MedicationrequestStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(MedicationRequest.MedicationrequestStatus.ONHOLD); + break; + case CANCELLED: + tgt.setValue(MedicationRequest.MedicationrequestStatus.CANCELLED); + break; + case COMPLETED: + tgt.setValue(MedicationRequest.MedicationrequestStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(MedicationRequest.MedicationrequestStatus.ENTEREDINERROR); + break; + case STOPPED: + tgt.setValue(MedicationRequest.MedicationrequestStatus.STOPPED); + break; + case DRAFT: + tgt.setValue(MedicationRequest.MedicationrequestStatus.DRAFT); + break; + case UNKNOWN: + tgt.setValue(MedicationRequest.MedicationrequestStatus.UNKNOWN); + break; + default: + tgt.setValue(MedicationRequest.MedicationrequestStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertMedicationRequestStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.MedicationRequest.MedicationrequestStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationRequest.MedicationrequestStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationRequest.MedicationrequestStatus.ONHOLD); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationRequest.MedicationrequestStatus.CANCELLED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationRequest.MedicationrequestStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationRequest.MedicationrequestStatus.ENTEREDINERROR); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationRequest.MedicationrequestStatus.STOPPED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationRequest.MedicationrequestStatus.DRAFT); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationRequest.MedicationrequestStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationRequest.MedicationrequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.MedicationRequest.MedicationrequestStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4b.model.MedicationRequest.MedicationrequestStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.r4b.model.MedicationRequest.MedicationrequestStatus.ONHOLD); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4b.model.MedicationRequest.MedicationrequestStatus.CANCELLED); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4b.model.MedicationRequest.MedicationrequestStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.MedicationRequest.MedicationrequestStatus.ENTEREDINERROR); + break; + case STOPPED: + tgt.setValue(org.hl7.fhir.r4b.model.MedicationRequest.MedicationrequestStatus.STOPPED); + break; + case DRAFT: + tgt.setValue(org.hl7.fhir.r4b.model.MedicationRequest.MedicationrequestStatus.DRAFT); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4b.model.MedicationRequest.MedicationrequestStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.MedicationRequest.MedicationrequestStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertMedicationRequestIntent(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntentEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSAL: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.PROPOSAL); - break; - case PLAN: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.PLAN); - break; - case ORDER: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.ORDER); - break; - case ORIGINALORDER: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.ORIGINALORDER); - break; - case REFLEXORDER: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.REFLEXORDER); - break; - case FILLERORDER: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.FILLERORDER); - break; - case INSTANCEORDER: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.INSTANCEORDER); - break; - case OPTION: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.OPTION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new MedicationRequest.MedicationRequestIntentEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSAL: + tgt.setValue(MedicationRequest.MedicationRequestIntent.PROPOSAL); + break; + case PLAN: + tgt.setValue(MedicationRequest.MedicationRequestIntent.PLAN); + break; + case ORDER: + tgt.setValue(MedicationRequest.MedicationRequestIntent.ORDER); + break; + case ORIGINALORDER: + tgt.setValue(MedicationRequest.MedicationRequestIntent.ORIGINALORDER); + break; + case REFLEXORDER: + tgt.setValue(MedicationRequest.MedicationRequestIntent.REFLEXORDER); + break; + case FILLERORDER: + tgt.setValue(MedicationRequest.MedicationRequestIntent.FILLERORDER); + break; + case INSTANCEORDER: + tgt.setValue(MedicationRequest.MedicationRequestIntent.INSTANCEORDER); + break; + case OPTION: + tgt.setValue(MedicationRequest.MedicationRequestIntent.OPTION); + break; + default: + tgt.setValue(MedicationRequest.MedicationRequestIntent.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertMedicationRequestIntent(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.MedicationRequest.MedicationRequestIntentEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSAL: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationRequest.MedicationRequestIntent.PROPOSAL); - break; - case PLAN: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationRequest.MedicationRequestIntent.PLAN); - break; - case ORDER: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationRequest.MedicationRequestIntent.ORDER); - break; - case ORIGINALORDER: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationRequest.MedicationRequestIntent.ORIGINALORDER); - break; - case REFLEXORDER: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationRequest.MedicationRequestIntent.REFLEXORDER); - break; - case FILLERORDER: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationRequest.MedicationRequestIntent.FILLERORDER); - break; - case INSTANCEORDER: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationRequest.MedicationRequestIntent.INSTANCEORDER); - break; - case OPTION: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationRequest.MedicationRequestIntent.OPTION); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationRequest.MedicationRequestIntent.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.MedicationRequest.MedicationRequestIntentEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSAL: + tgt.setValue(org.hl7.fhir.r4b.model.MedicationRequest.MedicationRequestIntent.PROPOSAL); + break; + case PLAN: + tgt.setValue(org.hl7.fhir.r4b.model.MedicationRequest.MedicationRequestIntent.PLAN); + break; + case ORDER: + tgt.setValue(org.hl7.fhir.r4b.model.MedicationRequest.MedicationRequestIntent.ORDER); + break; + case ORIGINALORDER: + tgt.setValue(org.hl7.fhir.r4b.model.MedicationRequest.MedicationRequestIntent.ORIGINALORDER); + break; + case REFLEXORDER: + tgt.setValue(org.hl7.fhir.r4b.model.MedicationRequest.MedicationRequestIntent.REFLEXORDER); + break; + case FILLERORDER: + tgt.setValue(org.hl7.fhir.r4b.model.MedicationRequest.MedicationRequestIntent.FILLERORDER); + break; + case INSTANCEORDER: + tgt.setValue(org.hl7.fhir.r4b.model.MedicationRequest.MedicationRequestIntent.INSTANCEORDER); + break; + case OPTION: + tgt.setValue(org.hl7.fhir.r4b.model.MedicationRequest.MedicationRequestIntent.OPTION); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.MedicationRequest.MedicationRequestIntent.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertMedicationRequestPriority(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestPriorityEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP); - break; - case STAT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.RequestPriorityEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(Enumerations.RequestPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(Enumerations.RequestPriority.URGENT); + break; + case ASAP: + tgt.setValue(Enumerations.RequestPriority.ASAP); + break; + case STAT: + tgt.setValue(Enumerations.RequestPriority.STAT); + break; + default: + tgt.setValue(Enumerations.RequestPriority.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertMedicationRequestPriority(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestPriorityEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.URGENT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ASAP); - break; - case STAT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.STAT); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestPriorityEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.URGENT); + break; + case ASAP: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ASAP); + break; + case STAT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.STAT); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestDispenseRequestComponent convertMedicationRequestDispenseRequestComponent(org.hl7.fhir.r4b.model.MedicationRequest.MedicationRequestDispenseRequestComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MedicationStatement43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MedicationStatement43_50.java index e7723274d9..d6739c8e19 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MedicationStatement43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MedicationStatement43_50.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.MedicationStatement; /* Copyright (c) 2011+, HL7, Inc. @@ -128,57 +130,64 @@ public static org.hl7.fhir.r4b.model.MedicationStatement convertMedicationStatem } static public org.hl7.fhir.r5.model.Enumeration convertMedicationStatementStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodesEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodes.RECORDED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodes.RECORDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodes.ENTEREDINERROR); - break; - case INTENDED: - tgt.setValue(org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodes.RECORDED); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodes.RECORDED); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodes.RECORDED); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodes.RECORDED); - break; - case NOTTAKEN: - tgt.setValue(org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodes.RECORDED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new MedicationStatement.MedicationStatementStatusCodesEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(MedicationStatement.MedicationStatementStatusCodes.RECORDED); + break; + case COMPLETED: + tgt.setValue(MedicationStatement.MedicationStatementStatusCodes.RECORDED); + break; + case ENTEREDINERROR: + tgt.setValue(MedicationStatement.MedicationStatementStatusCodes.ENTEREDINERROR); + break; + case INTENDED: + tgt.setValue(MedicationStatement.MedicationStatementStatusCodes.RECORDED); + break; + case STOPPED: + tgt.setValue(MedicationStatement.MedicationStatementStatusCodes.RECORDED); + break; + case ONHOLD: + tgt.setValue(MedicationStatement.MedicationStatementStatusCodes.RECORDED); + break; + case UNKNOWN: + tgt.setValue(MedicationStatement.MedicationStatementStatusCodes.RECORDED); + break; + case NOTTAKEN: + tgt.setValue(MedicationStatement.MedicationStatementStatusCodes.RECORDED); + break; + default: + tgt.setValue(MedicationStatement.MedicationStatementStatusCodes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertMedicationStatementStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.MedicationStatement.MedicationStatusCodesEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { -// case ACTIVE: + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.MedicationStatement.MedicationStatusCodesEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + // case ACTIVE: // tgt.setValue(org.hl7.fhir.r4b.model.MedicationStatement.MedicationStatusCodes.ACTIVE); // break; - case RECORDED: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationStatement.MedicationStatusCodes.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.MedicationStatement.MedicationStatusCodes.ENTEREDINERROR); - break; + case RECORDED: + tgt.setValue(org.hl7.fhir.r4b.model.MedicationStatement.MedicationStatusCodes.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.MedicationStatement.MedicationStatusCodes.ENTEREDINERROR); + break; // case UNKNOWN: // tgt.setValue(org.hl7.fhir.r4b.model.MedicationStatement.MedicationStatusCodes.INTENDED); // break; @@ -188,16 +197,17 @@ static public org.hl7.fhir.r4b.model.Enumeration convertMessageSignificanceCategory(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.MessageDefinition.MessageSignificanceCategoryEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case CONSEQUENCE: - tgt.setValue(org.hl7.fhir.r5.model.MessageDefinition.MessageSignificanceCategory.CONSEQUENCE); - break; - case CURRENCY: - tgt.setValue(org.hl7.fhir.r5.model.MessageDefinition.MessageSignificanceCategory.CURRENCY); - break; - case NOTIFICATION: - tgt.setValue(org.hl7.fhir.r5.model.MessageDefinition.MessageSignificanceCategory.NOTIFICATION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.MessageDefinition.MessageSignificanceCategory.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new MessageDefinition.MessageSignificanceCategoryEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CONSEQUENCE: + tgt.setValue(MessageDefinition.MessageSignificanceCategory.CONSEQUENCE); + break; + case CURRENCY: + tgt.setValue(MessageDefinition.MessageSignificanceCategory.CURRENCY); + break; + case NOTIFICATION: + tgt.setValue(MessageDefinition.MessageSignificanceCategory.NOTIFICATION); + break; + default: + tgt.setValue(MessageDefinition.MessageSignificanceCategory.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertMessageSignificanceCategory(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.MessageDefinition.MessageSignificanceCategoryEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case CONSEQUENCE: - tgt.setValue(org.hl7.fhir.r4b.model.MessageDefinition.MessageSignificanceCategory.CONSEQUENCE); - break; - case CURRENCY: - tgt.setValue(org.hl7.fhir.r4b.model.MessageDefinition.MessageSignificanceCategory.CURRENCY); - break; - case NOTIFICATION: - tgt.setValue(org.hl7.fhir.r4b.model.MessageDefinition.MessageSignificanceCategory.NOTIFICATION); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.MessageDefinition.MessageSignificanceCategory.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.MessageDefinition.MessageSignificanceCategoryEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CONSEQUENCE: + tgt.setValue(org.hl7.fhir.r4b.model.MessageDefinition.MessageSignificanceCategory.CONSEQUENCE); + break; + case CURRENCY: + tgt.setValue(org.hl7.fhir.r4b.model.MessageDefinition.MessageSignificanceCategory.CURRENCY); + break; + case NOTIFICATION: + tgt.setValue(org.hl7.fhir.r4b.model.MessageDefinition.MessageSignificanceCategory.NOTIFICATION); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.MessageDefinition.MessageSignificanceCategory.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertMessageheaderResponseRequest(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.MessageDefinition.MessageheaderResponseRequestEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ALWAYS: - tgt.setValue(org.hl7.fhir.r5.model.MessageDefinition.MessageheaderResponseRequest.ALWAYS); - break; - case ONERROR: - tgt.setValue(org.hl7.fhir.r5.model.MessageDefinition.MessageheaderResponseRequest.ONERROR); - break; - case NEVER: - tgt.setValue(org.hl7.fhir.r5.model.MessageDefinition.MessageheaderResponseRequest.NEVER); - break; - case ONSUCCESS: - tgt.setValue(org.hl7.fhir.r5.model.MessageDefinition.MessageheaderResponseRequest.ONSUCCESS); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.MessageDefinition.MessageheaderResponseRequest.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new MessageDefinition.MessageheaderResponseRequestEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ALWAYS: + tgt.setValue(MessageDefinition.MessageheaderResponseRequest.ALWAYS); + break; + case ONERROR: + tgt.setValue(MessageDefinition.MessageheaderResponseRequest.ONERROR); + break; + case NEVER: + tgt.setValue(MessageDefinition.MessageheaderResponseRequest.NEVER); + break; + case ONSUCCESS: + tgt.setValue(MessageDefinition.MessageheaderResponseRequest.ONSUCCESS); + break; + default: + tgt.setValue(MessageDefinition.MessageheaderResponseRequest.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertMessageheaderResponseRequest(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.MessageDefinition.MessageheaderResponseRequestEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ALWAYS: - tgt.setValue(org.hl7.fhir.r4b.model.MessageDefinition.MessageheaderResponseRequest.ALWAYS); - break; - case ONERROR: - tgt.setValue(org.hl7.fhir.r4b.model.MessageDefinition.MessageheaderResponseRequest.ONERROR); - break; - case NEVER: - tgt.setValue(org.hl7.fhir.r4b.model.MessageDefinition.MessageheaderResponseRequest.NEVER); - break; - case ONSUCCESS: - tgt.setValue(org.hl7.fhir.r4b.model.MessageDefinition.MessageheaderResponseRequest.ONSUCCESS); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.MessageDefinition.MessageheaderResponseRequest.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.MessageDefinition.MessageheaderResponseRequestEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ALWAYS: + tgt.setValue(org.hl7.fhir.r4b.model.MessageDefinition.MessageheaderResponseRequest.ALWAYS); + break; + case ONERROR: + tgt.setValue(org.hl7.fhir.r4b.model.MessageDefinition.MessageheaderResponseRequest.ONERROR); + break; + case NEVER: + tgt.setValue(org.hl7.fhir.r4b.model.MessageDefinition.MessageheaderResponseRequest.NEVER); + break; + case ONSUCCESS: + tgt.setValue(org.hl7.fhir.r4b.model.MessageDefinition.MessageheaderResponseRequest.ONSUCCESS); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.MessageDefinition.MessageheaderResponseRequest.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.MessageDefinition.MessageDefinitionFocusComponent convertMessageDefinitionFocusComponent(org.hl7.fhir.r4b.model.MessageDefinition.MessageDefinitionFocusComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MessageHeader43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MessageHeader43_50.java index c4b65d6d5a..8806ebfdcc 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MessageHeader43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MessageHeader43_50.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Url43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.MessageHeader; /* Copyright (c) 2011+, HL7, Inc. @@ -195,46 +197,54 @@ public static org.hl7.fhir.r4b.model.MessageHeader.MessageHeaderResponseComponen } static public org.hl7.fhir.r5.model.Enumeration convertResponseType(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.MessageHeader.ResponseTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case OK: - tgt.setValue(org.hl7.fhir.r5.model.MessageHeader.ResponseType.OK); - break; - case TRANSIENTERROR: - tgt.setValue(org.hl7.fhir.r5.model.MessageHeader.ResponseType.TRANSIENTERROR); - break; - case FATALERROR: - tgt.setValue(org.hl7.fhir.r5.model.MessageHeader.ResponseType.FATALERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.MessageHeader.ResponseType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new MessageHeader.ResponseTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OK: + tgt.setValue(MessageHeader.ResponseType.OK); + break; + case TRANSIENTERROR: + tgt.setValue(MessageHeader.ResponseType.TRANSIENTERROR); + break; + case FATALERROR: + tgt.setValue(MessageHeader.ResponseType.FATALERROR); + break; + default: + tgt.setValue(MessageHeader.ResponseType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertResponseType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.MessageHeader.ResponseTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case OK: - tgt.setValue(org.hl7.fhir.r4b.model.MessageHeader.ResponseType.OK); - break; - case TRANSIENTERROR: - tgt.setValue(org.hl7.fhir.r4b.model.MessageHeader.ResponseType.TRANSIENTERROR); - break; - case FATALERROR: - tgt.setValue(org.hl7.fhir.r4b.model.MessageHeader.ResponseType.FATALERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.MessageHeader.ResponseType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.MessageHeader.ResponseTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OK: + tgt.setValue(org.hl7.fhir.r4b.model.MessageHeader.ResponseType.OK); + break; + case TRANSIENTERROR: + tgt.setValue(org.hl7.fhir.r4b.model.MessageHeader.ResponseType.TRANSIENTERROR); + break; + case FATALERROR: + tgt.setValue(org.hl7.fhir.r4b.model.MessageHeader.ResponseType.FATALERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.MessageHeader.ResponseType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/NamingSystem43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/NamingSystem43_50.java index 90835c1577..ac55303f68 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/NamingSystem43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/NamingSystem43_50.java @@ -13,6 +13,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4b.model.Extension; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.NamingSystem; /* Copyright (c) 2011+, HL7, Inc. @@ -132,47 +134,55 @@ public static org.hl7.fhir.r4b.model.NamingSystem convertNamingSystem(org.hl7.fh } static public org.hl7.fhir.r5.model.Enumeration convertNamingSystemType(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.NamingSystem.NamingSystemTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case CODESYSTEM: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemType.CODESYSTEM); - break; - case IDENTIFIER: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemType.IDENTIFIER); - break; - case ROOT: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemType.ROOT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new NamingSystem.NamingSystemTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CODESYSTEM: + tgt.setValue(NamingSystem.NamingSystemType.CODESYSTEM); + break; + case IDENTIFIER: + tgt.setValue(NamingSystem.NamingSystemType.IDENTIFIER); + break; + case ROOT: + tgt.setValue(NamingSystem.NamingSystemType.ROOT); + break; + default: + tgt.setValue(NamingSystem.NamingSystemType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertNamingSystemType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.NamingSystem.NamingSystemTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case CODESYSTEM: - tgt.setValue(org.hl7.fhir.r4b.model.NamingSystem.NamingSystemType.CODESYSTEM); - break; - case IDENTIFIER: - tgt.setValue(org.hl7.fhir.r4b.model.NamingSystem.NamingSystemType.IDENTIFIER); - break; - case ROOT: - tgt.setValue(org.hl7.fhir.r4b.model.NamingSystem.NamingSystemType.ROOT); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.NamingSystem.NamingSystemType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.NamingSystem.NamingSystemTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CODESYSTEM: + tgt.setValue(org.hl7.fhir.r4b.model.NamingSystem.NamingSystemType.CODESYSTEM); + break; + case IDENTIFIER: + tgt.setValue(org.hl7.fhir.r4b.model.NamingSystem.NamingSystemType.IDENTIFIER); + break; + case ROOT: + tgt.setValue(org.hl7.fhir.r4b.model.NamingSystem.NamingSystemType.ROOT); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.NamingSystem.NamingSystemType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.NamingSystem.NamingSystemUniqueIdComponent convertNamingSystemUniqueIdComponent(org.hl7.fhir.r4b.model.NamingSystem.NamingSystemUniqueIdComponent src) throws FHIRException { @@ -212,52 +222,60 @@ public static org.hl7.fhir.r4b.model.NamingSystem.NamingSystemUniqueIdComponent } static public org.hl7.fhir.r5.model.Enumeration convertNamingSystemIdentifierType(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case OID: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierType.OID); - break; - case UUID: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierType.UUID); - break; - case URI: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierType.URI); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierType.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.NamingSystem.NamingSystemIdentifierType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new NamingSystem.NamingSystemIdentifierTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OID: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.OID); + break; + case UUID: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.UUID); + break; + case URI: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.URI); + break; + case OTHER: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.OTHER); + break; + default: + tgt.setValue(NamingSystem.NamingSystemIdentifierType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertNamingSystemIdentifierType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.NamingSystem.NamingSystemIdentifierTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case OID: - tgt.setValue(org.hl7.fhir.r4b.model.NamingSystem.NamingSystemIdentifierType.OID); - break; - case UUID: - tgt.setValue(org.hl7.fhir.r4b.model.NamingSystem.NamingSystemIdentifierType.UUID); - break; - case URI: - tgt.setValue(org.hl7.fhir.r4b.model.NamingSystem.NamingSystemIdentifierType.URI); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.r4b.model.NamingSystem.NamingSystemIdentifierType.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.NamingSystem.NamingSystemIdentifierType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.NamingSystem.NamingSystemIdentifierTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OID: + tgt.setValue(org.hl7.fhir.r4b.model.NamingSystem.NamingSystemIdentifierType.OID); + break; + case UUID: + tgt.setValue(org.hl7.fhir.r4b.model.NamingSystem.NamingSystemIdentifierType.UUID); + break; + case URI: + tgt.setValue(org.hl7.fhir.r4b.model.NamingSystem.NamingSystemIdentifierType.URI); + break; + case OTHER: + tgt.setValue(org.hl7.fhir.r4b.model.NamingSystem.NamingSystemIdentifierType.OTHER); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.NamingSystem.NamingSystemIdentifierType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/NutritionOrder43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/NutritionOrder43_50.java index efca42402b..bc0c4dfc6d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/NutritionOrder43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/NutritionOrder43_50.java @@ -12,6 +12,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -125,151 +127,167 @@ public static org.hl7.fhir.r4b.model.NutritionOrder convertNutritionOrder(org.hl } static public org.hl7.fhir.r5.model.Enumeration convertNutritionOrderStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ONHOLD); - break; - case REVOKED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.REVOKED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.RequestStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(Enumerations.RequestStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(Enumerations.RequestStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(Enumerations.RequestStatus.ONHOLD); + break; + case REVOKED: + tgt.setValue(Enumerations.RequestStatus.REVOKED); + break; + case COMPLETED: + tgt.setValue(Enumerations.RequestStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.RequestStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Enumerations.RequestStatus.UNKNOWN); + break; + default: + tgt.setValue(Enumerations.RequestStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertNutritionOrderStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ONHOLD); - break; - case REVOKED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.REVOKED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ONHOLD); + break; + case REVOKED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.REVOKED); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertNutritiionOrderIntent(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestIntentEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.PROPOSAL); - break; - case PLAN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.PLAN); - break; - case DIRECTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.DIRECTIVE); - break; - case ORDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORDER); - break; - case ORIGINALORDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORIGINALORDER); - break; - case REFLEXORDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.REFLEXORDER); - break; - case FILLERORDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.FILLERORDER); - break; - case INSTANCEORDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.INSTANCEORDER); - break; - case OPTION: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.OPTION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.RequestIntentEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSAL: + tgt.setValue(Enumerations.RequestIntent.PROPOSAL); + break; + case PLAN: + tgt.setValue(Enumerations.RequestIntent.PLAN); + break; + case DIRECTIVE: + tgt.setValue(Enumerations.RequestIntent.DIRECTIVE); + break; + case ORDER: + tgt.setValue(Enumerations.RequestIntent.ORDER); + break; + case ORIGINALORDER: + tgt.setValue(Enumerations.RequestIntent.ORIGINALORDER); + break; + case REFLEXORDER: + tgt.setValue(Enumerations.RequestIntent.REFLEXORDER); + break; + case FILLERORDER: + tgt.setValue(Enumerations.RequestIntent.FILLERORDER); + break; + case INSTANCEORDER: + tgt.setValue(Enumerations.RequestIntent.INSTANCEORDER); + break; + case OPTION: + tgt.setValue(Enumerations.RequestIntent.OPTION); + break; + default: + tgt.setValue(Enumerations.RequestIntent.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertNutritiionOrderIntent(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestIntentEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSAL: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.PROPOSAL); - break; - case PLAN: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.PLAN); - break; - case DIRECTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.DIRECTIVE); - break; - case ORDER: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.ORDER); - break; - case ORIGINALORDER: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.ORIGINALORDER); - break; - case REFLEXORDER: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.REFLEXORDER); - break; - case FILLERORDER: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.FILLERORDER); - break; - case INSTANCEORDER: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.INSTANCEORDER); - break; - case OPTION: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.OPTION); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestIntentEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSAL: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.PROPOSAL); + break; + case PLAN: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.PLAN); + break; + case DIRECTIVE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.DIRECTIVE); + break; + case ORDER: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.ORDER); + break; + case ORIGINALORDER: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.ORIGINALORDER); + break; + case REFLEXORDER: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.REFLEXORDER); + break; + case FILLERORDER: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.FILLERORDER); + break; + case INSTANCEORDER: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.INSTANCEORDER); + break; + case OPTION: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.OPTION); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietComponent convertNutritionOrderOralDietComponent(org.hl7.fhir.r4b.model.NutritionOrder.NutritionOrderOralDietComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Observation43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Observation43_50.java index e278c3f09c..9d80ce4041 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Observation43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Observation43_50.java @@ -10,6 +10,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -145,77 +147,85 @@ public static org.hl7.fhir.r4b.model.Observation convertObservation(org.hl7.fhir } static public org.hl7.fhir.r5.model.Enumeration convertObservationStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ObservationStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.REGISTERED); - break; - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.AMENDED); - break; - case CORRECTED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.CORRECTED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ObservationStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(Enumerations.ObservationStatus.REGISTERED); + break; + case PRELIMINARY: + tgt.setValue(Enumerations.ObservationStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(Enumerations.ObservationStatus.FINAL); + break; + case AMENDED: + tgt.setValue(Enumerations.ObservationStatus.AMENDED); + break; + case CORRECTED: + tgt.setValue(Enumerations.ObservationStatus.CORRECTED); + break; + case CANCELLED: + tgt.setValue(Enumerations.ObservationStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.ObservationStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Enumerations.ObservationStatus.UNKNOWN); + break; + default: + tgt.setValue(Enumerations.ObservationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertObservationStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.ObservationStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.REGISTERED); - break; - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.AMENDED); - break; - case CORRECTED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.CORRECTED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.ObservationStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.REGISTERED); + break; + case PRELIMINARY: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.FINAL); + break; + case AMENDED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.AMENDED); + break; + case CORRECTED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.CORRECTED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Observation.ObservationReferenceRangeComponent convertObservationReferenceRangeComponent(org.hl7.fhir.r4b.model.Observation.ObservationReferenceRangeComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ObservationDefinition43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ObservationDefinition43_50.java index ca19ada921..65f18dad0a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ObservationDefinition43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ObservationDefinition43_50.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Boolean43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.ObservationDefinition; /* Copyright (c) 2011+, HL7, Inc. @@ -114,95 +116,103 @@ public static org.hl7.fhir.r4b.model.ObservationDefinition convertObservationDef } static public org.hl7.fhir.r5.model.Enumeration convertObservationDataType(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case QUANTITY: - tgt.setValue(org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.QUANTITY); - break; - case CODEABLECONCEPT: - tgt.setValue(org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.CODEABLECONCEPT); - break; - case STRING: - tgt.setValue(org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.STRING); - break; - case BOOLEAN: - tgt.setValue(org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.BOOLEAN); - break; - case INTEGER: - tgt.setValue(org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.INTEGER); - break; - case RANGE: - tgt.setValue(org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.RANGE); - break; - case RATIO: - tgt.setValue(org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.RATIO); - break; - case SAMPLEDDATA: - tgt.setValue(org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.SAMPLEDDATA); - break; - case TIME: - tgt.setValue(org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.TIME); - break; - case DATETIME: - tgt.setValue(org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.DATETIME); - break; - case PERIOD: - tgt.setValue(org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.PERIOD); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ObservationDefinition.ObservationDataType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ObservationDefinition.ObservationDataTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case QUANTITY: + tgt.setValue(ObservationDefinition.ObservationDataType.QUANTITY); + break; + case CODEABLECONCEPT: + tgt.setValue(ObservationDefinition.ObservationDataType.CODEABLECONCEPT); + break; + case STRING: + tgt.setValue(ObservationDefinition.ObservationDataType.STRING); + break; + case BOOLEAN: + tgt.setValue(ObservationDefinition.ObservationDataType.BOOLEAN); + break; + case INTEGER: + tgt.setValue(ObservationDefinition.ObservationDataType.INTEGER); + break; + case RANGE: + tgt.setValue(ObservationDefinition.ObservationDataType.RANGE); + break; + case RATIO: + tgt.setValue(ObservationDefinition.ObservationDataType.RATIO); + break; + case SAMPLEDDATA: + tgt.setValue(ObservationDefinition.ObservationDataType.SAMPLEDDATA); + break; + case TIME: + tgt.setValue(ObservationDefinition.ObservationDataType.TIME); + break; + case DATETIME: + tgt.setValue(ObservationDefinition.ObservationDataType.DATETIME); + break; + case PERIOD: + tgt.setValue(ObservationDefinition.ObservationDataType.PERIOD); + break; + default: + tgt.setValue(ObservationDefinition.ObservationDataType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertObservationDataType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.ObservationDefinition.ObservationDataTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case QUANTITY: - tgt.setValue(org.hl7.fhir.r4b.model.ObservationDefinition.ObservationDataType.QUANTITY); - break; - case CODEABLECONCEPT: - tgt.setValue(org.hl7.fhir.r4b.model.ObservationDefinition.ObservationDataType.CODEABLECONCEPT); - break; - case STRING: - tgt.setValue(org.hl7.fhir.r4b.model.ObservationDefinition.ObservationDataType.STRING); - break; - case BOOLEAN: - tgt.setValue(org.hl7.fhir.r4b.model.ObservationDefinition.ObservationDataType.BOOLEAN); - break; - case INTEGER: - tgt.setValue(org.hl7.fhir.r4b.model.ObservationDefinition.ObservationDataType.INTEGER); - break; - case RANGE: - tgt.setValue(org.hl7.fhir.r4b.model.ObservationDefinition.ObservationDataType.RANGE); - break; - case RATIO: - tgt.setValue(org.hl7.fhir.r4b.model.ObservationDefinition.ObservationDataType.RATIO); - break; - case SAMPLEDDATA: - tgt.setValue(org.hl7.fhir.r4b.model.ObservationDefinition.ObservationDataType.SAMPLEDDATA); - break; - case TIME: - tgt.setValue(org.hl7.fhir.r4b.model.ObservationDefinition.ObservationDataType.TIME); - break; - case DATETIME: - tgt.setValue(org.hl7.fhir.r4b.model.ObservationDefinition.ObservationDataType.DATETIME); - break; - case PERIOD: - tgt.setValue(org.hl7.fhir.r4b.model.ObservationDefinition.ObservationDataType.PERIOD); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.ObservationDefinition.ObservationDataType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.ObservationDefinition.ObservationDataTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case QUANTITY: + tgt.setValue(org.hl7.fhir.r4b.model.ObservationDefinition.ObservationDataType.QUANTITY); + break; + case CODEABLECONCEPT: + tgt.setValue(org.hl7.fhir.r4b.model.ObservationDefinition.ObservationDataType.CODEABLECONCEPT); + break; + case STRING: + tgt.setValue(org.hl7.fhir.r4b.model.ObservationDefinition.ObservationDataType.STRING); + break; + case BOOLEAN: + tgt.setValue(org.hl7.fhir.r4b.model.ObservationDefinition.ObservationDataType.BOOLEAN); + break; + case INTEGER: + tgt.setValue(org.hl7.fhir.r4b.model.ObservationDefinition.ObservationDataType.INTEGER); + break; + case RANGE: + tgt.setValue(org.hl7.fhir.r4b.model.ObservationDefinition.ObservationDataType.RANGE); + break; + case RATIO: + tgt.setValue(org.hl7.fhir.r4b.model.ObservationDefinition.ObservationDataType.RATIO); + break; + case SAMPLEDDATA: + tgt.setValue(org.hl7.fhir.r4b.model.ObservationDefinition.ObservationDataType.SAMPLEDDATA); + break; + case TIME: + tgt.setValue(org.hl7.fhir.r4b.model.ObservationDefinition.ObservationDataType.TIME); + break; + case DATETIME: + tgt.setValue(org.hl7.fhir.r4b.model.ObservationDefinition.ObservationDataType.DATETIME); + break; + case PERIOD: + tgt.setValue(org.hl7.fhir.r4b.model.ObservationDefinition.ObservationDataType.PERIOD); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.ObservationDefinition.ObservationDataType.NULL); + break; + } + } + return tgt; } @@ -253,46 +263,54 @@ static public org.hl7.fhir.r4b.model.Enumeration convertObservationRangeCategory(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ObservationDefinition.ObservationRangeCategoryEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case REFERENCE: - tgt.setValue(org.hl7.fhir.r5.model.ObservationDefinition.ObservationRangeCategory.REFERENCE); - break; - case CRITICAL: - tgt.setValue(org.hl7.fhir.r5.model.ObservationDefinition.ObservationRangeCategory.CRITICAL); - break; - case ABSOLUTE: - tgt.setValue(org.hl7.fhir.r5.model.ObservationDefinition.ObservationRangeCategory.ABSOLUTE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.ObservationDefinition.ObservationRangeCategory.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new ObservationDefinition.ObservationRangeCategoryEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REFERENCE: + tgt.setValue(ObservationDefinition.ObservationRangeCategory.REFERENCE); + break; + case CRITICAL: + tgt.setValue(ObservationDefinition.ObservationRangeCategory.CRITICAL); + break; + case ABSOLUTE: + tgt.setValue(ObservationDefinition.ObservationRangeCategory.ABSOLUTE); + break; + default: + tgt.setValue(ObservationDefinition.ObservationRangeCategory.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertObservationRangeCategory(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.ObservationDefinition.ObservationRangeCategoryEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case REFERENCE: - tgt.setValue(org.hl7.fhir.r4b.model.ObservationDefinition.ObservationRangeCategory.REFERENCE); - break; - case CRITICAL: - tgt.setValue(org.hl7.fhir.r4b.model.ObservationDefinition.ObservationRangeCategory.CRITICAL); - break; - case ABSOLUTE: - tgt.setValue(org.hl7.fhir.r4b.model.ObservationDefinition.ObservationRangeCategory.ABSOLUTE); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.ObservationDefinition.ObservationRangeCategory.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.ObservationDefinition.ObservationRangeCategoryEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REFERENCE: + tgt.setValue(org.hl7.fhir.r4b.model.ObservationDefinition.ObservationRangeCategory.REFERENCE); + break; + case CRITICAL: + tgt.setValue(org.hl7.fhir.r4b.model.ObservationDefinition.ObservationRangeCategory.CRITICAL); + break; + case ABSOLUTE: + tgt.setValue(org.hl7.fhir.r4b.model.ObservationDefinition.ObservationRangeCategory.ABSOLUTE); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.ObservationDefinition.ObservationRangeCategory.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/OperationDefinition43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/OperationDefinition43_50.java index ab662c83fc..9fd2a6358c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/OperationDefinition43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/OperationDefinition43_50.java @@ -15,8 +15,10 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; import org.hl7.fhir.r5.model.Enumerations.VersionIndependentResourceTypesAll; import org.hl7.fhir.r5.model.Enumerations.VersionIndependentResourceTypesAllEnumFactory; +import org.hl7.fhir.r5.model.OperationDefinition; /* Copyright (c) 2011+, HL7, Inc. @@ -168,41 +170,49 @@ public static org.hl7.fhir.r4b.model.OperationDefinition convertOperationDefinit } static public org.hl7.fhir.r5.model.Enumeration convertOperationKind(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.OperationDefinition.OperationKindEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case OPERATION: - tgt.setValue(org.hl7.fhir.r5.model.OperationDefinition.OperationKind.OPERATION); - break; - case QUERY: - tgt.setValue(org.hl7.fhir.r5.model.OperationDefinition.OperationKind.QUERY); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.OperationDefinition.OperationKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new OperationDefinition.OperationKindEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OPERATION: + tgt.setValue(OperationDefinition.OperationKind.OPERATION); + break; + case QUERY: + tgt.setValue(OperationDefinition.OperationKind.QUERY); + break; + default: + tgt.setValue(OperationDefinition.OperationKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertOperationKind(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.OperationDefinition.OperationKindEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case OPERATION: - tgt.setValue(org.hl7.fhir.r4b.model.OperationDefinition.OperationKind.OPERATION); - break; - case QUERY: - tgt.setValue(org.hl7.fhir.r4b.model.OperationDefinition.OperationKind.QUERY); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.OperationDefinition.OperationKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.OperationDefinition.OperationKindEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OPERATION: + tgt.setValue(org.hl7.fhir.r4b.model.OperationDefinition.OperationKind.OPERATION); + break; + case QUERY: + tgt.setValue(org.hl7.fhir.r4b.model.OperationDefinition.OperationKind.QUERY); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.OperationDefinition.OperationKind.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterComponent convertOperationDefinitionParameterComponent(org.hl7.fhir.r4b.model.OperationDefinition.OperationDefinitionParameterComponent src) throws FHIRException { @@ -268,41 +278,49 @@ public static org.hl7.fhir.r4b.model.OperationDefinition.OperationDefinitionPara } static public org.hl7.fhir.r5.model.Enumeration convertOperationParameterUse(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.OperationParameterUseEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case IN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.OperationParameterUse.IN); - break; - case OUT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.OperationParameterUse.OUT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.OperationParameterUse.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.OperationParameterUseEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case IN: + tgt.setValue(Enumerations.OperationParameterUse.IN); + break; + case OUT: + tgt.setValue(Enumerations.OperationParameterUse.OUT); + break; + default: + tgt.setValue(Enumerations.OperationParameterUse.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertOperationParameterUse(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.OperationParameterUseEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case IN: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.OperationParameterUse.IN); - break; - case OUT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.OperationParameterUse.OUT); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.OperationParameterUse.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.OperationParameterUseEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case IN: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.OperationParameterUse.IN); + break; + case OUT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.OperationParameterUse.OUT); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.OperationParameterUse.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterBindingComponent convertOperationDefinitionParameterBindingComponent(org.hl7.fhir.r4b.model.OperationDefinition.OperationDefinitionParameterBindingComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/OperationOutcome43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/OperationOutcome43_50.java index 58b80df1a1..09eaf22d6b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/OperationOutcome43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/OperationOutcome43_50.java @@ -4,6 +4,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.OperationOutcome; /* Copyright (c) 2011+, HL7, Inc. @@ -95,264 +97,280 @@ public static org.hl7.fhir.r4b.model.OperationOutcome.OperationOutcomeIssueCompo } static public org.hl7.fhir.r5.model.Enumeration convertIssueSeverity(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.OperationOutcome.IssueSeverityEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case FATAL: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.FATAL); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.ERROR); - break; - case WARNING: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.WARNING); - break; - case INFORMATION: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.INFORMATION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new OperationOutcome.IssueSeverityEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FATAL: + tgt.setValue(OperationOutcome.IssueSeverity.FATAL); + break; + case ERROR: + tgt.setValue(OperationOutcome.IssueSeverity.ERROR); + break; + case WARNING: + tgt.setValue(OperationOutcome.IssueSeverity.WARNING); + break; + case INFORMATION: + tgt.setValue(OperationOutcome.IssueSeverity.INFORMATION); + break; + default: + tgt.setValue(OperationOutcome.IssueSeverity.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertIssueSeverity(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.OperationOutcome.IssueSeverityEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case FATAL: - tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueSeverity.FATAL); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueSeverity.ERROR); - break; - case WARNING: - tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueSeverity.WARNING); - break; - case INFORMATION: - tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueSeverity.INFORMATION); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueSeverity.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.OperationOutcome.IssueSeverityEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FATAL: + tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueSeverity.FATAL); + break; + case ERROR: + tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueSeverity.ERROR); + break; + case WARNING: + tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueSeverity.WARNING); + break; + case INFORMATION: + tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueSeverity.INFORMATION); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueSeverity.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertIssueType(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.OperationOutcome.IssueTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case INVALID: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.INVALID); - break; - case STRUCTURE: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.STRUCTURE); - break; - case REQUIRED: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.REQUIRED); - break; - case VALUE: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.VALUE); - break; - case INVARIANT: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.INVARIANT); - break; - case SECURITY: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.SECURITY); - break; - case LOGIN: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.LOGIN); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.UNKNOWN); - break; - case EXPIRED: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.EXPIRED); - break; - case FORBIDDEN: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.FORBIDDEN); - break; - case SUPPRESSED: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.SUPPRESSED); - break; - case PROCESSING: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.PROCESSING); - break; - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.NOTSUPPORTED); - break; - case DUPLICATE: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.DUPLICATE); - break; - case MULTIPLEMATCHES: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.MULTIPLEMATCHES); - break; - case NOTFOUND: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.NOTFOUND); - break; - case DELETED: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.DELETED); - break; - case TOOLONG: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.TOOLONG); - break; - case CODEINVALID: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.CODEINVALID); - break; - case EXTENSION: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.EXTENSION); - break; - case TOOCOSTLY: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.TOOCOSTLY); - break; - case BUSINESSRULE: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.BUSINESSRULE); - break; - case CONFLICT: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.CONFLICT); - break; - case TRANSIENT: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.TRANSIENT); - break; - case LOCKERROR: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.LOCKERROR); - break; - case NOSTORE: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.NOSTORE); - break; - case EXCEPTION: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.EXCEPTION); - break; - case TIMEOUT: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.TIMEOUT); - break; - case INCOMPLETE: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.INCOMPLETE); - break; - case THROTTLED: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.THROTTLED); - break; - case INFORMATIONAL: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.INFORMATIONAL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.OperationOutcome.IssueType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new OperationOutcome.IssueTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INVALID: + tgt.setValue(OperationOutcome.IssueType.INVALID); + break; + case STRUCTURE: + tgt.setValue(OperationOutcome.IssueType.STRUCTURE); + break; + case REQUIRED: + tgt.setValue(OperationOutcome.IssueType.REQUIRED); + break; + case VALUE: + tgt.setValue(OperationOutcome.IssueType.VALUE); + break; + case INVARIANT: + tgt.setValue(OperationOutcome.IssueType.INVARIANT); + break; + case SECURITY: + tgt.setValue(OperationOutcome.IssueType.SECURITY); + break; + case LOGIN: + tgt.setValue(OperationOutcome.IssueType.LOGIN); + break; + case UNKNOWN: + tgt.setValue(OperationOutcome.IssueType.UNKNOWN); + break; + case EXPIRED: + tgt.setValue(OperationOutcome.IssueType.EXPIRED); + break; + case FORBIDDEN: + tgt.setValue(OperationOutcome.IssueType.FORBIDDEN); + break; + case SUPPRESSED: + tgt.setValue(OperationOutcome.IssueType.SUPPRESSED); + break; + case PROCESSING: + tgt.setValue(OperationOutcome.IssueType.PROCESSING); + break; + case NOTSUPPORTED: + tgt.setValue(OperationOutcome.IssueType.NOTSUPPORTED); + break; + case DUPLICATE: + tgt.setValue(OperationOutcome.IssueType.DUPLICATE); + break; + case MULTIPLEMATCHES: + tgt.setValue(OperationOutcome.IssueType.MULTIPLEMATCHES); + break; + case NOTFOUND: + tgt.setValue(OperationOutcome.IssueType.NOTFOUND); + break; + case DELETED: + tgt.setValue(OperationOutcome.IssueType.DELETED); + break; + case TOOLONG: + tgt.setValue(OperationOutcome.IssueType.TOOLONG); + break; + case CODEINVALID: + tgt.setValue(OperationOutcome.IssueType.CODEINVALID); + break; + case EXTENSION: + tgt.setValue(OperationOutcome.IssueType.EXTENSION); + break; + case TOOCOSTLY: + tgt.setValue(OperationOutcome.IssueType.TOOCOSTLY); + break; + case BUSINESSRULE: + tgt.setValue(OperationOutcome.IssueType.BUSINESSRULE); + break; + case CONFLICT: + tgt.setValue(OperationOutcome.IssueType.CONFLICT); + break; + case TRANSIENT: + tgt.setValue(OperationOutcome.IssueType.TRANSIENT); + break; + case LOCKERROR: + tgt.setValue(OperationOutcome.IssueType.LOCKERROR); + break; + case NOSTORE: + tgt.setValue(OperationOutcome.IssueType.NOSTORE); + break; + case EXCEPTION: + tgt.setValue(OperationOutcome.IssueType.EXCEPTION); + break; + case TIMEOUT: + tgt.setValue(OperationOutcome.IssueType.TIMEOUT); + break; + case INCOMPLETE: + tgt.setValue(OperationOutcome.IssueType.INCOMPLETE); + break; + case THROTTLED: + tgt.setValue(OperationOutcome.IssueType.THROTTLED); + break; + case INFORMATIONAL: + tgt.setValue(OperationOutcome.IssueType.INFORMATIONAL); + break; + default: + tgt.setValue(OperationOutcome.IssueType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertIssueType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.OperationOutcome.IssueTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case INVALID: - tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.INVALID); - break; - case STRUCTURE: - tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.STRUCTURE); - break; - case REQUIRED: - tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.REQUIRED); - break; - case VALUE: - tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.VALUE); - break; - case INVARIANT: - tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.INVARIANT); - break; - case SECURITY: - tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.SECURITY); - break; - case LOGIN: - tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.LOGIN); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.UNKNOWN); - break; - case EXPIRED: - tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.EXPIRED); - break; - case FORBIDDEN: - tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.FORBIDDEN); - break; - case SUPPRESSED: - tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.SUPPRESSED); - break; - case PROCESSING: - tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.PROCESSING); - break; - case NOTSUPPORTED: - tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.NOTSUPPORTED); - break; - case DUPLICATE: - tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.DUPLICATE); - break; - case MULTIPLEMATCHES: - tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.MULTIPLEMATCHES); - break; - case NOTFOUND: - tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.NOTFOUND); - break; - case DELETED: - tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.DELETED); - break; - case TOOLONG: - tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.TOOLONG); - break; - case CODEINVALID: - tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.CODEINVALID); - break; - case EXTENSION: - tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.EXTENSION); - break; - case TOOCOSTLY: - tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.TOOCOSTLY); - break; - case BUSINESSRULE: - tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.BUSINESSRULE); - break; - case CONFLICT: - tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.CONFLICT); - break; - case TRANSIENT: - tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.TRANSIENT); - break; - case LOCKERROR: - tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.LOCKERROR); - break; - case NOSTORE: - tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.NOSTORE); - break; - case EXCEPTION: - tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.EXCEPTION); - break; - case TIMEOUT: - tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.TIMEOUT); - break; - case INCOMPLETE: - tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.INCOMPLETE); - break; - case THROTTLED: - tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.THROTTLED); - break; - case INFORMATIONAL: - tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.INFORMATIONAL); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.OperationOutcome.IssueTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INVALID: + tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.INVALID); + break; + case STRUCTURE: + tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.STRUCTURE); + break; + case REQUIRED: + tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.REQUIRED); + break; + case VALUE: + tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.VALUE); + break; + case INVARIANT: + tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.INVARIANT); + break; + case SECURITY: + tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.SECURITY); + break; + case LOGIN: + tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.LOGIN); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.UNKNOWN); + break; + case EXPIRED: + tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.EXPIRED); + break; + case FORBIDDEN: + tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.FORBIDDEN); + break; + case SUPPRESSED: + tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.SUPPRESSED); + break; + case PROCESSING: + tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.PROCESSING); + break; + case NOTSUPPORTED: + tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.NOTSUPPORTED); + break; + case DUPLICATE: + tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.DUPLICATE); + break; + case MULTIPLEMATCHES: + tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.MULTIPLEMATCHES); + break; + case NOTFOUND: + tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.NOTFOUND); + break; + case DELETED: + tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.DELETED); + break; + case TOOLONG: + tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.TOOLONG); + break; + case CODEINVALID: + tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.CODEINVALID); + break; + case EXTENSION: + tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.EXTENSION); + break; + case TOOCOSTLY: + tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.TOOCOSTLY); + break; + case BUSINESSRULE: + tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.BUSINESSRULE); + break; + case CONFLICT: + tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.CONFLICT); + break; + case TRANSIENT: + tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.TRANSIENT); + break; + case LOCKERROR: + tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.LOCKERROR); + break; + case NOSTORE: + tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.NOSTORE); + break; + case EXCEPTION: + tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.EXCEPTION); + break; + case TIMEOUT: + tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.TIMEOUT); + break; + case INCOMPLETE: + tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.INCOMPLETE); + break; + case THROTTLED: + tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.THROTTLED); + break; + case INFORMATIONAL: + tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.INFORMATIONAL); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.OperationOutcome.IssueType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Patient43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Patient43_50.java index 6ca2ee655c..74d91cd010 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Patient43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Patient43_50.java @@ -12,6 +12,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Date43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Patient; /* Copyright (c) 2011+, HL7, Inc. @@ -211,52 +213,60 @@ public static org.hl7.fhir.r4b.model.Patient.PatientLinkComponent convertPatient } static public org.hl7.fhir.r5.model.Enumeration convertLinkType(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Patient.LinkTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case REPLACEDBY: - tgt.setValue(org.hl7.fhir.r5.model.Patient.LinkType.REPLACEDBY); - break; - case REPLACES: - tgt.setValue(org.hl7.fhir.r5.model.Patient.LinkType.REPLACES); - break; - case REFER: - tgt.setValue(org.hl7.fhir.r5.model.Patient.LinkType.REFER); - break; - case SEEALSO: - tgt.setValue(org.hl7.fhir.r5.model.Patient.LinkType.SEEALSO); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Patient.LinkType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Patient.LinkTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REPLACEDBY: + tgt.setValue(Patient.LinkType.REPLACEDBY); + break; + case REPLACES: + tgt.setValue(Patient.LinkType.REPLACES); + break; + case REFER: + tgt.setValue(Patient.LinkType.REFER); + break; + case SEEALSO: + tgt.setValue(Patient.LinkType.SEEALSO); + break; + default: + tgt.setValue(Patient.LinkType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertLinkType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Patient.LinkTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case REPLACEDBY: - tgt.setValue(org.hl7.fhir.r4b.model.Patient.LinkType.REPLACEDBY); - break; - case REPLACES: - tgt.setValue(org.hl7.fhir.r4b.model.Patient.LinkType.REPLACES); - break; - case REFER: - tgt.setValue(org.hl7.fhir.r4b.model.Patient.LinkType.REFER); - break; - case SEEALSO: - tgt.setValue(org.hl7.fhir.r4b.model.Patient.LinkType.SEEALSO); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Patient.LinkType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Patient.LinkTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REPLACEDBY: + tgt.setValue(org.hl7.fhir.r4b.model.Patient.LinkType.REPLACEDBY); + break; + case REPLACES: + tgt.setValue(org.hl7.fhir.r4b.model.Patient.LinkType.REPLACES); + break; + case REFER: + tgt.setValue(org.hl7.fhir.r4b.model.Patient.LinkType.REFER); + break; + case SEEALSO: + tgt.setValue(org.hl7.fhir.r4b.model.Patient.LinkType.SEEALSO); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Patient.LinkType.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/PaymentNotice43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/PaymentNotice43_50.java index 981fbd10a0..93acded981 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/PaymentNotice43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/PaymentNotice43_50.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.DateTime43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -105,52 +107,60 @@ public static org.hl7.fhir.r4b.model.PaymentNotice convertPaymentNotice(org.hl7. } static public org.hl7.fhir.r5.model.Enumeration convertPaymentNoticeStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodesEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.CANCELLED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.FinancialResourceStatusCodesEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.ACTIVE); + break; + case CANCELLED: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.CANCELLED); + break; + case DRAFT: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); + break; + default: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertPaymentNoticeStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodesEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.CANCELLED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodesEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.ACTIVE); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.CANCELLED); + break; + case DRAFT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Person43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Person43_50.java index 23f4a9254e..49f1062221 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Person43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Person43_50.java @@ -10,6 +10,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Date43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Person; /* Copyright (c) 2011+, HL7, Inc. @@ -117,52 +119,60 @@ public static org.hl7.fhir.r4b.model.Person.PersonLinkComponent convertPersonLin } static public org.hl7.fhir.r5.model.Enumeration convertIdentityAssuranceLevel(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Person.IdentityAssuranceLevelEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case LEVEL1: - tgt.setValue(org.hl7.fhir.r5.model.Person.IdentityAssuranceLevel.LEVEL1); - break; - case LEVEL2: - tgt.setValue(org.hl7.fhir.r5.model.Person.IdentityAssuranceLevel.LEVEL2); - break; - case LEVEL3: - tgt.setValue(org.hl7.fhir.r5.model.Person.IdentityAssuranceLevel.LEVEL3); - break; - case LEVEL4: - tgt.setValue(org.hl7.fhir.r5.model.Person.IdentityAssuranceLevel.LEVEL4); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Person.IdentityAssuranceLevel.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Person.IdentityAssuranceLevelEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case LEVEL1: + tgt.setValue(Person.IdentityAssuranceLevel.LEVEL1); + break; + case LEVEL2: + tgt.setValue(Person.IdentityAssuranceLevel.LEVEL2); + break; + case LEVEL3: + tgt.setValue(Person.IdentityAssuranceLevel.LEVEL3); + break; + case LEVEL4: + tgt.setValue(Person.IdentityAssuranceLevel.LEVEL4); + break; + default: + tgt.setValue(Person.IdentityAssuranceLevel.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertIdentityAssuranceLevel(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Person.IdentityAssuranceLevelEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case LEVEL1: - tgt.setValue(org.hl7.fhir.r4b.model.Person.IdentityAssuranceLevel.LEVEL1); - break; - case LEVEL2: - tgt.setValue(org.hl7.fhir.r4b.model.Person.IdentityAssuranceLevel.LEVEL2); - break; - case LEVEL3: - tgt.setValue(org.hl7.fhir.r4b.model.Person.IdentityAssuranceLevel.LEVEL3); - break; - case LEVEL4: - tgt.setValue(org.hl7.fhir.r4b.model.Person.IdentityAssuranceLevel.LEVEL4); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Person.IdentityAssuranceLevel.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Person.IdentityAssuranceLevelEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case LEVEL1: + tgt.setValue(org.hl7.fhir.r4b.model.Person.IdentityAssuranceLevel.LEVEL1); + break; + case LEVEL2: + tgt.setValue(org.hl7.fhir.r4b.model.Person.IdentityAssuranceLevel.LEVEL2); + break; + case LEVEL3: + tgt.setValue(org.hl7.fhir.r4b.model.Person.IdentityAssuranceLevel.LEVEL3); + break; + case LEVEL4: + tgt.setValue(org.hl7.fhir.r4b.model.Person.IdentityAssuranceLevel.LEVEL4); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Person.IdentityAssuranceLevel.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/PlanDefinition43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/PlanDefinition43_50.java index e9f45267b5..ba12b93a90 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/PlanDefinition43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/PlanDefinition43_50.java @@ -21,6 +21,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.DataRequirement; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; import org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionInputComponent; import org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionOutputComponent; @@ -397,279 +399,327 @@ public static org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionActionComponen } static public org.hl7.fhir.r5.model.Enumeration convertRequestPriority(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestPriorityEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP); - break; - case STAT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.RequestPriorityEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(Enumerations.RequestPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(Enumerations.RequestPriority.URGENT); + break; + case ASAP: + tgt.setValue(Enumerations.RequestPriority.ASAP); + break; + case STAT: + tgt.setValue(Enumerations.RequestPriority.STAT); + break; + default: + tgt.setValue(Enumerations.RequestPriority.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertRequestPriority(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestPriorityEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.URGENT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ASAP); - break; - case STAT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.STAT); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestPriorityEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.URGENT); + break; + case ASAP: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ASAP); + break; + case STAT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.STAT); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertActionGroupingBehavior(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehaviorEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case VISUALGROUP: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior.VISUALGROUP); - break; - case LOGICALGROUP: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior.LOGICALGROUP); - break; - case SENTENCEGROUP: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior.SENTENCEGROUP); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ActionGroupingBehaviorEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case VISUALGROUP: + tgt.setValue(Enumerations.ActionGroupingBehavior.VISUALGROUP); + break; + case LOGICALGROUP: + tgt.setValue(Enumerations.ActionGroupingBehavior.LOGICALGROUP); + break; + case SENTENCEGROUP: + tgt.setValue(Enumerations.ActionGroupingBehavior.SENTENCEGROUP); + break; + default: + tgt.setValue(Enumerations.ActionGroupingBehavior.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertActionGroupingBehavior(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.ActionGroupingBehaviorEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case VISUALGROUP: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionGroupingBehavior.VISUALGROUP); - break; - case LOGICALGROUP: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionGroupingBehavior.LOGICALGROUP); - break; - case SENTENCEGROUP: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionGroupingBehavior.SENTENCEGROUP); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionGroupingBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.ActionGroupingBehaviorEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case VISUALGROUP: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionGroupingBehavior.VISUALGROUP); + break; + case LOGICALGROUP: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionGroupingBehavior.LOGICALGROUP); + break; + case SENTENCEGROUP: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionGroupingBehavior.SENTENCEGROUP); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionGroupingBehavior.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertActionSelectionBehavior(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehaviorEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ANY: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.ANY); - break; - case ALL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.ALL); - break; - case ALLORNONE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.ALLORNONE); - break; - case EXACTLYONE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.EXACTLYONE); - break; - case ATMOSTONE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.ATMOSTONE); - break; - case ONEORMORE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.ONEORMORE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ActionSelectionBehaviorEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ANY: + tgt.setValue(Enumerations.ActionSelectionBehavior.ANY); + break; + case ALL: + tgt.setValue(Enumerations.ActionSelectionBehavior.ALL); + break; + case ALLORNONE: + tgt.setValue(Enumerations.ActionSelectionBehavior.ALLORNONE); + break; + case EXACTLYONE: + tgt.setValue(Enumerations.ActionSelectionBehavior.EXACTLYONE); + break; + case ATMOSTONE: + tgt.setValue(Enumerations.ActionSelectionBehavior.ATMOSTONE); + break; + case ONEORMORE: + tgt.setValue(Enumerations.ActionSelectionBehavior.ONEORMORE); + break; + default: + tgt.setValue(Enumerations.ActionSelectionBehavior.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertActionSelectionBehavior(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.ActionSelectionBehaviorEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ANY: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionSelectionBehavior.ANY); - break; - case ALL: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionSelectionBehavior.ALL); - break; - case ALLORNONE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionSelectionBehavior.ALLORNONE); - break; - case EXACTLYONE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionSelectionBehavior.EXACTLYONE); - break; - case ATMOSTONE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionSelectionBehavior.ATMOSTONE); - break; - case ONEORMORE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionSelectionBehavior.ONEORMORE); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionSelectionBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.ActionSelectionBehaviorEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ANY: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionSelectionBehavior.ANY); + break; + case ALL: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionSelectionBehavior.ALL); + break; + case ALLORNONE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionSelectionBehavior.ALLORNONE); + break; + case EXACTLYONE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionSelectionBehavior.EXACTLYONE); + break; + case ATMOSTONE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionSelectionBehavior.ATMOSTONE); + break; + case ONEORMORE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionSelectionBehavior.ONEORMORE); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionSelectionBehavior.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertActionRequiredBehavior(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehaviorEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case MUST: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior.MUST); - break; - case COULD: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior.COULD); - break; - case MUSTUNLESSDOCUMENTED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior.MUSTUNLESSDOCUMENTED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ActionRequiredBehaviorEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MUST: + tgt.setValue(Enumerations.ActionRequiredBehavior.MUST); + break; + case COULD: + tgt.setValue(Enumerations.ActionRequiredBehavior.COULD); + break; + case MUSTUNLESSDOCUMENTED: + tgt.setValue(Enumerations.ActionRequiredBehavior.MUSTUNLESSDOCUMENTED); + break; + default: + tgt.setValue(Enumerations.ActionRequiredBehavior.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertActionRequiredBehavior(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.ActionRequiredBehaviorEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case MUST: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionRequiredBehavior.MUST); - break; - case COULD: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionRequiredBehavior.COULD); - break; - case MUSTUNLESSDOCUMENTED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionRequiredBehavior.MUSTUNLESSDOCUMENTED); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionRequiredBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.ActionRequiredBehaviorEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MUST: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionRequiredBehavior.MUST); + break; + case COULD: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionRequiredBehavior.COULD); + break; + case MUSTUNLESSDOCUMENTED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionRequiredBehavior.MUSTUNLESSDOCUMENTED); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionRequiredBehavior.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertActionPrecheckBehavior(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ActionPrecheckBehaviorEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case YES: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionPrecheckBehavior.YES); - break; - case NO: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionPrecheckBehavior.NO); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionPrecheckBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ActionPrecheckBehaviorEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case YES: + tgt.setValue(Enumerations.ActionPrecheckBehavior.YES); + break; + case NO: + tgt.setValue(Enumerations.ActionPrecheckBehavior.NO); + break; + default: + tgt.setValue(Enumerations.ActionPrecheckBehavior.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertActionPrecheckBehavior(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.ActionPrecheckBehaviorEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case YES: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionPrecheckBehavior.YES); - break; - case NO: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionPrecheckBehavior.NO); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionPrecheckBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.ActionPrecheckBehaviorEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case YES: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionPrecheckBehavior.YES); + break; + case NO: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionPrecheckBehavior.NO); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionPrecheckBehavior.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertActionCardinalityBehavior(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ActionCardinalityBehaviorEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case SINGLE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionCardinalityBehavior.SINGLE); - break; - case MULTIPLE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionCardinalityBehavior.MULTIPLE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionCardinalityBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ActionCardinalityBehaviorEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SINGLE: + tgt.setValue(Enumerations.ActionCardinalityBehavior.SINGLE); + break; + case MULTIPLE: + tgt.setValue(Enumerations.ActionCardinalityBehavior.MULTIPLE); + break; + default: + tgt.setValue(Enumerations.ActionCardinalityBehavior.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertActionCardinalityBehavior(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.ActionCardinalityBehaviorEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case SINGLE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionCardinalityBehavior.SINGLE); - break; - case MULTIPLE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionCardinalityBehavior.MULTIPLE); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionCardinalityBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.ActionCardinalityBehaviorEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SINGLE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionCardinalityBehavior.SINGLE); + break; + case MULTIPLE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionCardinalityBehavior.MULTIPLE); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionCardinalityBehavior.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionConditionComponent convertPlanDefinitionActionConditionComponent(org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionActionConditionComponent src) throws FHIRException { @@ -697,47 +747,55 @@ public static org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionActionConditio } static public org.hl7.fhir.r5.model.Enumeration convertActionConditionKind(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ActionConditionKindEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case APPLICABILITY: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionConditionKind.APPLICABILITY); - break; - case START: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionConditionKind.START); - break; - case STOP: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionConditionKind.STOP); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionConditionKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ActionConditionKindEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case APPLICABILITY: + tgt.setValue(Enumerations.ActionConditionKind.APPLICABILITY); + break; + case START: + tgt.setValue(Enumerations.ActionConditionKind.START); + break; + case STOP: + tgt.setValue(Enumerations.ActionConditionKind.STOP); + break; + default: + tgt.setValue(Enumerations.ActionConditionKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertActionConditionKind(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.ActionConditionKindEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case APPLICABILITY: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionConditionKind.APPLICABILITY); - break; - case START: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionConditionKind.START); - break; - case STOP: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionConditionKind.STOP); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionConditionKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.ActionConditionKindEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case APPLICABILITY: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionConditionKind.APPLICABILITY); + break; + case START: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionConditionKind.START); + break; + case STOP: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionConditionKind.STOP); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionConditionKind.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent convertPlanDefinitionActionRelatedActionComponent(org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent src) throws FHIRException { @@ -769,83 +827,91 @@ public static org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionActionRelatedA } static public org.hl7.fhir.r5.model.Enumeration convertActionRelationshipType(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ActionRelationshipTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case BEFORESTART: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.BEFORESTART); - break; - case BEFORE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.BEFORE); - break; - case BEFOREEND: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.BEFOREEND); - break; - case CONCURRENTWITHSTART: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.CONCURRENTWITHSTART); - break; - case CONCURRENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.CONCURRENT); - break; - case CONCURRENTWITHEND: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.CONCURRENTWITHEND); - break; - case AFTERSTART: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.AFTERSTART); - break; - case AFTER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.AFTER); - break; - case AFTEREND: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.AFTEREND); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ActionRelationshipTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case BEFORESTART: + tgt.setValue(Enumerations.ActionRelationshipType.BEFORESTART); + break; + case BEFORE: + tgt.setValue(Enumerations.ActionRelationshipType.BEFORE); + break; + case BEFOREEND: + tgt.setValue(Enumerations.ActionRelationshipType.BEFOREEND); + break; + case CONCURRENTWITHSTART: + tgt.setValue(Enumerations.ActionRelationshipType.CONCURRENTWITHSTART); + break; + case CONCURRENT: + tgt.setValue(Enumerations.ActionRelationshipType.CONCURRENT); + break; + case CONCURRENTWITHEND: + tgt.setValue(Enumerations.ActionRelationshipType.CONCURRENTWITHEND); + break; + case AFTERSTART: + tgt.setValue(Enumerations.ActionRelationshipType.AFTERSTART); + break; + case AFTER: + tgt.setValue(Enumerations.ActionRelationshipType.AFTER); + break; + case AFTEREND: + tgt.setValue(Enumerations.ActionRelationshipType.AFTEREND); + break; + default: + tgt.setValue(Enumerations.ActionRelationshipType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertActionRelationshipType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.ActionRelationshipTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case BEFORESTART: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionRelationshipType.BEFORESTART); - break; - case BEFORE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionRelationshipType.BEFORE); - break; - case BEFOREEND: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionRelationshipType.BEFOREEND); - break; - case CONCURRENTWITHSTART: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionRelationshipType.CONCURRENTWITHSTART); - break; - case CONCURRENT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionRelationshipType.CONCURRENT); - break; - case CONCURRENTWITHEND: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionRelationshipType.CONCURRENTWITHEND); - break; - case AFTERSTART: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionRelationshipType.AFTERSTART); - break; - case AFTER: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionRelationshipType.AFTER); - break; - case AFTEREND: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionRelationshipType.AFTEREND); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionRelationshipType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.ActionRelationshipTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case BEFORESTART: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionRelationshipType.BEFORESTART); + break; + case BEFORE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionRelationshipType.BEFORE); + break; + case BEFOREEND: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionRelationshipType.BEFOREEND); + break; + case CONCURRENTWITHSTART: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionRelationshipType.CONCURRENTWITHSTART); + break; + case CONCURRENT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionRelationshipType.CONCURRENT); + break; + case CONCURRENTWITHEND: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionRelationshipType.CONCURRENTWITHEND); + break; + case AFTERSTART: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionRelationshipType.AFTERSTART); + break; + case AFTER: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionRelationshipType.AFTER); + break; + case AFTEREND: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionRelationshipType.AFTEREND); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionRelationshipType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionParticipantComponent convertPlanDefinitionActionParticipantComponent(org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionActionParticipantComponent src) throws FHIRException { @@ -873,53 +939,61 @@ public static org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionActionParticip } static public org.hl7.fhir.r5.model.Enumeration convertActionParticipantType(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ActionParticipantTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PATIENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.PATIENT); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.PRACTITIONER); - break; - case RELATEDPERSON: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.RELATEDPERSON); - break; - case DEVICE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.DEVICE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ActionParticipantTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PATIENT: + tgt.setValue(Enumerations.ActionParticipantType.PATIENT); + break; + case PRACTITIONER: + tgt.setValue(Enumerations.ActionParticipantType.PRACTITIONER); + break; + case RELATEDPERSON: + tgt.setValue(Enumerations.ActionParticipantType.RELATEDPERSON); + break; + case DEVICE: + tgt.setValue(Enumerations.ActionParticipantType.DEVICE); + break; + default: + tgt.setValue(Enumerations.ActionParticipantType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertActionParticipantType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.ActionParticipantTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PATIENT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionParticipantType.PATIENT); - break; - case PRACTITIONER: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionParticipantType.PRACTITIONER); - break; - case RELATEDPERSON: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionParticipantType.RELATEDPERSON); - break; - case DEVICE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionParticipantType.DEVICE); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionParticipantType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.ActionParticipantTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PATIENT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionParticipantType.PATIENT); + break; + case PRACTITIONER: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionParticipantType.PRACTITIONER); + break; + case RELATEDPERSON: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionParticipantType.RELATEDPERSON); + break; + case DEVICE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionParticipantType.DEVICE); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionParticipantType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent convertPlanDefinitionActionDynamicValueComponent(org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Procedure43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Procedure43_50.java index 0bf5c8baa4..72b31abc55 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Procedure43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Procedure43_50.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -170,77 +172,85 @@ public static org.hl7.fhir.r4b.model.Procedure convertProcedure(org.hl7.fhir.r5. } static public org.hl7.fhir.r5.model.Enumeration convertProcedureStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.EventStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PREPARATION: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.PREPARATION); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.INPROGRESS); - break; - case NOTDONE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.NOTDONE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.ONHOLD); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.STOPPED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.EventStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PREPARATION: + tgt.setValue(Enumerations.EventStatus.PREPARATION); + break; + case INPROGRESS: + tgt.setValue(Enumerations.EventStatus.INPROGRESS); + break; + case NOTDONE: + tgt.setValue(Enumerations.EventStatus.NOTDONE); + break; + case ONHOLD: + tgt.setValue(Enumerations.EventStatus.ONHOLD); + break; + case STOPPED: + tgt.setValue(Enumerations.EventStatus.STOPPED); + break; + case COMPLETED: + tgt.setValue(Enumerations.EventStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.EventStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Enumerations.EventStatus.UNKNOWN); + break; + default: + tgt.setValue(Enumerations.EventStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertProcedureStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.EventStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PREPARATION: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.PREPARATION); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.INPROGRESS); - break; - case NOTDONE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.NOTDONE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.ONHOLD); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.STOPPED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.EventStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PREPARATION: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.PREPARATION); + break; + case INPROGRESS: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.INPROGRESS); + break; + case NOTDONE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.NOTDONE); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.ONHOLD); + break; + case STOPPED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.STOPPED); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Procedure.ProcedurePerformerComponent convertProcedurePerformerComponent(org.hl7.fhir.r4b.model.Procedure.ProcedurePerformerComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Provenance43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Provenance43_50.java index b30caf28d5..c8e7df7835 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Provenance43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Provenance43_50.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Provenance; /* Copyright (c) 2011+, HL7, Inc. @@ -152,58 +154,66 @@ public static org.hl7.fhir.r4b.model.Provenance.ProvenanceEntityComponent conver } static public org.hl7.fhir.r5.model.Enumeration convertProvenanceEntityRole(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRoleEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case DERIVATION: - tgt.setValue(org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRole.INSTANTIATES); - break; - case REVISION: - tgt.setValue(org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRole.REVISION); - break; - case QUOTATION: - tgt.setValue(org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRole.QUOTATION); - break; - case SOURCE: - tgt.setValue(org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRole.SOURCE); - break; - case REMOVAL: - tgt.setValue(org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRole.REMOVAL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Provenance.ProvenanceEntityRole.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Provenance.ProvenanceEntityRoleEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DERIVATION: + tgt.setValue(Provenance.ProvenanceEntityRole.INSTANTIATES); + break; + case REVISION: + tgt.setValue(Provenance.ProvenanceEntityRole.REVISION); + break; + case QUOTATION: + tgt.setValue(Provenance.ProvenanceEntityRole.QUOTATION); + break; + case SOURCE: + tgt.setValue(Provenance.ProvenanceEntityRole.SOURCE); + break; + case REMOVAL: + tgt.setValue(Provenance.ProvenanceEntityRole.REMOVAL); + break; + default: + tgt.setValue(Provenance.ProvenanceEntityRole.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertProvenanceEntityRole(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Provenance.ProvenanceEntityRoleEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANTIATES: - tgt.setValue(org.hl7.fhir.r4b.model.Provenance.ProvenanceEntityRole.DERIVATION); - break; - case REVISION: - tgt.setValue(org.hl7.fhir.r4b.model.Provenance.ProvenanceEntityRole.REVISION); - break; - case QUOTATION: - tgt.setValue(org.hl7.fhir.r4b.model.Provenance.ProvenanceEntityRole.QUOTATION); - break; - case SOURCE: - tgt.setValue(org.hl7.fhir.r4b.model.Provenance.ProvenanceEntityRole.SOURCE); - break; - case REMOVAL: - tgt.setValue(org.hl7.fhir.r4b.model.Provenance.ProvenanceEntityRole.REMOVAL); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Provenance.ProvenanceEntityRole.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Provenance.ProvenanceEntityRoleEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANTIATES: + tgt.setValue(org.hl7.fhir.r4b.model.Provenance.ProvenanceEntityRole.DERIVATION); + break; + case REVISION: + tgt.setValue(org.hl7.fhir.r4b.model.Provenance.ProvenanceEntityRole.REVISION); + break; + case QUOTATION: + tgt.setValue(org.hl7.fhir.r4b.model.Provenance.ProvenanceEntityRole.QUOTATION); + break; + case SOURCE: + tgt.setValue(org.hl7.fhir.r4b.model.Provenance.ProvenanceEntityRole.SOURCE); + break; + case REMOVAL: + tgt.setValue(org.hl7.fhir.r4b.model.Provenance.ProvenanceEntityRole.REMOVAL); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Provenance.ProvenanceEntityRole.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Questionnaire43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Questionnaire43_50.java index 1d8669c0d8..4aeef08245 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Questionnaire43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Questionnaire43_50.java @@ -20,6 +20,8 @@ import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemType; import org.hl7.fhir.r5.model.CodeType; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Questionnaire; import org.hl7.fhir.r5.model.Questionnaire.QuestionnaireAnswerConstraint; /* @@ -239,68 +241,72 @@ public static org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemComponent co } static public org.hl7.fhir.r5.model.Enumeration convertQuestionnaireItemType(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - tgt.addExtension(VersionConvertorConstants.EXT_QUESTIONNAIRE_ITEM_TYPE_ORIGINAL, new CodeType(src.getValueAsString())); - switch (src.getValue()) { - case GROUP: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.GROUP); - break; - case DISPLAY: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.DISPLAY); - break; - case QUESTION: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.GROUP); - break; - case BOOLEAN: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.BOOLEAN); - break; - case DECIMAL: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.DECIMAL); - break; - case INTEGER: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.INTEGER); - break; - case DATE: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.DATE); - break; - case DATETIME: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.DATETIME); - break; - case TIME: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.TIME); - break; - case STRING: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.STRING); - break; - case TEXT: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.TEXT); - break; - case URL: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.URL); - break; - case CHOICE: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.CODING); - break; - case OPENCHOICE: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.CODING); - break; - case ATTACHMENT: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.ATTACHMENT); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.REFERENCE); - break; - case QUANTITY: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.QUANTITY); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Questionnaire.QuestionnaireItemTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + tgt.addExtension(VersionConvertorConstants.EXT_QUESTIONNAIRE_ITEM_TYPE_ORIGINAL, new CodeType(src.getValueAsString())); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case GROUP: + tgt.setValue(Questionnaire.QuestionnaireItemType.GROUP); + break; + case DISPLAY: + tgt.setValue(Questionnaire.QuestionnaireItemType.DISPLAY); + break; + case QUESTION: + tgt.setValue(Questionnaire.QuestionnaireItemType.GROUP); + break; + case BOOLEAN: + tgt.setValue(Questionnaire.QuestionnaireItemType.BOOLEAN); + break; + case DECIMAL: + tgt.setValue(Questionnaire.QuestionnaireItemType.DECIMAL); + break; + case INTEGER: + tgt.setValue(Questionnaire.QuestionnaireItemType.INTEGER); + break; + case DATE: + tgt.setValue(Questionnaire.QuestionnaireItemType.DATE); + break; + case DATETIME: + tgt.setValue(Questionnaire.QuestionnaireItemType.DATETIME); + break; + case TIME: + tgt.setValue(Questionnaire.QuestionnaireItemType.TIME); + break; + case STRING: + tgt.setValue(Questionnaire.QuestionnaireItemType.STRING); + break; + case TEXT: + tgt.setValue(Questionnaire.QuestionnaireItemType.TEXT); + break; + case URL: + tgt.setValue(Questionnaire.QuestionnaireItemType.URL); + break; + case CHOICE: + tgt.setValue(Questionnaire.QuestionnaireItemType.CODING); + break; + case OPENCHOICE: + tgt.setValue(Questionnaire.QuestionnaireItemType.CODING); + break; + case ATTACHMENT: + tgt.setValue(Questionnaire.QuestionnaireItemType.ATTACHMENT); + break; + case REFERENCE: + tgt.setValue(Questionnaire.QuestionnaireItemType.REFERENCE); + break; + case QUANTITY: + tgt.setValue(Questionnaire.QuestionnaireItemType.QUANTITY); + break; + default: + tgt.setValue(Questionnaire.QuestionnaireItemType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertQuestionnaireItemType(org.hl7.fhir.r5.model.Enumeration src, QuestionnaireAnswerConstraint constraint) throws FHIRException { @@ -311,100 +317,112 @@ static public org.hl7.fhir.r4b.model.Enumeration convertEnableWhenBehavior(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Questionnaire.EnableWhenBehaviorEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ALL: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.EnableWhenBehavior.ALL); - break; - case ANY: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.EnableWhenBehavior.ANY); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.EnableWhenBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Questionnaire.EnableWhenBehaviorEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ALL: + tgt.setValue(Questionnaire.EnableWhenBehavior.ALL); + break; + case ANY: + tgt.setValue(Questionnaire.EnableWhenBehavior.ANY); + break; + default: + tgt.setValue(Questionnaire.EnableWhenBehavior.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertEnableWhenBehavior(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Questionnaire.EnableWhenBehaviorEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ALL: - tgt.setValue(org.hl7.fhir.r4b.model.Questionnaire.EnableWhenBehavior.ALL); - break; - case ANY: - tgt.setValue(org.hl7.fhir.r4b.model.Questionnaire.EnableWhenBehavior.ANY); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Questionnaire.EnableWhenBehavior.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Questionnaire.EnableWhenBehaviorEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ALL: + tgt.setValue(org.hl7.fhir.r4b.model.Questionnaire.EnableWhenBehavior.ALL); + break; + case ANY: + tgt.setValue(org.hl7.fhir.r4b.model.Questionnaire.EnableWhenBehavior.ANY); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Questionnaire.EnableWhenBehavior.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemEnableWhenComponent convertQuestionnaireItemEnableWhenComponent(org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemEnableWhenComponent src) throws FHIRException { @@ -436,71 +454,79 @@ public static org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemEnableWhenCo } static public org.hl7.fhir.r5.model.Enumeration convertQuestionnaireItemOperator(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemOperatorEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case EXISTS: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemOperator.EXISTS); - break; - case EQUAL: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemOperator.EQUAL); - break; - case NOT_EQUAL: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemOperator.NOT_EQUAL); - break; - case GREATER_THAN: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemOperator.GREATER_THAN); - break; - case LESS_THAN: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemOperator.LESS_THAN); - break; - case GREATER_OR_EQUAL: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemOperator.GREATER_OR_EQUAL); - break; - case LESS_OR_EQUAL: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemOperator.LESS_OR_EQUAL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemOperator.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Questionnaire.QuestionnaireItemOperatorEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EXISTS: + tgt.setValue(Questionnaire.QuestionnaireItemOperator.EXISTS); + break; + case EQUAL: + tgt.setValue(Questionnaire.QuestionnaireItemOperator.EQUAL); + break; + case NOT_EQUAL: + tgt.setValue(Questionnaire.QuestionnaireItemOperator.NOT_EQUAL); + break; + case GREATER_THAN: + tgt.setValue(Questionnaire.QuestionnaireItemOperator.GREATER_THAN); + break; + case LESS_THAN: + tgt.setValue(Questionnaire.QuestionnaireItemOperator.LESS_THAN); + break; + case GREATER_OR_EQUAL: + tgt.setValue(Questionnaire.QuestionnaireItemOperator.GREATER_OR_EQUAL); + break; + case LESS_OR_EQUAL: + tgt.setValue(Questionnaire.QuestionnaireItemOperator.LESS_OR_EQUAL); + break; + default: + tgt.setValue(Questionnaire.QuestionnaireItemOperator.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertQuestionnaireItemOperator(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemOperatorEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case EXISTS: - tgt.setValue(org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemOperator.EXISTS); - break; - case EQUAL: - tgt.setValue(org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemOperator.EQUAL); - break; - case NOT_EQUAL: - tgt.setValue(org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemOperator.NOT_EQUAL); - break; - case GREATER_THAN: - tgt.setValue(org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemOperator.GREATER_THAN); - break; - case LESS_THAN: - tgt.setValue(org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemOperator.LESS_THAN); - break; - case GREATER_OR_EQUAL: - tgt.setValue(org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemOperator.GREATER_OR_EQUAL); - break; - case LESS_OR_EQUAL: - tgt.setValue(org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemOperator.LESS_OR_EQUAL); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemOperator.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemOperatorEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EXISTS: + tgt.setValue(org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemOperator.EXISTS); + break; + case EQUAL: + tgt.setValue(org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemOperator.EQUAL); + break; + case NOT_EQUAL: + tgt.setValue(org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemOperator.NOT_EQUAL); + break; + case GREATER_THAN: + tgt.setValue(org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemOperator.GREATER_THAN); + break; + case LESS_THAN: + tgt.setValue(org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemOperator.LESS_THAN); + break; + case GREATER_OR_EQUAL: + tgt.setValue(org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemOperator.GREATER_OR_EQUAL); + break; + case LESS_OR_EQUAL: + tgt.setValue(org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemOperator.LESS_OR_EQUAL); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemOperator.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemAnswerOptionComponent convertQuestionnaireItemAnswerOptionComponent(org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemAnswerOptionComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/QuestionnaireResponse43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/QuestionnaireResponse43_50.java index eb2f66e2c9..4f9f71dd66 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/QuestionnaireResponse43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/QuestionnaireResponse43_50.java @@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.QuestionnaireResponse; /* Copyright (c) 2011+, HL7, Inc. @@ -97,59 +99,67 @@ public static org.hl7.fhir.r4b.model.QuestionnaireResponse convertQuestionnaireR } static public org.hl7.fhir.r5.model.Enumeration convertQuestionnaireResponseStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.ENTEREDINERROR); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.STOPPED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED); + break; + case AMENDED: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED); + break; + case ENTEREDINERROR: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.ENTEREDINERROR); + break; + case STOPPED: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.STOPPED); + break; + default: + tgt.setValue(QuestionnaireResponse.QuestionnaireResponseStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertQuestionnaireResponseStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r4b.model.QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4b.model.QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r4b.model.QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.QuestionnaireResponse.QuestionnaireResponseStatus.ENTEREDINERROR); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r4b.model.QuestionnaireResponse.QuestionnaireResponseStatus.STOPPED); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.QuestionnaireResponse.QuestionnaireResponseStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(org.hl7.fhir.r4b.model.QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4b.model.QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED); + break; + case AMENDED: + tgt.setValue(org.hl7.fhir.r4b.model.QuestionnaireResponse.QuestionnaireResponseStatus.AMENDED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.QuestionnaireResponse.QuestionnaireResponseStatus.ENTEREDINERROR); + break; + case STOPPED: + tgt.setValue(org.hl7.fhir.r4b.model.QuestionnaireResponse.QuestionnaireResponseStatus.STOPPED); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.QuestionnaireResponse.QuestionnaireResponseStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent convertQuestionnaireResponseItemComponent(org.hl7.fhir.r4b.model.QuestionnaireResponse.QuestionnaireResponseItemComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/RiskAssessment43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/RiskAssessment43_50.java index 69e412aaa2..3647a8dc7e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/RiskAssessment43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/RiskAssessment43_50.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; /* Copyright (c) 2011+, HL7, Inc. @@ -124,77 +126,85 @@ public static org.hl7.fhir.r4b.model.RiskAssessment convertRiskAssessment(org.hl } static public org.hl7.fhir.r5.model.Enumeration convertRiskAssessmentStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ObservationStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.REGISTERED); - break; - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.AMENDED); - break; - case CORRECTED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.CORRECTED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.ObservationStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(Enumerations.ObservationStatus.REGISTERED); + break; + case PRELIMINARY: + tgt.setValue(Enumerations.ObservationStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(Enumerations.ObservationStatus.FINAL); + break; + case AMENDED: + tgt.setValue(Enumerations.ObservationStatus.AMENDED); + break; + case CORRECTED: + tgt.setValue(Enumerations.ObservationStatus.CORRECTED); + break; + case CANCELLED: + tgt.setValue(Enumerations.ObservationStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.ObservationStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Enumerations.ObservationStatus.UNKNOWN); + break; + default: + tgt.setValue(Enumerations.ObservationStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertRiskAssessmentStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.ObservationStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case REGISTERED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.REGISTERED); - break; - case PRELIMINARY: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.PRELIMINARY); - break; - case FINAL: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.FINAL); - break; - case AMENDED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.AMENDED); - break; - case CORRECTED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.CORRECTED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.CANCELLED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.ObservationStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case REGISTERED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.REGISTERED); + break; + case PRELIMINARY: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.PRELIMINARY); + break; + case FINAL: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.FINAL); + break; + case AMENDED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.AMENDED); + break; + case CORRECTED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.CORRECTED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.RiskAssessment.RiskAssessmentPredictionComponent convertRiskAssessmentPredictionComponent(org.hl7.fhir.r4b.model.RiskAssessment.RiskAssessmentPredictionComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SearchParameter43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SearchParameter43_50.java index d078258b0d..e6175ca35c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SearchParameter43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SearchParameter43_50.java @@ -15,8 +15,10 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; import org.hl7.fhir.r5.model.Enumerations.VersionIndependentResourceTypesAll; import org.hl7.fhir.r5.model.Enumerations.VersionIndependentResourceTypesAllEnumFactory; +import org.hl7.fhir.r5.model.SearchParameter; /* Copyright (c) 2011+, HL7, Inc. @@ -168,231 +170,255 @@ public static org.hl7.fhir.r4b.model.SearchParameter convertSearchParameter(org. } static public org.hl7.fhir.r5.model.Enumeration convertXPathUsageType(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case NORMAL: - tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.NORMAL); - break; - case PHONETIC: - tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.PHONETIC); - break; - case NEARBY: - tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.OTHER); - break; - case DISTANCE: - tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.OTHER); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new SearchParameter.SearchProcessingModeTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NORMAL: + tgt.setValue(SearchParameter.SearchProcessingModeType.NORMAL); + break; + case PHONETIC: + tgt.setValue(SearchParameter.SearchProcessingModeType.PHONETIC); + break; + case NEARBY: + tgt.setValue(SearchParameter.SearchProcessingModeType.OTHER); + break; + case DISTANCE: + tgt.setValue(SearchParameter.SearchProcessingModeType.OTHER); + break; + case OTHER: + tgt.setValue(SearchParameter.SearchProcessingModeType.OTHER); + break; + default: + tgt.setValue(SearchParameter.SearchProcessingModeType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertXPathUsageType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.SearchParameter.XPathUsageTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case NORMAL: - tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.XPathUsageType.NORMAL); - break; - case PHONETIC: - tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.XPathUsageType.PHONETIC); - break; - case OTHER: - tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.XPathUsageType.OTHER); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.XPathUsageType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.SearchParameter.XPathUsageTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NORMAL: + tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.XPathUsageType.NORMAL); + break; + case PHONETIC: + tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.XPathUsageType.PHONETIC); + break; + case OTHER: + tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.XPathUsageType.OTHER); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.XPathUsageType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertSearchComparator(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.SearchComparatorEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case EQ: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchComparator.EQ); - break; - case NE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchComparator.NE); - break; - case GT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchComparator.GT); - break; - case LT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchComparator.LT); - break; - case GE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchComparator.GE); - break; - case LE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchComparator.LE); - break; - case SA: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchComparator.SA); - break; - case EB: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchComparator.EB); - break; - case AP: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchComparator.AP); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchComparator.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.SearchComparatorEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQ: + tgt.setValue(Enumerations.SearchComparator.EQ); + break; + case NE: + tgt.setValue(Enumerations.SearchComparator.NE); + break; + case GT: + tgt.setValue(Enumerations.SearchComparator.GT); + break; + case LT: + tgt.setValue(Enumerations.SearchComparator.LT); + break; + case GE: + tgt.setValue(Enumerations.SearchComparator.GE); + break; + case LE: + tgt.setValue(Enumerations.SearchComparator.LE); + break; + case SA: + tgt.setValue(Enumerations.SearchComparator.SA); + break; + case EB: + tgt.setValue(Enumerations.SearchComparator.EB); + break; + case AP: + tgt.setValue(Enumerations.SearchComparator.AP); + break; + default: + tgt.setValue(Enumerations.SearchComparator.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertSearchComparator(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.SearchParameter.SearchComparatorEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case EQ: - tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchComparator.EQ); - break; - case NE: - tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchComparator.NE); - break; - case GT: - tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchComparator.GT); - break; - case LT: - tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchComparator.LT); - break; - case GE: - tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchComparator.GE); - break; - case LE: - tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchComparator.LE); - break; - case SA: - tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchComparator.SA); - break; - case EB: - tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchComparator.EB); - break; - case AP: - tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchComparator.AP); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchComparator.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.SearchParameter.SearchComparatorEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQ: + tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchComparator.EQ); + break; + case NE: + tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchComparator.NE); + break; + case GT: + tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchComparator.GT); + break; + case LT: + tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchComparator.LT); + break; + case GE: + tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchComparator.GE); + break; + case LE: + tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchComparator.LE); + break; + case SA: + tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchComparator.SA); + break; + case EB: + tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchComparator.EB); + break; + case AP: + tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchComparator.AP); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchComparator.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertSearchModifierCode(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.SearchModifierCodeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case MISSING: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.MISSING); - break; - case EXACT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.EXACT); - break; - case CONTAINS: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.CONTAINS); - break; - case NOT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.NOT); - break; - case TEXT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.TEXT); - break; - case IN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.NOTIN); - break; - case BELOW: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.BELOW); - break; - case ABOVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.ABOVE); - break; - case TYPE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.TYPE); - break; - case IDENTIFIER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.IDENTIFIER); - break; - case OFTYPE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.OFTYPE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.SearchModifierCodeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MISSING: + tgt.setValue(Enumerations.SearchModifierCode.MISSING); + break; + case EXACT: + tgt.setValue(Enumerations.SearchModifierCode.EXACT); + break; + case CONTAINS: + tgt.setValue(Enumerations.SearchModifierCode.CONTAINS); + break; + case NOT: + tgt.setValue(Enumerations.SearchModifierCode.NOT); + break; + case TEXT: + tgt.setValue(Enumerations.SearchModifierCode.TEXT); + break; + case IN: + tgt.setValue(Enumerations.SearchModifierCode.IN); + break; + case NOTIN: + tgt.setValue(Enumerations.SearchModifierCode.NOTIN); + break; + case BELOW: + tgt.setValue(Enumerations.SearchModifierCode.BELOW); + break; + case ABOVE: + tgt.setValue(Enumerations.SearchModifierCode.ABOVE); + break; + case TYPE: + tgt.setValue(Enumerations.SearchModifierCode.TYPE); + break; + case IDENTIFIER: + tgt.setValue(Enumerations.SearchModifierCode.IDENTIFIER); + break; + case OFTYPE: + tgt.setValue(Enumerations.SearchModifierCode.OFTYPE); + break; + default: + tgt.setValue(Enumerations.SearchModifierCode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertSearchModifierCode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.SearchParameter.SearchModifierCodeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case MISSING: - tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchModifierCode.MISSING); - break; - case EXACT: - tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchModifierCode.EXACT); - break; - case CONTAINS: - tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchModifierCode.CONTAINS); - break; - case NOT: - tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchModifierCode.NOT); - break; - case TEXT: - tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchModifierCode.TEXT); - break; - case IN: - tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchModifierCode.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchModifierCode.NOTIN); - break; - case BELOW: - tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchModifierCode.BELOW); - break; - case ABOVE: - tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchModifierCode.ABOVE); - break; - case TYPE: - tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchModifierCode.TYPE); - break; - case IDENTIFIER: - tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchModifierCode.IDENTIFIER); - break; - case OFTYPE: - tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchModifierCode.OFTYPE); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchModifierCode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.SearchParameter.SearchModifierCodeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case MISSING: + tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchModifierCode.MISSING); + break; + case EXACT: + tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchModifierCode.EXACT); + break; + case CONTAINS: + tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchModifierCode.CONTAINS); + break; + case NOT: + tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchModifierCode.NOT); + break; + case TEXT: + tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchModifierCode.TEXT); + break; + case IN: + tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchModifierCode.IN); + break; + case NOTIN: + tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchModifierCode.NOTIN); + break; + case BELOW: + tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchModifierCode.BELOW); + break; + case ABOVE: + tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchModifierCode.ABOVE); + break; + case TYPE: + tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchModifierCode.TYPE); + break; + case IDENTIFIER: + tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchModifierCode.IDENTIFIER); + break; + case OFTYPE: + tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchModifierCode.OFTYPE); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.SearchParameter.SearchModifierCode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.SearchParameter.SearchParameterComponentComponent convertSearchParameterComponentComponent(org.hl7.fhir.r4b.model.SearchParameter.SearchParameterComponentComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ServiceRequest43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ServiceRequest43_50.java index e36b78d6bb..9eebffa8ed 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ServiceRequest43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ServiceRequest43_50.java @@ -12,6 +12,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; import org.hl7.fhir.r5.model.ServiceRequest.ServiceRequestOrderDetailComponent; import org.hl7.fhir.r5.model.ServiceRequest.ServiceRequestOrderDetailParameterComponent; @@ -193,200 +195,224 @@ public static org.hl7.fhir.r4b.model.ServiceRequest convertServiceRequest(org.hl } static public org.hl7.fhir.r5.model.Enumeration convertServiceRequestStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ONHOLD); - break; - case REVOKED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.REVOKED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.RequestStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(Enumerations.RequestStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(Enumerations.RequestStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(Enumerations.RequestStatus.ONHOLD); + break; + case REVOKED: + tgt.setValue(Enumerations.RequestStatus.REVOKED); + break; + case COMPLETED: + tgt.setValue(Enumerations.RequestStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.RequestStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(Enumerations.RequestStatus.UNKNOWN); + break; + default: + tgt.setValue(Enumerations.RequestStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertServiceRequestStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ACTIVE); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ONHOLD); - break; - case REVOKED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.REVOKED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ACTIVE); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ONHOLD); + break; + case REVOKED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.REVOKED); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertServiceRequestIntent(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestIntentEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.PROPOSAL); - break; - case PLAN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.PLAN); - break; - case DIRECTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.DIRECTIVE); - break; - case ORDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORDER); - break; - case ORIGINALORDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORIGINALORDER); - break; - case REFLEXORDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.REFLEXORDER); - break; - case FILLERORDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.FILLERORDER); - break; - case INSTANCEORDER: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.INSTANCEORDER); - break; - case OPTION: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.OPTION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.RequestIntentEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSAL: + tgt.setValue(Enumerations.RequestIntent.PROPOSAL); + break; + case PLAN: + tgt.setValue(Enumerations.RequestIntent.PLAN); + break; + case DIRECTIVE: + tgt.setValue(Enumerations.RequestIntent.DIRECTIVE); + break; + case ORDER: + tgt.setValue(Enumerations.RequestIntent.ORDER); + break; + case ORIGINALORDER: + tgt.setValue(Enumerations.RequestIntent.ORIGINALORDER); + break; + case REFLEXORDER: + tgt.setValue(Enumerations.RequestIntent.REFLEXORDER); + break; + case FILLERORDER: + tgt.setValue(Enumerations.RequestIntent.FILLERORDER); + break; + case INSTANCEORDER: + tgt.setValue(Enumerations.RequestIntent.INSTANCEORDER); + break; + case OPTION: + tgt.setValue(Enumerations.RequestIntent.OPTION); + break; + default: + tgt.setValue(Enumerations.RequestIntent.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertServiceRequestIntent(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestIntentEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PROPOSAL: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.PROPOSAL); - break; - case PLAN: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.PLAN); - break; - case DIRECTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.DIRECTIVE); - break; - case ORDER: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.ORDER); - break; - case ORIGINALORDER: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.ORIGINALORDER); - break; - case REFLEXORDER: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.REFLEXORDER); - break; - case FILLERORDER: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.FILLERORDER); - break; - case INSTANCEORDER: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.INSTANCEORDER); - break; - case OPTION: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.OPTION); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestIntentEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PROPOSAL: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.PROPOSAL); + break; + case PLAN: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.PLAN); + break; + case DIRECTIVE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.DIRECTIVE); + break; + case ORDER: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.ORDER); + break; + case ORIGINALORDER: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.ORIGINALORDER); + break; + case REFLEXORDER: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.REFLEXORDER); + break; + case FILLERORDER: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.FILLERORDER); + break; + case INSTANCEORDER: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.INSTANCEORDER); + break; + case OPTION: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.OPTION); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertServiceRequestPriority(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestPriorityEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP); - break; - case STAT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.RequestPriorityEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(Enumerations.RequestPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(Enumerations.RequestPriority.URGENT); + break; + case ASAP: + tgt.setValue(Enumerations.RequestPriority.ASAP); + break; + case STAT: + tgt.setValue(Enumerations.RequestPriority.STAT); + break; + default: + tgt.setValue(Enumerations.RequestPriority.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertServiceRequestPriority(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestPriorityEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.URGENT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ASAP); - break; - case STAT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.STAT); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestPriorityEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.URGENT); + break; + case ASAP: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ASAP); + break; + case STAT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.STAT); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Slot43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Slot43_50.java index b7f0119b15..e93df501b2 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Slot43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Slot43_50.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Slot; /* Copyright (c) 2011+, HL7, Inc. @@ -103,58 +105,66 @@ public static org.hl7.fhir.r4b.model.Slot convertSlot(org.hl7.fhir.r5.model.Slot } static public org.hl7.fhir.r5.model.Enumeration convertSlotStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Slot.SlotStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case BUSY: - tgt.setValue(org.hl7.fhir.r5.model.Slot.SlotStatus.BUSY); - break; - case FREE: - tgt.setValue(org.hl7.fhir.r5.model.Slot.SlotStatus.FREE); - break; - case BUSYUNAVAILABLE: - tgt.setValue(org.hl7.fhir.r5.model.Slot.SlotStatus.BUSYUNAVAILABLE); - break; - case BUSYTENTATIVE: - tgt.setValue(org.hl7.fhir.r5.model.Slot.SlotStatus.BUSYTENTATIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Slot.SlotStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Slot.SlotStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Slot.SlotStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case BUSY: + tgt.setValue(Slot.SlotStatus.BUSY); + break; + case FREE: + tgt.setValue(Slot.SlotStatus.FREE); + break; + case BUSYUNAVAILABLE: + tgt.setValue(Slot.SlotStatus.BUSYUNAVAILABLE); + break; + case BUSYTENTATIVE: + tgt.setValue(Slot.SlotStatus.BUSYTENTATIVE); + break; + case ENTEREDINERROR: + tgt.setValue(Slot.SlotStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Slot.SlotStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertSlotStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Slot.SlotStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case BUSY: - tgt.setValue(org.hl7.fhir.r4b.model.Slot.SlotStatus.BUSY); - break; - case FREE: - tgt.setValue(org.hl7.fhir.r4b.model.Slot.SlotStatus.FREE); - break; - case BUSYUNAVAILABLE: - tgt.setValue(org.hl7.fhir.r4b.model.Slot.SlotStatus.BUSYUNAVAILABLE); - break; - case BUSYTENTATIVE: - tgt.setValue(org.hl7.fhir.r4b.model.Slot.SlotStatus.BUSYTENTATIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.Slot.SlotStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Slot.SlotStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Slot.SlotStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case BUSY: + tgt.setValue(org.hl7.fhir.r4b.model.Slot.SlotStatus.BUSY); + break; + case FREE: + tgt.setValue(org.hl7.fhir.r4b.model.Slot.SlotStatus.FREE); + break; + case BUSYUNAVAILABLE: + tgt.setValue(org.hl7.fhir.r4b.model.Slot.SlotStatus.BUSYUNAVAILABLE); + break; + case BUSYTENTATIVE: + tgt.setValue(org.hl7.fhir.r4b.model.Slot.SlotStatus.BUSYTENTATIVE); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.Slot.SlotStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Slot.SlotStatus.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Specimen43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Specimen43_50.java index b4680e188b..053d0d64ac 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Specimen43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Specimen43_50.java @@ -10,6 +10,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Specimen; /* Copyright (c) 2011+, HL7, Inc. @@ -105,53 +107,61 @@ public static org.hl7.fhir.r4b.model.Specimen convertSpecimen(org.hl7.fhir.r5.mo } static public org.hl7.fhir.r5.model.Enumeration convertSpecimenStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Specimen.SpecimenStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case AVAILABLE: - tgt.setValue(org.hl7.fhir.r5.model.Specimen.SpecimenStatus.AVAILABLE); - break; - case UNAVAILABLE: - tgt.setValue(org.hl7.fhir.r5.model.Specimen.SpecimenStatus.UNAVAILABLE); - break; - case UNSATISFACTORY: - tgt.setValue(org.hl7.fhir.r5.model.Specimen.SpecimenStatus.UNSATISFACTORY); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Specimen.SpecimenStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Specimen.SpecimenStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Specimen.SpecimenStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case AVAILABLE: + tgt.setValue(Specimen.SpecimenStatus.AVAILABLE); + break; + case UNAVAILABLE: + tgt.setValue(Specimen.SpecimenStatus.UNAVAILABLE); + break; + case UNSATISFACTORY: + tgt.setValue(Specimen.SpecimenStatus.UNSATISFACTORY); + break; + case ENTEREDINERROR: + tgt.setValue(Specimen.SpecimenStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Specimen.SpecimenStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertSpecimenStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Specimen.SpecimenStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case AVAILABLE: - tgt.setValue(org.hl7.fhir.r4b.model.Specimen.SpecimenStatus.AVAILABLE); - break; - case UNAVAILABLE: - tgt.setValue(org.hl7.fhir.r4b.model.Specimen.SpecimenStatus.UNAVAILABLE); - break; - case UNSATISFACTORY: - tgt.setValue(org.hl7.fhir.r4b.model.Specimen.SpecimenStatus.UNSATISFACTORY); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.Specimen.SpecimenStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Specimen.SpecimenStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Specimen.SpecimenStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case AVAILABLE: + tgt.setValue(org.hl7.fhir.r4b.model.Specimen.SpecimenStatus.AVAILABLE); + break; + case UNAVAILABLE: + tgt.setValue(org.hl7.fhir.r4b.model.Specimen.SpecimenStatus.UNAVAILABLE); + break; + case UNSATISFACTORY: + tgt.setValue(org.hl7.fhir.r4b.model.Specimen.SpecimenStatus.UNSATISFACTORY); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.Specimen.SpecimenStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Specimen.SpecimenStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Specimen.SpecimenCollectionComponent convertSpecimenCollectionComponent(org.hl7.fhir.r4b.model.Specimen.SpecimenCollectionComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SpecimenDefinition43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SpecimenDefinition43_50.java index f6d2d8d79e..26cbe255eb 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SpecimenDefinition43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SpecimenDefinition43_50.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Boolean43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.SpecimenDefinition; /* Copyright (c) 2011+, HL7, Inc. @@ -130,41 +132,49 @@ public static org.hl7.fhir.r4b.model.SpecimenDefinition.SpecimenDefinitionTypeTe } static public org.hl7.fhir.r5.model.Enumeration convertSpecimenContainedPreference(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenContainedPreferenceEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PREFERRED: - tgt.setValue(org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenContainedPreference.PREFERRED); - break; - case ALTERNATE: - tgt.setValue(org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenContainedPreference.ALTERNATE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenContainedPreference.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new SpecimenDefinition.SpecimenContainedPreferenceEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PREFERRED: + tgt.setValue(SpecimenDefinition.SpecimenContainedPreference.PREFERRED); + break; + case ALTERNATE: + tgt.setValue(SpecimenDefinition.SpecimenContainedPreference.ALTERNATE); + break; + default: + tgt.setValue(SpecimenDefinition.SpecimenContainedPreference.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertSpecimenContainedPreference(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.SpecimenDefinition.SpecimenContainedPreferenceEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PREFERRED: - tgt.setValue(org.hl7.fhir.r4b.model.SpecimenDefinition.SpecimenContainedPreference.PREFERRED); - break; - case ALTERNATE: - tgt.setValue(org.hl7.fhir.r4b.model.SpecimenDefinition.SpecimenContainedPreference.ALTERNATE); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.SpecimenDefinition.SpecimenContainedPreference.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.SpecimenDefinition.SpecimenContainedPreferenceEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PREFERRED: + tgt.setValue(org.hl7.fhir.r4b.model.SpecimenDefinition.SpecimenContainedPreference.PREFERRED); + break; + case ALTERNATE: + tgt.setValue(org.hl7.fhir.r4b.model.SpecimenDefinition.SpecimenContainedPreference.ALTERNATE); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.SpecimenDefinition.SpecimenContainedPreference.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerComponent convertSpecimenDefinitionTypeTestedContainerComponent(org.hl7.fhir.r4b.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/StructureDefinition43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/StructureDefinition43_50.java index dcc08ea49c..0477586f60 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/StructureDefinition43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/StructureDefinition43_50.java @@ -15,6 +15,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.ElementDefinition43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.StructureDefinition; /* Copyright (c) 2011+, HL7, Inc. @@ -170,91 +172,107 @@ public static org.hl7.fhir.r4b.model.StructureDefinition convertStructureDefinit } static public org.hl7.fhir.r5.model.Enumeration convertStructureDefinitionKind(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKindEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PRIMITIVETYPE: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind.PRIMITIVETYPE); - break; - case COMPLEXTYPE: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind.COMPLEXTYPE); - break; - case RESOURCE: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind.RESOURCE); - break; - case LOGICAL: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind.LOGICAL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureDefinition.StructureDefinitionKindEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRIMITIVETYPE: + tgt.setValue(StructureDefinition.StructureDefinitionKind.PRIMITIVETYPE); + break; + case COMPLEXTYPE: + tgt.setValue(StructureDefinition.StructureDefinitionKind.COMPLEXTYPE); + break; + case RESOURCE: + tgt.setValue(StructureDefinition.StructureDefinitionKind.RESOURCE); + break; + case LOGICAL: + tgt.setValue(StructureDefinition.StructureDefinitionKind.LOGICAL); + break; + default: + tgt.setValue(StructureDefinition.StructureDefinitionKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertStructureDefinitionKind(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.StructureDefinition.StructureDefinitionKindEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PRIMITIVETYPE: - tgt.setValue(org.hl7.fhir.r4b.model.StructureDefinition.StructureDefinitionKind.PRIMITIVETYPE); - break; - case COMPLEXTYPE: - tgt.setValue(org.hl7.fhir.r4b.model.StructureDefinition.StructureDefinitionKind.COMPLEXTYPE); - break; - case RESOURCE: - tgt.setValue(org.hl7.fhir.r4b.model.StructureDefinition.StructureDefinitionKind.RESOURCE); - break; - case LOGICAL: - tgt.setValue(org.hl7.fhir.r4b.model.StructureDefinition.StructureDefinitionKind.LOGICAL); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.StructureDefinition.StructureDefinitionKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.StructureDefinition.StructureDefinitionKindEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PRIMITIVETYPE: + tgt.setValue(org.hl7.fhir.r4b.model.StructureDefinition.StructureDefinitionKind.PRIMITIVETYPE); + break; + case COMPLEXTYPE: + tgt.setValue(org.hl7.fhir.r4b.model.StructureDefinition.StructureDefinitionKind.COMPLEXTYPE); + break; + case RESOURCE: + tgt.setValue(org.hl7.fhir.r4b.model.StructureDefinition.StructureDefinitionKind.RESOURCE); + break; + case LOGICAL: + tgt.setValue(org.hl7.fhir.r4b.model.StructureDefinition.StructureDefinitionKind.LOGICAL); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.StructureDefinition.StructureDefinitionKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertTypeDerivationRule(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRuleEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case SPECIALIZATION: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule.SPECIALIZATION); - break; - case CONSTRAINT: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule.CONSTRAINT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureDefinition.TypeDerivationRuleEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SPECIALIZATION: + tgt.setValue(StructureDefinition.TypeDerivationRule.SPECIALIZATION); + break; + case CONSTRAINT: + tgt.setValue(StructureDefinition.TypeDerivationRule.CONSTRAINT); + break; + default: + tgt.setValue(StructureDefinition.TypeDerivationRule.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertTypeDerivationRule(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.StructureDefinition.TypeDerivationRuleEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case SPECIALIZATION: - tgt.setValue(org.hl7.fhir.r4b.model.StructureDefinition.TypeDerivationRule.SPECIALIZATION); - break; - case CONSTRAINT: - tgt.setValue(org.hl7.fhir.r4b.model.StructureDefinition.TypeDerivationRule.CONSTRAINT); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.StructureDefinition.TypeDerivationRule.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.StructureDefinition.TypeDerivationRuleEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SPECIALIZATION: + tgt.setValue(org.hl7.fhir.r4b.model.StructureDefinition.TypeDerivationRule.SPECIALIZATION); + break; + case CONSTRAINT: + tgt.setValue(org.hl7.fhir.r4b.model.StructureDefinition.TypeDerivationRule.CONSTRAINT); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.StructureDefinition.TypeDerivationRule.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionMappingComponent convertStructureDefinitionMappingComponent(org.hl7.fhir.r4b.model.StructureDefinition.StructureDefinitionMappingComponent src) throws FHIRException { @@ -314,47 +332,55 @@ public static org.hl7.fhir.r4b.model.StructureDefinition.StructureDefinitionCont } static public org.hl7.fhir.r5.model.Enumeration convertExtensionContextType(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case FHIRPATH: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextType.FHIRPATH); - break; - case ELEMENT: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextType.ELEMENT); - break; - case EXTENSION: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextType.EXTENSION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureDefinition.ExtensionContextTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FHIRPATH: + tgt.setValue(StructureDefinition.ExtensionContextType.FHIRPATH); + break; + case ELEMENT: + tgt.setValue(StructureDefinition.ExtensionContextType.ELEMENT); + break; + case EXTENSION: + tgt.setValue(StructureDefinition.ExtensionContextType.EXTENSION); + break; + default: + tgt.setValue(StructureDefinition.ExtensionContextType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertExtensionContextType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.StructureDefinition.ExtensionContextTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case FHIRPATH: - tgt.setValue(org.hl7.fhir.r4b.model.StructureDefinition.ExtensionContextType.FHIRPATH); - break; - case ELEMENT: - tgt.setValue(org.hl7.fhir.r4b.model.StructureDefinition.ExtensionContextType.ELEMENT); - break; - case EXTENSION: - tgt.setValue(org.hl7.fhir.r4b.model.StructureDefinition.ExtensionContextType.EXTENSION); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.StructureDefinition.ExtensionContextType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.StructureDefinition.ExtensionContextTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FHIRPATH: + tgt.setValue(org.hl7.fhir.r4b.model.StructureDefinition.ExtensionContextType.FHIRPATH); + break; + case ELEMENT: + tgt.setValue(org.hl7.fhir.r4b.model.StructureDefinition.ExtensionContextType.ELEMENT); + break; + case EXTENSION: + tgt.setValue(org.hl7.fhir.r4b.model.StructureDefinition.ExtensionContextType.EXTENSION); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.StructureDefinition.ExtensionContextType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionSnapshotComponent convertStructureDefinitionSnapshotComponent(org.hl7.fhir.r4b.model.StructureDefinition.StructureDefinitionSnapshotComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/StructureMap43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/StructureMap43_50.java index a89127fd1e..4c20f09873 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/StructureMap43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/StructureMap43_50.java @@ -19,12 +19,7 @@ import org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupTypeMode; import org.hl7.fhir.r4b.utils.ToolingExtensions; import org.hl7.fhir.r5.fhirpath.FHIRPathConstant; -import org.hl7.fhir.r5.model.BooleanType; -import org.hl7.fhir.r5.model.DataType; -import org.hl7.fhir.r5.model.DecimalType; -import org.hl7.fhir.r5.model.IdType; -import org.hl7.fhir.r5.model.IntegerType; -import org.hl7.fhir.r5.model.StringType; +import org.hl7.fhir.r5.model.*; import org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetParameterComponent; import org.hl7.fhir.utilities.Utilities; @@ -180,53 +175,61 @@ public static org.hl7.fhir.r4b.model.StructureMap.StructureMapStructureComponent } static public org.hl7.fhir.r5.model.Enumeration convertStructureMapModelMode(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureMap.StructureMapModelModeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case SOURCE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapModelMode.SOURCE); - break; - case QUERIED: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapModelMode.QUERIED); - break; - case TARGET: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapModelMode.TARGET); - break; - case PRODUCED: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapModelMode.PRODUCED); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapModelMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureMap.StructureMapModelModeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SOURCE: + tgt.setValue(StructureMap.StructureMapModelMode.SOURCE); + break; + case QUERIED: + tgt.setValue(StructureMap.StructureMapModelMode.QUERIED); + break; + case TARGET: + tgt.setValue(StructureMap.StructureMapModelMode.TARGET); + break; + case PRODUCED: + tgt.setValue(StructureMap.StructureMapModelMode.PRODUCED); + break; + default: + tgt.setValue(StructureMap.StructureMapModelMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertStructureMapModelMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.StructureMap.StructureMapModelModeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case SOURCE: - tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapModelMode.SOURCE); - break; - case QUERIED: - tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapModelMode.QUERIED); - break; - case TARGET: - tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapModelMode.TARGET); - break; - case PRODUCED: - tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapModelMode.PRODUCED); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapModelMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.StructureMap.StructureMapModelModeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SOURCE: + tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapModelMode.SOURCE); + break; + case QUERIED: + tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapModelMode.QUERIED); + break; + case TARGET: + tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapModelMode.TARGET); + break; + case PRODUCED: + tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapModelMode.PRODUCED); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapModelMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.StructureMap.StructureMapGroupComponent convertStructureMapGroupComponent(org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupComponent src) throws FHIRException { @@ -273,45 +276,53 @@ public static org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupComponent con } static public org.hl7.fhir.r5.model.Enumeration convertStructureMapGroupTypeMode(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureMap.StructureMapGroupTypeModeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case NONE: - return null; - case TYPES: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapGroupTypeMode.TYPES); - break; - case TYPEANDTYPES: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapGroupTypeMode.TYPEANDTYPES); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapGroupTypeMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureMap.StructureMapGroupTypeModeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case NONE: + return null; + case TYPES: + tgt.setValue(StructureMap.StructureMapGroupTypeMode.TYPES); + break; + case TYPEANDTYPES: + tgt.setValue(StructureMap.StructureMapGroupTypeMode.TYPEANDTYPES); + break; + default: + tgt.setValue(StructureMap.StructureMapGroupTypeMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertStructureMapGroupTypeMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupTypeModeEnumFactory()); - if (src == null || src.isEmpty()) { - tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupTypeMode.NONE); + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupTypeModeEnumFactory()); + if (src == null || src.isEmpty()) { + tgt.setValue(StructureMapGroupTypeMode.NONE); + return tgt; + } + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case TYPES: + tgt.setValue(StructureMapGroupTypeMode.TYPES); + break; + case TYPEANDTYPES: + tgt.setValue(StructureMapGroupTypeMode.TYPEANDTYPES); + break; + default: + tgt.setValue(StructureMapGroupTypeMode.NULL); + break; + } + } return tgt; - } - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case TYPES: - tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupTypeMode.TYPES); - break; - case TYPEANDTYPES: - tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupTypeMode.TYPEANDTYPES); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupTypeMode.NULL); - break; - } - return tgt; } public static org.hl7.fhir.r5.model.StructureMap.StructureMapGroupInputComponent convertStructureMapGroupInputComponent(org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupInputComponent src) throws FHIRException { @@ -347,41 +358,49 @@ public static org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupInputComponen } static public org.hl7.fhir.r5.model.Enumeration convertStructureMapInputMode(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureMap.StructureMapInputModeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case SOURCE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapInputMode.SOURCE); - break; - case TARGET: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapInputMode.TARGET); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapInputMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureMap.StructureMapInputModeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SOURCE: + tgt.setValue(StructureMap.StructureMapInputMode.SOURCE); + break; + case TARGET: + tgt.setValue(StructureMap.StructureMapInputMode.TARGET); + break; + default: + tgt.setValue(StructureMap.StructureMapInputMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertStructureMapInputMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.StructureMap.StructureMapInputModeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case SOURCE: - tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapInputMode.SOURCE); - break; - case TARGET: - tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapInputMode.TARGET); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapInputMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.StructureMap.StructureMapInputModeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case SOURCE: + tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapInputMode.SOURCE); + break; + case TARGET: + tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapInputMode.TARGET); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapInputMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleComponent convertStructureMapGroupRuleComponent(org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupRuleComponent src) throws FHIRException { @@ -485,59 +504,67 @@ public static org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupRuleSourceCom } static public org.hl7.fhir.r5.model.Enumeration convertStructureMapSourceListMode(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListModeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case FIRST: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListMode.FIRST); - break; - case NOTFIRST: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListMode.NOTFIRST); - break; - case LAST: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListMode.LAST); - break; - case NOTLAST: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListMode.NOTLAST); - break; - case ONLYONE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListMode.ONLYONE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapSourceListMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureMap.StructureMapSourceListModeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FIRST: + tgt.setValue(StructureMap.StructureMapSourceListMode.FIRST); + break; + case NOTFIRST: + tgt.setValue(StructureMap.StructureMapSourceListMode.NOTFIRST); + break; + case LAST: + tgt.setValue(StructureMap.StructureMapSourceListMode.LAST); + break; + case NOTLAST: + tgt.setValue(StructureMap.StructureMapSourceListMode.NOTLAST); + break; + case ONLYONE: + tgt.setValue(StructureMap.StructureMapSourceListMode.ONLYONE); + break; + default: + tgt.setValue(StructureMap.StructureMapSourceListMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertStructureMapSourceListMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.StructureMap.StructureMapSourceListModeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case FIRST: - tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapSourceListMode.FIRST); - break; - case NOTFIRST: - tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapSourceListMode.NOTFIRST); - break; - case LAST: - tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapSourceListMode.LAST); - break; - case NOTLAST: - tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapSourceListMode.NOTLAST); - break; - case ONLYONE: - tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapSourceListMode.ONLYONE); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapSourceListMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.StructureMap.StructureMapSourceListModeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FIRST: + tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapSourceListMode.FIRST); + break; + case NOTFIRST: + tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapSourceListMode.NOTFIRST); + break; + case LAST: + tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapSourceListMode.LAST); + break; + case NOTLAST: + tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapSourceListMode.NOTLAST); + break; + case ONLYONE: + tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapSourceListMode.ONLYONE); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapSourceListMode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetComponent convertStructureMapGroupRuleTargetComponent(org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupRuleTargetComponent src) throws FHIRException { @@ -590,181 +617,197 @@ public static org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupRuleTargetCom } static public org.hl7.fhir.r5.model.Enumeration convertStructureMapTargetListMode(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListModeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case FIRST: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListMode.FIRST); - break; - case SHARE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListMode.SHARE); - break; - case LAST: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListMode.LAST); - break; - case COLLATE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListMode.SINGLE); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTargetListMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureMap.StructureMapTargetListModeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FIRST: + tgt.setValue(StructureMap.StructureMapTargetListMode.FIRST); + break; + case SHARE: + tgt.setValue(StructureMap.StructureMapTargetListMode.SHARE); + break; + case LAST: + tgt.setValue(StructureMap.StructureMapTargetListMode.LAST); + break; + case COLLATE: + tgt.setValue(StructureMap.StructureMapTargetListMode.SINGLE); + break; + default: + tgt.setValue(StructureMap.StructureMapTargetListMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertStructureMapTargetListMode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.StructureMap.StructureMapTargetListModeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case FIRST: - tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTargetListMode.FIRST); - break; - case SHARE: - tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTargetListMode.SHARE); - break; - case LAST: - tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTargetListMode.LAST); - break; - case SINGLE: - tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTargetListMode.COLLATE); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTargetListMode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.StructureMap.StructureMapTargetListModeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case FIRST: + tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTargetListMode.FIRST); + break; + case SHARE: + tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTargetListMode.SHARE); + break; + case LAST: + tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTargetListMode.LAST); + break; + case SINGLE: + tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTargetListMode.COLLATE); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTargetListMode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertStructureMapTransform(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureMap.StructureMapTransformEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case CREATE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.CREATE); - break; - case COPY: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.COPY); - break; - case TRUNCATE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.TRUNCATE); - break; - case ESCAPE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.ESCAPE); - break; - case CAST: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.CAST); - break; - case APPEND: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.APPEND); - break; - case TRANSLATE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.TRANSLATE); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.REFERENCE); - break; - case DATEOP: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.DATEOP); - break; - case UUID: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.UUID); - break; - case POINTER: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.POINTER); - break; - case EVALUATE: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.EVALUATE); - break; - case CC: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.CC); - break; - case C: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.C); - break; - case QTY: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.QTY); - break; - case ID: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.ID); - break; - case CP: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.CP); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.StructureMap.StructureMapTransform.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new StructureMap.StructureMapTransformEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CREATE: + tgt.setValue(StructureMap.StructureMapTransform.CREATE); + break; + case COPY: + tgt.setValue(StructureMap.StructureMapTransform.COPY); + break; + case TRUNCATE: + tgt.setValue(StructureMap.StructureMapTransform.TRUNCATE); + break; + case ESCAPE: + tgt.setValue(StructureMap.StructureMapTransform.ESCAPE); + break; + case CAST: + tgt.setValue(StructureMap.StructureMapTransform.CAST); + break; + case APPEND: + tgt.setValue(StructureMap.StructureMapTransform.APPEND); + break; + case TRANSLATE: + tgt.setValue(StructureMap.StructureMapTransform.TRANSLATE); + break; + case REFERENCE: + tgt.setValue(StructureMap.StructureMapTransform.REFERENCE); + break; + case DATEOP: + tgt.setValue(StructureMap.StructureMapTransform.DATEOP); + break; + case UUID: + tgt.setValue(StructureMap.StructureMapTransform.UUID); + break; + case POINTER: + tgt.setValue(StructureMap.StructureMapTransform.POINTER); + break; + case EVALUATE: + tgt.setValue(StructureMap.StructureMapTransform.EVALUATE); + break; + case CC: + tgt.setValue(StructureMap.StructureMapTransform.CC); + break; + case C: + tgt.setValue(StructureMap.StructureMapTransform.C); + break; + case QTY: + tgt.setValue(StructureMap.StructureMapTransform.QTY); + break; + case ID: + tgt.setValue(StructureMap.StructureMapTransform.ID); + break; + case CP: + tgt.setValue(StructureMap.StructureMapTransform.CP); + break; + default: + tgt.setValue(StructureMap.StructureMapTransform.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertStructureMapTransform(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.StructureMap.StructureMapTransformEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case CREATE: - tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTransform.CREATE); - break; - case COPY: - tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTransform.COPY); - break; - case TRUNCATE: - tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTransform.TRUNCATE); - break; - case ESCAPE: - tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTransform.ESCAPE); - break; - case CAST: - tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTransform.CAST); - break; - case APPEND: - tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTransform.APPEND); - break; - case TRANSLATE: - tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTransform.TRANSLATE); - break; - case REFERENCE: - tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTransform.REFERENCE); - break; - case DATEOP: - tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTransform.DATEOP); - break; - case UUID: - tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTransform.UUID); - break; - case POINTER: - tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTransform.POINTER); - break; - case EVALUATE: - tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTransform.EVALUATE); - break; - case CC: - tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTransform.CC); - break; - case C: - tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTransform.C); - break; - case QTY: - tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTransform.QTY); - break; - case ID: - tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTransform.ID); - break; - case CP: - tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTransform.CP); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTransform.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.StructureMap.StructureMapTransformEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case CREATE: + tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTransform.CREATE); + break; + case COPY: + tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTransform.COPY); + break; + case TRUNCATE: + tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTransform.TRUNCATE); + break; + case ESCAPE: + tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTransform.ESCAPE); + break; + case CAST: + tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTransform.CAST); + break; + case APPEND: + tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTransform.APPEND); + break; + case TRANSLATE: + tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTransform.TRANSLATE); + break; + case REFERENCE: + tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTransform.REFERENCE); + break; + case DATEOP: + tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTransform.DATEOP); + break; + case UUID: + tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTransform.UUID); + break; + case POINTER: + tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTransform.POINTER); + break; + case EVALUATE: + tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTransform.EVALUATE); + break; + case CC: + tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTransform.CC); + break; + case C: + tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTransform.C); + break; + case QTY: + tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTransform.QTY); + break; + case ID: + tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTransform.ID); + break; + case CP: + tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTransform.CP); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.StructureMap.StructureMapTransform.NULL); + break; + } + } + return tgt; } //DIRTY diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SubscriptionStatus43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SubscriptionStatus43_50.java index cafa3f258f..9164ca14c2 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SubscriptionStatus43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SubscriptionStatus43_50.java @@ -6,6 +6,9 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Instant43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Integer64_43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; +import org.hl7.fhir.r4b.model.Enumeration; +import org.hl7.fhir.r4b.model.Enumerations; +import org.hl7.fhir.r4b.model.SubscriptionStatus; public class SubscriptionStatus43_50 { public static org.hl7.fhir.r4b.model.SubscriptionStatus convertSubscriptionStatus(org.hl7.fhir.r5.model.SubscriptionStatus src) { @@ -66,29 +69,49 @@ private static org.hl7.fhir.r4b.model.SubscriptionStatus.SubscriptionStatusNotif } private static org.hl7.fhir.r4b.model.Enumeration convertSubscriptionStatus(org.hl7.fhir.r5.model.Enumeration src) { - org.hl7.fhir.r4b.model.Enumerations.SubscriptionStatusEnumFactory enumFactory = new org.hl7.fhir.r4b.model.Enumerations.SubscriptionStatusEnumFactory(); - switch(src.getValue()) { - case ACTIVE: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.Enumerations.SubscriptionStatus.ACTIVE); - case ERROR: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.Enumerations.SubscriptionStatus.ERROR); - case ENTEREDINERROR: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.Enumerations.SubscriptionStatus.ERROR); - case OFF: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.Enumerations.SubscriptionStatus.OFF); - case REQUESTED: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.Enumerations.SubscriptionStatus.REQUESTED); - case NULL: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.Enumerations.SubscriptionStatus.NULL); - } - return null; + Enumerations.SubscriptionStatusEnumFactory enumFactory = new Enumerations.SubscriptionStatusEnumFactory(); + if (src.getValue() == null) { + return null; + } else { + switch (src.getValue()) { + case ACTIVE: + return new Enumeration<>(enumFactory, Enumerations.SubscriptionStatus.ACTIVE); + case ERROR: + return new Enumeration<>(enumFactory, Enumerations.SubscriptionStatus.ERROR); + case ENTEREDINERROR: + return new Enumeration<>(enumFactory, Enumerations.SubscriptionStatus.ERROR); + case OFF: + return new Enumeration<>(enumFactory, Enumerations.SubscriptionStatus.OFF); + case REQUESTED: + return new Enumeration<>(enumFactory, Enumerations.SubscriptionStatus.REQUESTED); + case NULL: + return new Enumeration<>(enumFactory, Enumerations.SubscriptionStatus.NULL); + } + } + return null; } private static org.hl7.fhir.r4b.model.Enumeration convertSubscriptionNotificationType(org.hl7.fhir.r5.model.Enumeration src) { - org.hl7.fhir.r4b.model.SubscriptionStatus.SubscriptionNotificationTypeEnumFactory enumFactory = new org.hl7.fhir.r4b.model.SubscriptionStatus.SubscriptionNotificationTypeEnumFactory(); - switch(src.getValue()) { - case EVENTNOTIFICATION: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionStatus.SubscriptionNotificationType.EVENTNOTIFICATION); - case HANDSHAKE: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionStatus.SubscriptionNotificationType.HANDSHAKE); - case HEARTBEAT: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionStatus.SubscriptionNotificationType.HEARTBEAT); - case QUERYEVENT: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionStatus.SubscriptionNotificationType.QUERYEVENT); - case QUERYSTATUS: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionStatus.SubscriptionNotificationType.QUERYSTATUS); - case NULL: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionStatus.SubscriptionNotificationType.NULL); - } - return null; + SubscriptionStatus.SubscriptionNotificationTypeEnumFactory enumFactory = new SubscriptionStatus.SubscriptionNotificationTypeEnumFactory(); + if (src.getValue() == null) { + return null; + } else { + switch (src.getValue()) { + case EVENTNOTIFICATION: + return new Enumeration<>(enumFactory, SubscriptionStatus.SubscriptionNotificationType.EVENTNOTIFICATION); + case HANDSHAKE: + return new Enumeration<>(enumFactory, SubscriptionStatus.SubscriptionNotificationType.HANDSHAKE); + case HEARTBEAT: + return new Enumeration<>(enumFactory, SubscriptionStatus.SubscriptionNotificationType.HEARTBEAT); + case QUERYEVENT: + return new Enumeration<>(enumFactory, SubscriptionStatus.SubscriptionNotificationType.QUERYEVENT); + case QUERYSTATUS: + return new Enumeration<>(enumFactory, SubscriptionStatus.SubscriptionNotificationType.QUERYSTATUS); + case NULL: + return new Enumeration<>(enumFactory, SubscriptionStatus.SubscriptionNotificationType.NULL); + } + } + return null; } @@ -150,27 +173,46 @@ private static org.hl7.fhir.r5.model.SubscriptionStatus.SubscriptionStatusNotifi } private static org.hl7.fhir.r5.model.Enumeration convertSubscriptionStatus(org.hl7.fhir.r4b.model.Enumeration src) { - org.hl7.fhir.r5.model.Enumerations.SubscriptionStatusCodesEnumFactory enumFactory = new org.hl7.fhir.r5.model.Enumerations.SubscriptionStatusCodesEnumFactory(); - switch(src.getValue()) { - case ACTIVE: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SubscriptionStatusCodes.ACTIVE); - case ERROR: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SubscriptionStatusCodes.ERROR); - case OFF: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SubscriptionStatusCodes.OFF); - case REQUESTED: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SubscriptionStatusCodes.REQUESTED); - case NULL: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SubscriptionStatusCodes.NULL); - } - return null; + org.hl7.fhir.r5.model.Enumerations.SubscriptionStatusCodesEnumFactory enumFactory = new org.hl7.fhir.r5.model.Enumerations.SubscriptionStatusCodesEnumFactory(); + if (src.getValue() == null) { + return null; + } else { + switch (src.getValue()) { + case ACTIVE: + return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SubscriptionStatusCodes.ACTIVE); + case ERROR: + return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SubscriptionStatusCodes.ERROR); + case OFF: + return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SubscriptionStatusCodes.OFF); + case REQUESTED: + return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SubscriptionStatusCodes.REQUESTED); + case NULL: + return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SubscriptionStatusCodes.NULL); + } + } + return null; } private static org.hl7.fhir.r5.model.Enumeration convertSubscriptionNotificationType(org.hl7.fhir.r4b.model.Enumeration src) { - org.hl7.fhir.r5.model.SubscriptionStatus.SubscriptionNotificationTypeEnumFactory enumFactory = new org.hl7.fhir.r5.model.SubscriptionStatus.SubscriptionNotificationTypeEnumFactory(); - switch(src.getValue()) { - case EVENTNOTIFICATION: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.SubscriptionStatus.SubscriptionNotificationType.EVENTNOTIFICATION); - case HANDSHAKE: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.SubscriptionStatus.SubscriptionNotificationType.HANDSHAKE); - case HEARTBEAT: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.SubscriptionStatus.SubscriptionNotificationType.HEARTBEAT); - case QUERYEVENT: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.SubscriptionStatus.SubscriptionNotificationType.QUERYEVENT); - case QUERYSTATUS: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.SubscriptionStatus.SubscriptionNotificationType.QUERYSTATUS); - case NULL: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.SubscriptionStatus.SubscriptionNotificationType.NULL); - } - return null; + org.hl7.fhir.r5.model.SubscriptionStatus.SubscriptionNotificationTypeEnumFactory enumFactory = new org.hl7.fhir.r5.model.SubscriptionStatus.SubscriptionNotificationTypeEnumFactory(); + if (src.getValue() == null) { + return null; + } else { + switch (src.getValue()) { + case EVENTNOTIFICATION: + return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.SubscriptionStatus.SubscriptionNotificationType.EVENTNOTIFICATION); + case HANDSHAKE: + return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.SubscriptionStatus.SubscriptionNotificationType.HANDSHAKE); + case HEARTBEAT: + return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.SubscriptionStatus.SubscriptionNotificationType.HEARTBEAT); + case QUERYEVENT: + return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.SubscriptionStatus.SubscriptionNotificationType.QUERYEVENT); + case QUERYSTATUS: + return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.SubscriptionStatus.SubscriptionNotificationType.QUERYSTATUS); + case NULL: + return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.SubscriptionStatus.SubscriptionNotificationType.NULL); + } + } + return null; } } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SubscriptionTopic43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SubscriptionTopic43_50.java index 6d20d03af2..3c29658644 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SubscriptionTopic43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SubscriptionTopic43_50.java @@ -17,7 +17,9 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.MarkDown43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50; +import org.hl7.fhir.r4b.model.Enumeration; import org.hl7.fhir.r4b.model.SubscriptionTopic; +import org.hl7.fhir.r5.model.Enumerations; public class SubscriptionTopic43_50 { @@ -154,38 +156,62 @@ private static List x != null).collect(Collectors.toList()); } - private static org.hl7.fhir.r4b.model.Enumeration convertR5ComparatorToR4BModifier(org.hl7.fhir.r5.model.Enumeration src){ - org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifierEnumFactory enumFactory = new org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifierEnumFactory(); - switch(src.getValue()) { - case NULL: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier.NULL); - case EQ: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier.EQ); - case NE: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier.NE); - case GT: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier.GT); - case LT: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier.LT); - case GE: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier.GE); - case LE: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier.LE); - case SA: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier.SA); - case EB: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier.EB); - case AP: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier.AP); - } - return null; + private static org.hl7.fhir.r4b.model.Enumeration convertR5ComparatorToR4BModifier(org.hl7.fhir.r5.model.Enumeration src) { + SubscriptionTopic.SubscriptionSearchModifierEnumFactory enumFactory = new SubscriptionTopic.SubscriptionSearchModifierEnumFactory(); + if (src.getValue() == null) { + return null; + } else { + switch (src.getValue()) { + case NULL: + return new Enumeration<>(enumFactory, SubscriptionTopic.SubscriptionSearchModifier.NULL); + case EQ: + return new Enumeration<>(enumFactory, SubscriptionTopic.SubscriptionSearchModifier.EQ); + case NE: + return new Enumeration<>(enumFactory, SubscriptionTopic.SubscriptionSearchModifier.NE); + case GT: + return new Enumeration<>(enumFactory, SubscriptionTopic.SubscriptionSearchModifier.GT); + case LT: + return new Enumeration<>(enumFactory, SubscriptionTopic.SubscriptionSearchModifier.LT); + case GE: + return new Enumeration<>(enumFactory, SubscriptionTopic.SubscriptionSearchModifier.GE); + case LE: + return new Enumeration<>(enumFactory, SubscriptionTopic.SubscriptionSearchModifier.LE); + case SA: + return new Enumeration<>(enumFactory, SubscriptionTopic.SubscriptionSearchModifier.SA); + case EB: + return new Enumeration<>(enumFactory, SubscriptionTopic.SubscriptionSearchModifier.EB); + case AP: + return new Enumeration<>(enumFactory, SubscriptionTopic.SubscriptionSearchModifier.AP); + } + } + return null; } private static List> convertR5ModifierToR4BModifier(List> srcList) { return srcList.stream().map(SubscriptionTopic43_50::convertR5ModifierToR4BModifier).filter(x -> x != null).collect(Collectors.toList()); } - private static org.hl7.fhir.r4b.model.Enumeration convertR5ModifierToR4BModifier(org.hl7.fhir.r5.model.Enumeration src){ - org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifierEnumFactory enumFactory = new org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifierEnumFactory(); - switch(src.getValue()) { - case NULL: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier.NULL); - case IN: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier.IN); - case NOTIN: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier.NOTIN); - case BELOW: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier.BELOW); - case ABOVE: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier.ABOVE); - case OFTYPE: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier.OFTYPE); - } - return null; + private static org.hl7.fhir.r4b.model.Enumeration convertR5ModifierToR4BModifier(org.hl7.fhir.r5.model.Enumeration src) { + SubscriptionTopic.SubscriptionSearchModifierEnumFactory enumFactory = new SubscriptionTopic.SubscriptionSearchModifierEnumFactory(); + if (src.getValue() == null) { + return null; + } else { + switch (src.getValue()) { + case NULL: + return new Enumeration<>(enumFactory, SubscriptionTopic.SubscriptionSearchModifier.NULL); + case IN: + return new Enumeration<>(enumFactory, SubscriptionTopic.SubscriptionSearchModifier.IN); + case NOTIN: + return new Enumeration<>(enumFactory, SubscriptionTopic.SubscriptionSearchModifier.NOTIN); + case BELOW: + return new Enumeration<>(enumFactory, SubscriptionTopic.SubscriptionSearchModifier.BELOW); + case ABOVE: + return new Enumeration<>(enumFactory, SubscriptionTopic.SubscriptionSearchModifier.ABOVE); + case OFTYPE: + return new Enumeration<>(enumFactory, SubscriptionTopic.SubscriptionSearchModifier.OFTYPE); + } + } + return null; } private static org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionTopicResourceTriggerComponent convertResourceTrigger(org.hl7.fhir.r5.model.SubscriptionTopic.SubscriptionTopicResourceTriggerComponent src) { org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionTopicResourceTriggerComponent tgt = new org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionTopicResourceTriggerComponent(); @@ -233,13 +259,20 @@ private static org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionTopicResourc } private static org.hl7.fhir.r4b.model.Enumeration convertCriteriaNotExistsBehavior(org.hl7.fhir.r5.model.Enumeration src) { - org.hl7.fhir.r4b.model.SubscriptionTopic.CriteriaNotExistsBehaviorEnumFactory enumFactory = new org.hl7.fhir.r4b.model.SubscriptionTopic.CriteriaNotExistsBehaviorEnumFactory(); - switch(src.getValue()) { - case TESTFAILS: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionTopic.CriteriaNotExistsBehavior.TESTFAILS); - case TESTPASSES: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionTopic.CriteriaNotExistsBehavior.TESTPASSES); - case NULL: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionTopic.CriteriaNotExistsBehavior.NULL); - } - return null; + SubscriptionTopic.CriteriaNotExistsBehaviorEnumFactory enumFactory = new SubscriptionTopic.CriteriaNotExistsBehaviorEnumFactory(); + if (src.getValue() == null) { + return null; + } else { + switch (src.getValue()) { + case TESTFAILS: + return new Enumeration<>(enumFactory, SubscriptionTopic.CriteriaNotExistsBehavior.TESTFAILS); + case TESTPASSES: + return new Enumeration<>(enumFactory, SubscriptionTopic.CriteriaNotExistsBehavior.TESTPASSES); + case NULL: + return new Enumeration<>(enumFactory, SubscriptionTopic.CriteriaNotExistsBehavior.NULL); + } + } + return null; } private static org.hl7.fhir.r4b.model.SubscriptionTopic.InteractionTrigger convertInteractionTrigger(org.hl7.fhir.r5.model.SubscriptionTopic.InteractionTrigger value) { @@ -381,20 +414,34 @@ private static List convertR4BModifierToR5Comparator(org.hl7.fhir.r4b.model.Enumeration src) { - org.hl7.fhir.r5.model.Enumerations.SearchComparatorEnumFactory enumFactory = new org.hl7.fhir.r5.model.Enumerations.SearchComparatorEnumFactory(); - switch(src.getValue()) { - case NULL: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SearchComparator.NULL); - case EQ: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SearchComparator.EQ); - case NE: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SearchComparator.NE); - case GT: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SearchComparator.GT); - case LT: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SearchComparator.LT); - case GE: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SearchComparator.GE); - case LE: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SearchComparator.LE); - case SA: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SearchComparator.SA); - case EB: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SearchComparator.EB); - case AP: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SearchComparator.AP); - } - return null; + Enumerations.SearchComparatorEnumFactory enumFactory = new Enumerations.SearchComparatorEnumFactory(); + if (src.getValue() == null) { + return null; + } else { + switch (src.getValue()) { + case NULL: + return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, Enumerations.SearchComparator.NULL); + case EQ: + return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, Enumerations.SearchComparator.EQ); + case NE: + return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, Enumerations.SearchComparator.NE); + case GT: + return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, Enumerations.SearchComparator.GT); + case LT: + return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, Enumerations.SearchComparator.LT); + case GE: + return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, Enumerations.SearchComparator.GE); + case LE: + return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, Enumerations.SearchComparator.LE); + case SA: + return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, Enumerations.SearchComparator.SA); + case EB: + return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, Enumerations.SearchComparator.EB); + case AP: + return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, Enumerations.SearchComparator.AP); + } + } + return null; } private static List> convertR4BModifierToR5Modifier( @@ -403,22 +450,26 @@ private static List x != null).collect(Collectors.toList()); } private static org.hl7.fhir.r5.model.Enumeration convertR4BModifierToR5Modifier(org.hl7.fhir.r4b.model.Enumeration src) { - org.hl7.fhir.r5.model.Enumerations.SearchModifierCodeEnumFactory enumFactory = new org.hl7.fhir.r5.model.Enumerations.SearchModifierCodeEnumFactory(); - switch(src.getValue()) { - case NULL: - return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.NULL); - case IN: - return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.IN); - case NOTIN: - return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.NOTIN); - case BELOW: - return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.BELOW); - case ABOVE: - return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.ABOVE); - case OFTYPE: - return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.OFTYPE); - } - return null; + Enumerations.SearchModifierCodeEnumFactory enumFactory = new Enumerations.SearchModifierCodeEnumFactory(); + if (src.getValue() == null) { + return null; + } else { + switch (src.getValue()) { + case NULL: + return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, Enumerations.SearchModifierCode.NULL); + case IN: + return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, Enumerations.SearchModifierCode.IN); + case NOTIN: + return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, Enumerations.SearchModifierCode.NOTIN); + case BELOW: + return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, Enumerations.SearchModifierCode.BELOW); + case ABOVE: + return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, Enumerations.SearchModifierCode.ABOVE); + case OFTYPE: + return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, Enumerations.SearchModifierCode.OFTYPE); + } + } + return null; } private static org.hl7.fhir.r5.model.SubscriptionTopic.SubscriptionTopicResourceTriggerComponent convertResourceTrigger(org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionTopicResourceTriggerComponent src) { @@ -467,14 +518,20 @@ private static org.hl7.fhir.r5.model.SubscriptionTopic.SubscriptionTopicResource } private static org.hl7.fhir.r5.model.Enumeration convertCriteriaNotExistsBehavior(org.hl7.fhir.r4b.model.Enumeration src) { - org.hl7.fhir.r5.model.SubscriptionTopic.CriteriaNotExistsBehaviorEnumFactory enumFactory = new org.hl7.fhir.r5.model.SubscriptionTopic.CriteriaNotExistsBehaviorEnumFactory(); - switch(src.getValue()) { - - case TESTFAILS: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.SubscriptionTopic.CriteriaNotExistsBehavior.TESTFAILS); - case TESTPASSES: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.SubscriptionTopic.CriteriaNotExistsBehavior.TESTPASSES); - case NULL: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.SubscriptionTopic.CriteriaNotExistsBehavior.NULL); - } - return null; + org.hl7.fhir.r5.model.SubscriptionTopic.CriteriaNotExistsBehaviorEnumFactory enumFactory = new org.hl7.fhir.r5.model.SubscriptionTopic.CriteriaNotExistsBehaviorEnumFactory(); + if (src.getValue() == null) { + return null; + } else { + switch (src.getValue()) { + case TESTFAILS: + return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.SubscriptionTopic.CriteriaNotExistsBehavior.TESTFAILS); + case TESTPASSES: + return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.SubscriptionTopic.CriteriaNotExistsBehavior.TESTPASSES); + case NULL: + return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.SubscriptionTopic.CriteriaNotExistsBehavior.NULL); + } + } + return null; } private static org.hl7.fhir.r5.model.SubscriptionTopic.InteractionTrigger convertInteractionTrigger(org.hl7.fhir.r4b.model.SubscriptionTopic.InteractionTrigger value) { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Substance43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Substance43_50.java index 33e32e588e..8886b58585 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Substance43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Substance43_50.java @@ -8,7 +8,9 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.DateTime43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; import org.hl7.fhir.r5.model.Identifier; +import org.hl7.fhir.r5.model.Substance; /* Copyright (c) 2011+, HL7, Inc. @@ -87,47 +89,55 @@ public static org.hl7.fhir.r4b.model.Substance convertSubstance(org.hl7.fhir.r5. } static public org.hl7.fhir.r5.model.Enumeration convertFHIRSubstanceStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Substance.FHIRSubstanceStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Substance.FHIRSubstanceStatus.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Substance.FHIRSubstanceStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Substance.FHIRSubstanceStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Substance.FHIRSubstanceStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Substance.FHIRSubstanceStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Substance.FHIRSubstanceStatus.ACTIVE); + break; + case INACTIVE: + tgt.setValue(Substance.FHIRSubstanceStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(Substance.FHIRSubstanceStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Substance.FHIRSubstanceStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertFHIRSubstanceStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Substance.FHIRSubstanceStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.Substance.FHIRSubstanceStatus.ACTIVE); - break; - case INACTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.Substance.FHIRSubstanceStatus.INACTIVE); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.Substance.FHIRSubstanceStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Substance.FHIRSubstanceStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Substance.FHIRSubstanceStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4b.model.Substance.FHIRSubstanceStatus.ACTIVE); + break; + case INACTIVE: + tgt.setValue(org.hl7.fhir.r4b.model.Substance.FHIRSubstanceStatus.INACTIVE); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.Substance.FHIRSubstanceStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Substance.FHIRSubstanceStatus.NULL); + break; + } + } + return tgt; } public static void convertSubstanceInstanceComponent(org.hl7.fhir.r4b.model.Substance.SubstanceInstanceComponent src, org.hl7.fhir.r5.model.Substance tgt) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SupplyDelivery43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SupplyDelivery43_50.java index f9bdb64c62..de71fad594 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SupplyDelivery43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SupplyDelivery43_50.java @@ -6,6 +6,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.SimpleQuantity43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.SupplyDelivery; /* Copyright (c) 2011+, HL7, Inc. @@ -93,53 +95,61 @@ public static org.hl7.fhir.r4b.model.SupplyDelivery convertSupplyDelivery(org.hl } static public org.hl7.fhir.r5.model.Enumeration convertSupplyDeliveryStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus.COMPLETED); - break; - case ABANDONED: - tgt.setValue(org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus.ABANDONED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliveryStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new SupplyDelivery.SupplyDeliveryStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(SupplyDelivery.SupplyDeliveryStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(SupplyDelivery.SupplyDeliveryStatus.COMPLETED); + break; + case ABANDONED: + tgt.setValue(SupplyDelivery.SupplyDeliveryStatus.ABANDONED); + break; + case ENTEREDINERROR: + tgt.setValue(SupplyDelivery.SupplyDeliveryStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(SupplyDelivery.SupplyDeliveryStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertSupplyDeliveryStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.SupplyDelivery.SupplyDeliveryStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r4b.model.SupplyDelivery.SupplyDeliveryStatus.INPROGRESS); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4b.model.SupplyDelivery.SupplyDeliveryStatus.COMPLETED); - break; - case ABANDONED: - tgt.setValue(org.hl7.fhir.r4b.model.SupplyDelivery.SupplyDeliveryStatus.ABANDONED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.SupplyDelivery.SupplyDeliveryStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.SupplyDelivery.SupplyDeliveryStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.SupplyDelivery.SupplyDeliveryStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INPROGRESS: + tgt.setValue(org.hl7.fhir.r4b.model.SupplyDelivery.SupplyDeliveryStatus.INPROGRESS); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4b.model.SupplyDelivery.SupplyDeliveryStatus.COMPLETED); + break; + case ABANDONED: + tgt.setValue(org.hl7.fhir.r4b.model.SupplyDelivery.SupplyDeliveryStatus.ABANDONED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.SupplyDelivery.SupplyDeliveryStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.SupplyDelivery.SupplyDeliveryStatus.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliverySuppliedItemComponent convertSupplyDeliverySuppliedItemComponent(org.hl7.fhir.r4b.model.SupplyDelivery.SupplyDeliverySuppliedItemComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SupplyRequest43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SupplyRequest43_50.java index 13daa76f0d..ffd1fd86fe 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SupplyRequest43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SupplyRequest43_50.java @@ -8,6 +8,9 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; +import org.hl7.fhir.r5.model.SupplyRequest; /* Copyright (c) 2011+, HL7, Inc. @@ -127,121 +130,137 @@ public static org.hl7.fhir.r4b.model.SupplyRequest convertSupplyRequest(org.hl7. } static public org.hl7.fhir.r5.model.Enumeration convertSupplyRequestStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus.ACTIVE); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus.SUSPENDED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus.CANCELLED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new SupplyRequest.SupplyRequestStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(SupplyRequest.SupplyRequestStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(SupplyRequest.SupplyRequestStatus.ACTIVE); + break; + case SUSPENDED: + tgt.setValue(SupplyRequest.SupplyRequestStatus.SUSPENDED); + break; + case CANCELLED: + tgt.setValue(SupplyRequest.SupplyRequestStatus.CANCELLED); + break; + case COMPLETED: + tgt.setValue(SupplyRequest.SupplyRequestStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(SupplyRequest.SupplyRequestStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(SupplyRequest.SupplyRequestStatus.UNKNOWN); + break; + default: + tgt.setValue(SupplyRequest.SupplyRequestStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertSupplyRequestStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.SupplyRequest.SupplyRequestStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r4b.model.SupplyRequest.SupplyRequestStatus.DRAFT); - break; - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.SupplyRequest.SupplyRequestStatus.ACTIVE); - break; - case SUSPENDED: - tgt.setValue(org.hl7.fhir.r4b.model.SupplyRequest.SupplyRequestStatus.SUSPENDED); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4b.model.SupplyRequest.SupplyRequestStatus.CANCELLED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4b.model.SupplyRequest.SupplyRequestStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.SupplyRequest.SupplyRequestStatus.ENTEREDINERROR); - break; - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4b.model.SupplyRequest.SupplyRequestStatus.UNKNOWN); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.SupplyRequest.SupplyRequestStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.SupplyRequest.SupplyRequestStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(org.hl7.fhir.r4b.model.SupplyRequest.SupplyRequestStatus.DRAFT); + break; + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4b.model.SupplyRequest.SupplyRequestStatus.ACTIVE); + break; + case SUSPENDED: + tgt.setValue(org.hl7.fhir.r4b.model.SupplyRequest.SupplyRequestStatus.SUSPENDED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4b.model.SupplyRequest.SupplyRequestStatus.CANCELLED); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4b.model.SupplyRequest.SupplyRequestStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.SupplyRequest.SupplyRequestStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4b.model.SupplyRequest.SupplyRequestStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.SupplyRequest.SupplyRequestStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertRequestPriority(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestPriorityEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP); - break; - case STAT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.RequestPriorityEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(Enumerations.RequestPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(Enumerations.RequestPriority.URGENT); + break; + case ASAP: + tgt.setValue(Enumerations.RequestPriority.ASAP); + break; + case STAT: + tgt.setValue(Enumerations.RequestPriority.STAT); + break; + default: + tgt.setValue(Enumerations.RequestPriority.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertRequestPriority(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestPriorityEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.URGENT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ASAP); - break; - case STAT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.STAT); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestPriorityEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.URGENT); + break; + case ASAP: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ASAP); + break; + case STAT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.STAT); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestParameterComponent convertSupplyRequestParameterComponent(org.hl7.fhir.r4b.model.SupplyRequest.SupplyRequestParameterComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Task43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Task43_50.java index 628fbc992d..57d719c643 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Task43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Task43_50.java @@ -13,6 +13,9 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; +import org.hl7.fhir.r5.model.Task; /* Copyright (c) 2011+, HL7, Inc. @@ -178,231 +181,255 @@ else if (t.hasReference()) } static public org.hl7.fhir.r5.model.Enumeration convertTaskStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Task.TaskStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskStatus.DRAFT); - break; - case REQUESTED: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskStatus.REQUESTED); - break; - case RECEIVED: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskStatus.RECEIVED); - break; - case ACCEPTED: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskStatus.ACCEPTED); - break; - case REJECTED: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskStatus.REJECTED); - break; - case READY: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskStatus.READY); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskStatus.CANCELLED); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskStatus.INPROGRESS); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskStatus.ONHOLD); - break; - case FAILED: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskStatus.FAILED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Task.TaskStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(Task.TaskStatus.DRAFT); + break; + case REQUESTED: + tgt.setValue(Task.TaskStatus.REQUESTED); + break; + case RECEIVED: + tgt.setValue(Task.TaskStatus.RECEIVED); + break; + case ACCEPTED: + tgt.setValue(Task.TaskStatus.ACCEPTED); + break; + case REJECTED: + tgt.setValue(Task.TaskStatus.REJECTED); + break; + case READY: + tgt.setValue(Task.TaskStatus.READY); + break; + case CANCELLED: + tgt.setValue(Task.TaskStatus.CANCELLED); + break; + case INPROGRESS: + tgt.setValue(Task.TaskStatus.INPROGRESS); + break; + case ONHOLD: + tgt.setValue(Task.TaskStatus.ONHOLD); + break; + case FAILED: + tgt.setValue(Task.TaskStatus.FAILED); + break; + case COMPLETED: + tgt.setValue(Task.TaskStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(Task.TaskStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(Task.TaskStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertTaskStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Task.TaskStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case DRAFT: - tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskStatus.DRAFT); - break; - case REQUESTED: - tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskStatus.REQUESTED); - break; - case RECEIVED: - tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskStatus.RECEIVED); - break; - case ACCEPTED: - tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskStatus.ACCEPTED); - break; - case REJECTED: - tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskStatus.REJECTED); - break; - case READY: - tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskStatus.READY); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskStatus.CANCELLED); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskStatus.INPROGRESS); - break; - case ONHOLD: - tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskStatus.ONHOLD); - break; - case FAILED: - tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskStatus.FAILED); - break; - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskStatus.COMPLETED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Task.TaskStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DRAFT: + tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskStatus.DRAFT); + break; + case REQUESTED: + tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskStatus.REQUESTED); + break; + case RECEIVED: + tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskStatus.RECEIVED); + break; + case ACCEPTED: + tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskStatus.ACCEPTED); + break; + case REJECTED: + tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskStatus.REJECTED); + break; + case READY: + tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskStatus.READY); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskStatus.CANCELLED); + break; + case INPROGRESS: + tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskStatus.INPROGRESS); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskStatus.ONHOLD); + break; + case FAILED: + tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskStatus.FAILED); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskStatus.COMPLETED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertTaskIntent(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Task.TaskIntentEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskIntent.UNKNOWN); - break; - case PROPOSAL: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskIntent.PROPOSAL); - break; - case PLAN: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskIntent.PLAN); - break; - case ORDER: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskIntent.ORDER); - break; - case ORIGINALORDER: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskIntent.ORIGINALORDER); - break; - case REFLEXORDER: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskIntent.REFLEXORDER); - break; - case FILLERORDER: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskIntent.FILLERORDER); - break; - case INSTANCEORDER: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskIntent.INSTANCEORDER); - break; - case OPTION: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskIntent.OPTION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Task.TaskIntent.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Task.TaskIntentEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case UNKNOWN: + tgt.setValue(Task.TaskIntent.UNKNOWN); + break; + case PROPOSAL: + tgt.setValue(Task.TaskIntent.PROPOSAL); + break; + case PLAN: + tgt.setValue(Task.TaskIntent.PLAN); + break; + case ORDER: + tgt.setValue(Task.TaskIntent.ORDER); + break; + case ORIGINALORDER: + tgt.setValue(Task.TaskIntent.ORIGINALORDER); + break; + case REFLEXORDER: + tgt.setValue(Task.TaskIntent.REFLEXORDER); + break; + case FILLERORDER: + tgt.setValue(Task.TaskIntent.FILLERORDER); + break; + case INSTANCEORDER: + tgt.setValue(Task.TaskIntent.INSTANCEORDER); + break; + case OPTION: + tgt.setValue(Task.TaskIntent.OPTION); + break; + default: + tgt.setValue(Task.TaskIntent.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertTaskIntent(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Task.TaskIntentEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case UNKNOWN: - tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskIntent.UNKNOWN); - break; - case PROPOSAL: - tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskIntent.PROPOSAL); - break; - case PLAN: - tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskIntent.PLAN); - break; - case ORDER: - tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskIntent.ORDER); - break; - case ORIGINALORDER: - tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskIntent.ORIGINALORDER); - break; - case REFLEXORDER: - tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskIntent.REFLEXORDER); - break; - case FILLERORDER: - tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskIntent.FILLERORDER); - break; - case INSTANCEORDER: - tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskIntent.INSTANCEORDER); - break; - case OPTION: - tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskIntent.OPTION); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskIntent.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Task.TaskIntentEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskIntent.UNKNOWN); + break; + case PROPOSAL: + tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskIntent.PROPOSAL); + break; + case PLAN: + tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskIntent.PLAN); + break; + case ORDER: + tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskIntent.ORDER); + break; + case ORIGINALORDER: + tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskIntent.ORIGINALORDER); + break; + case REFLEXORDER: + tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskIntent.REFLEXORDER); + break; + case FILLERORDER: + tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskIntent.FILLERORDER); + break; + case INSTANCEORDER: + tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskIntent.INSTANCEORDER); + break; + case OPTION: + tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskIntent.OPTION); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Task.TaskIntent.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertTaskPriority(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestPriorityEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP); - break; - case STAT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.RequestPriorityEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(Enumerations.RequestPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(Enumerations.RequestPriority.URGENT); + break; + case ASAP: + tgt.setValue(Enumerations.RequestPriority.ASAP); + break; + case STAT: + tgt.setValue(Enumerations.RequestPriority.STAT); + break; + default: + tgt.setValue(Enumerations.RequestPriority.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertTaskPriority(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestPriorityEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ROUTINE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ROUTINE); - break; - case URGENT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.URGENT); - break; - case ASAP: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ASAP); - break; - case STAT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.STAT); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestPriorityEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ROUTINE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ROUTINE); + break; + case URGENT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.URGENT); + break; + case ASAP: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ASAP); + break; + case STAT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.STAT); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.Task.TaskRestrictionComponent convertTaskRestrictionComponent(org.hl7.fhir.r4b.model.Task.TaskRestrictionComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/TerminologyCapabilities43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/TerminologyCapabilities43_50.java index d0d602a993..97bed006b8 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/TerminologyCapabilities43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/TerminologyCapabilities43_50.java @@ -15,8 +15,10 @@ import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4b.model.CodeType; import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; import org.hl7.fhir.r5.model.Enumerations.CommonLanguages; import org.hl7.fhir.r5.model.Enumerations.CommonLanguagesEnumFactory; +import org.hl7.fhir.r5.model.TerminologyCapabilities; /* Copyright (c) 2011+, HL7, Inc. @@ -162,85 +164,101 @@ public static org.hl7.fhir.r4b.model.TerminologyCapabilities convertTerminologyC } static public org.hl7.fhir.r5.model.Enumeration convertCapabilityStatementKind(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKindEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.INSTANCE); - break; - case CAPABILITY: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.CAPABILITY); - break; - case REQUIREMENTS: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.REQUIREMENTS); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CapabilityStatementKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.CapabilityStatementKindEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(Enumerations.CapabilityStatementKind.INSTANCE); + break; + case CAPABILITY: + tgt.setValue(Enumerations.CapabilityStatementKind.CAPABILITY); + break; + case REQUIREMENTS: + tgt.setValue(Enumerations.CapabilityStatementKind.REQUIREMENTS); + break; + default: + tgt.setValue(Enumerations.CapabilityStatementKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertCapabilityStatementKind(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.CapabilityStatementKindEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case INSTANCE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CapabilityStatementKind.INSTANCE); - break; - case CAPABILITY: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CapabilityStatementKind.CAPABILITY); - break; - case REQUIREMENTS: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CapabilityStatementKind.REQUIREMENTS); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CapabilityStatementKind.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.CapabilityStatementKindEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CapabilityStatementKind.INSTANCE); + break; + case CAPABILITY: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CapabilityStatementKind.CAPABILITY); + break; + case REQUIREMENTS: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CapabilityStatementKind.REQUIREMENTS); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CapabilityStatementKind.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertCodeSearchSupport(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TerminologyCapabilities.CodeSearchSupportEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case EXPLICIT: - tgt.setValue(org.hl7.fhir.r5.model.TerminologyCapabilities.CodeSearchSupport.INCOMPOSE); - break; - case ALL: - tgt.setValue(org.hl7.fhir.r5.model.TerminologyCapabilities.CodeSearchSupport.INCOMPOSEOREXPANSION); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.TerminologyCapabilities.CodeSearchSupport.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new TerminologyCapabilities.CodeSearchSupportEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EXPLICIT: + tgt.setValue(TerminologyCapabilities.CodeSearchSupport.INCOMPOSE); + break; + case ALL: + tgt.setValue(TerminologyCapabilities.CodeSearchSupport.INCOMPOSEOREXPANSION); + break; + default: + tgt.setValue(TerminologyCapabilities.CodeSearchSupport.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertCodeSearchSupport(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.TerminologyCapabilities.CodeSearchSupportEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case INCOMPOSE: - tgt.setValue(org.hl7.fhir.r4b.model.TerminologyCapabilities.CodeSearchSupport.EXPLICIT); - break; - case INCOMPOSEOREXPANSION: - tgt.setValue(org.hl7.fhir.r4b.model.TerminologyCapabilities.CodeSearchSupport.ALL); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.TerminologyCapabilities.CodeSearchSupport.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.TerminologyCapabilities.CodeSearchSupportEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case INCOMPOSE: + tgt.setValue(org.hl7.fhir.r4b.model.TerminologyCapabilities.CodeSearchSupport.EXPLICIT); + break; + case INCOMPOSEOREXPANSION: + tgt.setValue(org.hl7.fhir.r4b.model.TerminologyCapabilities.CodeSearchSupport.ALL); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.TerminologyCapabilities.CodeSearchSupport.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesSoftwareComponent convertTerminologyCapabilitiesSoftwareComponent(org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesSoftwareComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/TestReport43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/TestReport43_50.java index e1b3613bec..fd4c2af897 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/TestReport43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/TestReport43_50.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4b.model.Reference; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.TestReport; /* Copyright (c) 2011+, HL7, Inc. @@ -106,103 +108,119 @@ public static org.hl7.fhir.r4b.model.TestReport convertTestReport(org.hl7.fhir.r } static public org.hl7.fhir.r5.model.Enumeration convertTestReportStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TestReport.TestReportStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case COMPLETED: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportStatus.COMPLETED); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportStatus.INPROGRESS); - break; - case WAITING: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportStatus.WAITING); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportStatus.STOPPED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new TestReport.TestReportStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case COMPLETED: + tgt.setValue(TestReport.TestReportStatus.COMPLETED); + break; + case INPROGRESS: + tgt.setValue(TestReport.TestReportStatus.INPROGRESS); + break; + case WAITING: + tgt.setValue(TestReport.TestReportStatus.WAITING); + break; + case STOPPED: + tgt.setValue(TestReport.TestReportStatus.STOPPED); + break; + case ENTEREDINERROR: + tgt.setValue(TestReport.TestReportStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(TestReport.TestReportStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertTestReportStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.TestReport.TestReportStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case COMPLETED: - tgt.setValue(org.hl7.fhir.r4b.model.TestReport.TestReportStatus.COMPLETED); - break; - case INPROGRESS: - tgt.setValue(org.hl7.fhir.r4b.model.TestReport.TestReportStatus.INPROGRESS); - break; - case WAITING: - tgt.setValue(org.hl7.fhir.r4b.model.TestReport.TestReportStatus.WAITING); - break; - case STOPPED: - tgt.setValue(org.hl7.fhir.r4b.model.TestReport.TestReportStatus.STOPPED); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.TestReport.TestReportStatus.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.TestReport.TestReportStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.TestReport.TestReportStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4b.model.TestReport.TestReportStatus.COMPLETED); + break; + case INPROGRESS: + tgt.setValue(org.hl7.fhir.r4b.model.TestReport.TestReportStatus.INPROGRESS); + break; + case WAITING: + tgt.setValue(org.hl7.fhir.r4b.model.TestReport.TestReportStatus.WAITING); + break; + case STOPPED: + tgt.setValue(org.hl7.fhir.r4b.model.TestReport.TestReportStatus.STOPPED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.TestReport.TestReportStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.TestReport.TestReportStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertTestReportResult(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TestReport.TestReportResultEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PASS: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportResult.PASS); - break; - case FAIL: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportResult.FAIL); - break; - case PENDING: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportResult.PENDING); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportResult.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new TestReport.TestReportResultEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PASS: + tgt.setValue(TestReport.TestReportResult.PASS); + break; + case FAIL: + tgt.setValue(TestReport.TestReportResult.FAIL); + break; + case PENDING: + tgt.setValue(TestReport.TestReportResult.PENDING); + break; + default: + tgt.setValue(TestReport.TestReportResult.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertTestReportResult(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.TestReport.TestReportResultEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PASS: - tgt.setValue(org.hl7.fhir.r4b.model.TestReport.TestReportResult.PASS); - break; - case FAIL: - tgt.setValue(org.hl7.fhir.r4b.model.TestReport.TestReportResult.FAIL); - break; - case PENDING: - tgt.setValue(org.hl7.fhir.r4b.model.TestReport.TestReportResult.PENDING); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.TestReport.TestReportResult.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.TestReport.TestReportResultEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PASS: + tgt.setValue(org.hl7.fhir.r4b.model.TestReport.TestReportResult.PASS); + break; + case FAIL: + tgt.setValue(org.hl7.fhir.r4b.model.TestReport.TestReportResult.FAIL); + break; + case PENDING: + tgt.setValue(org.hl7.fhir.r4b.model.TestReport.TestReportResult.PENDING); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.TestReport.TestReportResult.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.TestReport.TestReportParticipantComponent convertTestReportParticipantComponent(org.hl7.fhir.r4b.model.TestReport.TestReportParticipantComponent src) throws FHIRException { @@ -234,47 +252,55 @@ public static org.hl7.fhir.r4b.model.TestReport.TestReportParticipantComponent c } static public org.hl7.fhir.r5.model.Enumeration convertTestReportParticipantType(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TestReport.TestReportParticipantTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case TESTENGINE: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportParticipantType.TESTENGINE); - break; - case CLIENT: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportParticipantType.CLIENT); - break; - case SERVER: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportParticipantType.SERVER); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportParticipantType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new TestReport.TestReportParticipantTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case TESTENGINE: + tgt.setValue(TestReport.TestReportParticipantType.TESTENGINE); + break; + case CLIENT: + tgt.setValue(TestReport.TestReportParticipantType.CLIENT); + break; + case SERVER: + tgt.setValue(TestReport.TestReportParticipantType.SERVER); + break; + default: + tgt.setValue(TestReport.TestReportParticipantType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertTestReportParticipantType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.TestReport.TestReportParticipantTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case TESTENGINE: - tgt.setValue(org.hl7.fhir.r4b.model.TestReport.TestReportParticipantType.TESTENGINE); - break; - case CLIENT: - tgt.setValue(org.hl7.fhir.r4b.model.TestReport.TestReportParticipantType.CLIENT); - break; - case SERVER: - tgt.setValue(org.hl7.fhir.r4b.model.TestReport.TestReportParticipantType.SERVER); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.TestReport.TestReportParticipantType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.TestReport.TestReportParticipantTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case TESTENGINE: + tgt.setValue(org.hl7.fhir.r4b.model.TestReport.TestReportParticipantType.TESTENGINE); + break; + case CLIENT: + tgt.setValue(org.hl7.fhir.r4b.model.TestReport.TestReportParticipantType.CLIENT); + break; + case SERVER: + tgt.setValue(org.hl7.fhir.r4b.model.TestReport.TestReportParticipantType.SERVER); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.TestReport.TestReportParticipantType.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.TestReport.TestReportSetupComponent convertTestReportSetupComponent(org.hl7.fhir.r4b.model.TestReport.TestReportSetupComponent src) throws FHIRException { @@ -350,59 +376,67 @@ public static org.hl7.fhir.r4b.model.TestReport.SetupActionOperationComponent co } static public org.hl7.fhir.r5.model.Enumeration convertTestReportActionResult(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TestReport.TestReportActionResultEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PASS: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportActionResult.PASS); - break; - case SKIP: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportActionResult.SKIP); - break; - case FAIL: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportActionResult.FAIL); - break; - case WARNING: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportActionResult.WARNING); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportActionResult.ERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportActionResult.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new TestReport.TestReportActionResultEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PASS: + tgt.setValue(TestReport.TestReportActionResult.PASS); + break; + case SKIP: + tgt.setValue(TestReport.TestReportActionResult.SKIP); + break; + case FAIL: + tgt.setValue(TestReport.TestReportActionResult.FAIL); + break; + case WARNING: + tgt.setValue(TestReport.TestReportActionResult.WARNING); + break; + case ERROR: + tgt.setValue(TestReport.TestReportActionResult.ERROR); + break; + default: + tgt.setValue(TestReport.TestReportActionResult.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertTestReportActionResult(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.TestReport.TestReportActionResultEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case PASS: - tgt.setValue(org.hl7.fhir.r4b.model.TestReport.TestReportActionResult.PASS); - break; - case SKIP: - tgt.setValue(org.hl7.fhir.r4b.model.TestReport.TestReportActionResult.SKIP); - break; - case FAIL: - tgt.setValue(org.hl7.fhir.r4b.model.TestReport.TestReportActionResult.FAIL); - break; - case WARNING: - tgt.setValue(org.hl7.fhir.r4b.model.TestReport.TestReportActionResult.WARNING); - break; - case ERROR: - tgt.setValue(org.hl7.fhir.r4b.model.TestReport.TestReportActionResult.ERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.TestReport.TestReportActionResult.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.TestReport.TestReportActionResultEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case PASS: + tgt.setValue(org.hl7.fhir.r4b.model.TestReport.TestReportActionResult.PASS); + break; + case SKIP: + tgt.setValue(org.hl7.fhir.r4b.model.TestReport.TestReportActionResult.SKIP); + break; + case FAIL: + tgt.setValue(org.hl7.fhir.r4b.model.TestReport.TestReportActionResult.FAIL); + break; + case WARNING: + tgt.setValue(org.hl7.fhir.r4b.model.TestReport.TestReportActionResult.WARNING); + break; + case ERROR: + tgt.setValue(org.hl7.fhir.r4b.model.TestReport.TestReportActionResult.ERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.TestReport.TestReportActionResult.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.TestReport.SetupActionAssertComponent convertSetupActionAssertComponent(org.hl7.fhir.r4b.model.TestReport.SetupActionAssertComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/TestScript43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/TestScript43_50.java index e340f3f14c..cd90088e1f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/TestScript43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/TestScript43_50.java @@ -18,6 +18,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CanonicalType; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.TestScript; import org.hl7.fhir.r5.model.TestScript.TestScriptScopeComponent; /* @@ -534,71 +536,79 @@ public static org.hl7.fhir.r4b.model.TestScript.SetupActionOperationComponent co } static public org.hl7.fhir.r5.model.Enumeration convertTestScriptRequestMethodCode(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCodeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case DELETE: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.DELETE); - break; - case GET: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.GET); - break; - case OPTIONS: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.OPTIONS); - break; - case PATCH: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.PATCH); - break; - case POST: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.POST); - break; - case PUT: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.PUT); - break; - case HEAD: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.HEAD); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new TestScript.TestScriptRequestMethodCodeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DELETE: + tgt.setValue(TestScript.TestScriptRequestMethodCode.DELETE); + break; + case GET: + tgt.setValue(TestScript.TestScriptRequestMethodCode.GET); + break; + case OPTIONS: + tgt.setValue(TestScript.TestScriptRequestMethodCode.OPTIONS); + break; + case PATCH: + tgt.setValue(TestScript.TestScriptRequestMethodCode.PATCH); + break; + case POST: + tgt.setValue(TestScript.TestScriptRequestMethodCode.POST); + break; + case PUT: + tgt.setValue(TestScript.TestScriptRequestMethodCode.PUT); + break; + case HEAD: + tgt.setValue(TestScript.TestScriptRequestMethodCode.HEAD); + break; + default: + tgt.setValue(TestScript.TestScriptRequestMethodCode.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertTestScriptRequestMethodCode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.TestScript.TestScriptRequestMethodCodeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case DELETE: - tgt.setValue(org.hl7.fhir.r4b.model.TestScript.TestScriptRequestMethodCode.DELETE); - break; - case GET: - tgt.setValue(org.hl7.fhir.r4b.model.TestScript.TestScriptRequestMethodCode.GET); - break; - case OPTIONS: - tgt.setValue(org.hl7.fhir.r4b.model.TestScript.TestScriptRequestMethodCode.OPTIONS); - break; - case PATCH: - tgt.setValue(org.hl7.fhir.r4b.model.TestScript.TestScriptRequestMethodCode.PATCH); - break; - case POST: - tgt.setValue(org.hl7.fhir.r4b.model.TestScript.TestScriptRequestMethodCode.POST); - break; - case PUT: - tgt.setValue(org.hl7.fhir.r4b.model.TestScript.TestScriptRequestMethodCode.PUT); - break; - case HEAD: - tgt.setValue(org.hl7.fhir.r4b.model.TestScript.TestScriptRequestMethodCode.HEAD); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.TestScript.TestScriptRequestMethodCode.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.TestScript.TestScriptRequestMethodCodeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case DELETE: + tgt.setValue(org.hl7.fhir.r4b.model.TestScript.TestScriptRequestMethodCode.DELETE); + break; + case GET: + tgt.setValue(org.hl7.fhir.r4b.model.TestScript.TestScriptRequestMethodCode.GET); + break; + case OPTIONS: + tgt.setValue(org.hl7.fhir.r4b.model.TestScript.TestScriptRequestMethodCode.OPTIONS); + break; + case PATCH: + tgt.setValue(org.hl7.fhir.r4b.model.TestScript.TestScriptRequestMethodCode.PATCH); + break; + case POST: + tgt.setValue(org.hl7.fhir.r4b.model.TestScript.TestScriptRequestMethodCode.POST); + break; + case PUT: + tgt.setValue(org.hl7.fhir.r4b.model.TestScript.TestScriptRequestMethodCode.PUT); + break; + case HEAD: + tgt.setValue(org.hl7.fhir.r4b.model.TestScript.TestScriptRequestMethodCode.HEAD); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.TestScript.TestScriptRequestMethodCode.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.TestScript.SetupActionOperationRequestHeaderComponent convertSetupActionOperationRequestHeaderComponent(org.hl7.fhir.r4b.model.TestScript.SetupActionOperationRequestHeaderComponent src) throws FHIRException { @@ -730,231 +740,255 @@ public static org.hl7.fhir.r4b.model.TestScript.SetupActionAssertComponent conve } static public org.hl7.fhir.r5.model.Enumeration convertAssertionDirectionType(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TestScript.AssertionDirectionTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case RESPONSE: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionDirectionType.RESPONSE); - break; - case REQUEST: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionDirectionType.REQUEST); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionDirectionType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new TestScript.AssertionDirectionTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case RESPONSE: + tgt.setValue(TestScript.AssertionDirectionType.RESPONSE); + break; + case REQUEST: + tgt.setValue(TestScript.AssertionDirectionType.REQUEST); + break; + default: + tgt.setValue(TestScript.AssertionDirectionType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertAssertionDirectionType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.TestScript.AssertionDirectionTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case RESPONSE: - tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionDirectionType.RESPONSE); - break; - case REQUEST: - tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionDirectionType.REQUEST); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionDirectionType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.TestScript.AssertionDirectionTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case RESPONSE: + tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionDirectionType.RESPONSE); + break; + case REQUEST: + tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionDirectionType.REQUEST); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionDirectionType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertAssertionOperatorType(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TestScript.AssertionOperatorTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case EQUALS: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.EQUALS); - break; - case NOTEQUALS: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NOTEQUALS); - break; - case IN: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NOTIN); - break; - case GREATERTHAN: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.GREATERTHAN); - break; - case LESSTHAN: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.LESSTHAN); - break; - case EMPTY: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.EMPTY); - break; - case NOTEMPTY: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NOTEMPTY); - break; - case CONTAINS: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.CONTAINS); - break; - case NOTCONTAINS: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NOTCONTAINS); - break; - case EVAL: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.EVAL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new TestScript.AssertionOperatorTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUALS: + tgt.setValue(TestScript.AssertionOperatorType.EQUALS); + break; + case NOTEQUALS: + tgt.setValue(TestScript.AssertionOperatorType.NOTEQUALS); + break; + case IN: + tgt.setValue(TestScript.AssertionOperatorType.IN); + break; + case NOTIN: + tgt.setValue(TestScript.AssertionOperatorType.NOTIN); + break; + case GREATERTHAN: + tgt.setValue(TestScript.AssertionOperatorType.GREATERTHAN); + break; + case LESSTHAN: + tgt.setValue(TestScript.AssertionOperatorType.LESSTHAN); + break; + case EMPTY: + tgt.setValue(TestScript.AssertionOperatorType.EMPTY); + break; + case NOTEMPTY: + tgt.setValue(TestScript.AssertionOperatorType.NOTEMPTY); + break; + case CONTAINS: + tgt.setValue(TestScript.AssertionOperatorType.CONTAINS); + break; + case NOTCONTAINS: + tgt.setValue(TestScript.AssertionOperatorType.NOTCONTAINS); + break; + case EVAL: + tgt.setValue(TestScript.AssertionOperatorType.EVAL); + break; + default: + tgt.setValue(TestScript.AssertionOperatorType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertAssertionOperatorType(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.TestScript.AssertionOperatorTypeEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case EQUALS: - tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionOperatorType.EQUALS); - break; - case NOTEQUALS: - tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionOperatorType.NOTEQUALS); - break; - case IN: - tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionOperatorType.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionOperatorType.NOTIN); - break; - case GREATERTHAN: - tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionOperatorType.GREATERTHAN); - break; - case LESSTHAN: - tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionOperatorType.LESSTHAN); - break; - case EMPTY: - tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionOperatorType.EMPTY); - break; - case NOTEMPTY: - tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionOperatorType.NOTEMPTY); - break; - case CONTAINS: - tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionOperatorType.CONTAINS); - break; - case NOTCONTAINS: - tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionOperatorType.NOTCONTAINS); - break; - case EVAL: - tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionOperatorType.EVAL); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionOperatorType.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.TestScript.AssertionOperatorTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUALS: + tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionOperatorType.EQUALS); + break; + case NOTEQUALS: + tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionOperatorType.NOTEQUALS); + break; + case IN: + tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionOperatorType.IN); + break; + case NOTIN: + tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionOperatorType.NOTIN); + break; + case GREATERTHAN: + tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionOperatorType.GREATERTHAN); + break; + case LESSTHAN: + tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionOperatorType.LESSTHAN); + break; + case EMPTY: + tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionOperatorType.EMPTY); + break; + case NOTEMPTY: + tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionOperatorType.NOTEMPTY); + break; + case CONTAINS: + tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionOperatorType.CONTAINS); + break; + case NOTCONTAINS: + tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionOperatorType.NOTCONTAINS); + break; + case EVAL: + tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionOperatorType.EVAL); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionOperatorType.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r5.model.Enumeration convertAssertionResponseTypes(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TestScript.AssertionResponseTypesEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case OKAY: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.OKAY); - break; - case CREATED: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.CREATED); - break; - case NOCONTENT: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.NOCONTENT); - break; - case NOTMODIFIED: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.NOTMODIFIED); - break; - case BAD: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.BADREQUEST); - break; - case FORBIDDEN: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.FORBIDDEN); - break; - case NOTFOUND: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.NOTFOUND); - break; - case METHODNOTALLOWED: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.METHODNOTALLOWED); - break; - case CONFLICT: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.CONFLICT); - break; - case GONE: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.GONE); - break; - case PRECONDITIONFAILED: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.PRECONDITIONFAILED); - break; - case UNPROCESSABLE: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.UNPROCESSABLECONTENT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new TestScript.AssertionResponseTypesEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OKAY: + tgt.setValue(TestScript.AssertionResponseTypes.OKAY); + break; + case CREATED: + tgt.setValue(TestScript.AssertionResponseTypes.CREATED); + break; + case NOCONTENT: + tgt.setValue(TestScript.AssertionResponseTypes.NOCONTENT); + break; + case NOTMODIFIED: + tgt.setValue(TestScript.AssertionResponseTypes.NOTMODIFIED); + break; + case BAD: + tgt.setValue(TestScript.AssertionResponseTypes.BADREQUEST); + break; + case FORBIDDEN: + tgt.setValue(TestScript.AssertionResponseTypes.FORBIDDEN); + break; + case NOTFOUND: + tgt.setValue(TestScript.AssertionResponseTypes.NOTFOUND); + break; + case METHODNOTALLOWED: + tgt.setValue(TestScript.AssertionResponseTypes.METHODNOTALLOWED); + break; + case CONFLICT: + tgt.setValue(TestScript.AssertionResponseTypes.CONFLICT); + break; + case GONE: + tgt.setValue(TestScript.AssertionResponseTypes.GONE); + break; + case PRECONDITIONFAILED: + tgt.setValue(TestScript.AssertionResponseTypes.PRECONDITIONFAILED); + break; + case UNPROCESSABLE: + tgt.setValue(TestScript.AssertionResponseTypes.UNPROCESSABLECONTENT); + break; + default: + tgt.setValue(TestScript.AssertionResponseTypes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertAssertionResponseTypes(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.TestScript.AssertionResponseTypesEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case OKAY: - tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionResponseTypes.OKAY); - break; - case CREATED: - tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionResponseTypes.CREATED); - break; - case NOCONTENT: - tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionResponseTypes.NOCONTENT); - break; - case NOTMODIFIED: - tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionResponseTypes.NOTMODIFIED); - break; - case BADREQUEST: - tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionResponseTypes.BAD); - break; - case FORBIDDEN: - tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionResponseTypes.FORBIDDEN); - break; - case NOTFOUND: - tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionResponseTypes.NOTFOUND); - break; - case METHODNOTALLOWED: - tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionResponseTypes.METHODNOTALLOWED); - break; - case CONFLICT: - tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionResponseTypes.CONFLICT); - break; - case GONE: - tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionResponseTypes.GONE); - break; - case PRECONDITIONFAILED: - tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionResponseTypes.PRECONDITIONFAILED); - break; - case UNPROCESSABLECONTENT: - tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionResponseTypes.UNPROCESSABLE); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionResponseTypes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.TestScript.AssertionResponseTypesEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case OKAY: + tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionResponseTypes.OKAY); + break; + case CREATED: + tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionResponseTypes.CREATED); + break; + case NOCONTENT: + tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionResponseTypes.NOCONTENT); + break; + case NOTMODIFIED: + tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionResponseTypes.NOTMODIFIED); + break; + case BADREQUEST: + tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionResponseTypes.BAD); + break; + case FORBIDDEN: + tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionResponseTypes.FORBIDDEN); + break; + case NOTFOUND: + tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionResponseTypes.NOTFOUND); + break; + case METHODNOTALLOWED: + tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionResponseTypes.METHODNOTALLOWED); + break; + case CONFLICT: + tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionResponseTypes.CONFLICT); + break; + case GONE: + tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionResponseTypes.GONE); + break; + case PRECONDITIONFAILED: + tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionResponseTypes.PRECONDITIONFAILED); + break; + case UNPROCESSABLECONTENT: + tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionResponseTypes.UNPROCESSABLE); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.TestScript.AssertionResponseTypes.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.TestScript.TestScriptTestComponent convertTestScriptTestComponent(org.hl7.fhir.r4b.model.TestScript.TestScriptTestComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ValueSet43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ValueSet43_50.java index 332b090f2a..91fc1f09ec 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ValueSet43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ValueSet43_50.java @@ -17,6 +17,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; import org.hl7.fhir.r5.model.ValueSet; /* @@ -291,83 +293,91 @@ public static org.hl7.fhir.r4b.model.ValueSet.ConceptSetFilterComponent convertC } static public org.hl7.fhir.r5.model.Enumeration convertFilterOperator(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.FilterOperatorEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case EQUAL: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.EQUAL); - break; - case ISA: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.ISA); - break; - case DESCENDENTOF: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.DESCENDENTOF); - break; - case ISNOTA: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.ISNOTA); - break; - case REGEX: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.REGEX); - break; - case IN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.NOTIN); - break; - case GENERALIZES: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.GENERALIZES); - break; - case EXISTS: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.EXISTS); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.FilterOperatorEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUAL: + tgt.setValue(Enumerations.FilterOperator.EQUAL); + break; + case ISA: + tgt.setValue(Enumerations.FilterOperator.ISA); + break; + case DESCENDENTOF: + tgt.setValue(Enumerations.FilterOperator.DESCENDENTOF); + break; + case ISNOTA: + tgt.setValue(Enumerations.FilterOperator.ISNOTA); + break; + case REGEX: + tgt.setValue(Enumerations.FilterOperator.REGEX); + break; + case IN: + tgt.setValue(Enumerations.FilterOperator.IN); + break; + case NOTIN: + tgt.setValue(Enumerations.FilterOperator.NOTIN); + break; + case GENERALIZES: + tgt.setValue(Enumerations.FilterOperator.GENERALIZES); + break; + case EXISTS: + tgt.setValue(Enumerations.FilterOperator.EXISTS); + break; + default: + tgt.setValue(Enumerations.FilterOperator.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertFilterOperator(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.FilterOperatorEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case EQUAL: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.EQUAL); - break; - case ISA: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.ISA); - break; - case DESCENDENTOF: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.DESCENDENTOF); - break; - case ISNOTA: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.ISNOTA); - break; - case REGEX: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.REGEX); - break; - case IN: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.IN); - break; - case NOTIN: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.NOTIN); - break; - case GENERALIZES: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.GENERALIZES); - break; - case EXISTS: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.EXISTS); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.FilterOperatorEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case EQUAL: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.EQUAL); + break; + case ISA: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.ISA); + break; + case DESCENDENTOF: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.DESCENDENTOF); + break; + case ISNOTA: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.ISNOTA); + break; + case REGEX: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.REGEX); + break; + case IN: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.IN); + break; + case NOTIN: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.NOTIN); + break; + case GENERALIZES: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.GENERALIZES); + break; + case EXISTS: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.EXISTS); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionComponent convertValueSetExpansionComponent(org.hl7.fhir.r4b.model.ValueSet.ValueSetExpansionComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/VerificationResult43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/VerificationResult43_50.java index d94e1105e2..3f932ba49d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/VerificationResult43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/VerificationResult43_50.java @@ -9,6 +9,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.VerificationResult; /* Copyright (c) 2011+, HL7, Inc. @@ -112,65 +114,73 @@ public static org.hl7.fhir.r4b.model.VerificationResult convertVerificationResul } static public org.hl7.fhir.r5.model.Enumeration convertStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.VerificationResult.VerificationResultStatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ATTESTED: - tgt.setValue(org.hl7.fhir.r5.model.VerificationResult.VerificationResultStatus.ATTESTED); - break; - case VALIDATED: - tgt.setValue(org.hl7.fhir.r5.model.VerificationResult.VerificationResultStatus.VALIDATED); - break; - case INPROCESS: - tgt.setValue(org.hl7.fhir.r5.model.VerificationResult.VerificationResultStatus.INPROCESS); - break; - case REQREVALID: - tgt.setValue(org.hl7.fhir.r5.model.VerificationResult.VerificationResultStatus.REQREVALID); - break; - case VALFAIL: - tgt.setValue(org.hl7.fhir.r5.model.VerificationResult.VerificationResultStatus.VALFAIL); - break; - case REVALFAIL: - tgt.setValue(org.hl7.fhir.r5.model.VerificationResult.VerificationResultStatus.REVALFAIL); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.VerificationResult.VerificationResultStatus.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new VerificationResult.VerificationResultStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ATTESTED: + tgt.setValue(VerificationResult.VerificationResultStatus.ATTESTED); + break; + case VALIDATED: + tgt.setValue(VerificationResult.VerificationResultStatus.VALIDATED); + break; + case INPROCESS: + tgt.setValue(VerificationResult.VerificationResultStatus.INPROCESS); + break; + case REQREVALID: + tgt.setValue(VerificationResult.VerificationResultStatus.REQREVALID); + break; + case VALFAIL: + tgt.setValue(VerificationResult.VerificationResultStatus.VALFAIL); + break; + case REVALFAIL: + tgt.setValue(VerificationResult.VerificationResultStatus.REVALFAIL); + break; + default: + tgt.setValue(VerificationResult.VerificationResultStatus.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.VerificationResult.StatusEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ATTESTED: - tgt.setValue(org.hl7.fhir.r4b.model.VerificationResult.Status.ATTESTED); - break; - case VALIDATED: - tgt.setValue(org.hl7.fhir.r4b.model.VerificationResult.Status.VALIDATED); - break; - case INPROCESS: - tgt.setValue(org.hl7.fhir.r4b.model.VerificationResult.Status.INPROCESS); - break; - case REQREVALID: - tgt.setValue(org.hl7.fhir.r4b.model.VerificationResult.Status.REQREVALID); - break; - case VALFAIL: - tgt.setValue(org.hl7.fhir.r4b.model.VerificationResult.Status.VALFAIL); - break; - case REVALFAIL: - tgt.setValue(org.hl7.fhir.r4b.model.VerificationResult.Status.REVALFAIL); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.VerificationResult.Status.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.VerificationResult.StatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ATTESTED: + tgt.setValue(org.hl7.fhir.r4b.model.VerificationResult.Status.ATTESTED); + break; + case VALIDATED: + tgt.setValue(org.hl7.fhir.r4b.model.VerificationResult.Status.VALIDATED); + break; + case INPROCESS: + tgt.setValue(org.hl7.fhir.r4b.model.VerificationResult.Status.INPROCESS); + break; + case REQREVALID: + tgt.setValue(org.hl7.fhir.r4b.model.VerificationResult.Status.REQREVALID); + break; + case VALFAIL: + tgt.setValue(org.hl7.fhir.r4b.model.VerificationResult.Status.VALFAIL); + break; + case REVALFAIL: + tgt.setValue(org.hl7.fhir.r4b.model.VerificationResult.Status.REVALFAIL); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.VerificationResult.Status.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.VerificationResult.VerificationResultPrimarySourceComponent convertVerificationResultPrimarySourceComponent(org.hl7.fhir.r4b.model.VerificationResult.VerificationResultPrimarySourceComponent src) throws FHIRException { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/VisionPrescription43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/VisionPrescription43_50.java index b382069184..b093d2d200 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/VisionPrescription43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/VisionPrescription43_50.java @@ -11,6 +11,9 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations; +import org.hl7.fhir.r5.model.VisionPrescription; /* Copyright (c) 2011+, HL7, Inc. @@ -92,53 +95,61 @@ public static org.hl7.fhir.r4b.model.VisionPrescription convertVisionPrescriptio } static public org.hl7.fhir.r5.model.Enumeration convertVisionStatus(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodesEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.CANCELLED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new Enumerations.FinancialResourceStatusCodesEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.ACTIVE); + break; + case CANCELLED: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.CANCELLED); + break; + case DRAFT: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); + break; + default: + tgt.setValue(Enumerations.FinancialResourceStatusCodes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertVisionStatus(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodesEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case ACTIVE: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.ACTIVE); - break; - case CANCELLED: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.CANCELLED); - break; - case DRAFT: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.DRAFT); - break; - case ENTEREDINERROR: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodesEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.ACTIVE); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.CANCELLED); + break; + case DRAFT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.DRAFT); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.VisionPrescription.VisionPrescriptionLensSpecificationComponent convertVisionPrescriptionLensSpecificationComponent(org.hl7.fhir.r4b.model.VisionPrescription.VisionPrescriptionLensSpecificationComponent src) throws FHIRException { @@ -212,41 +223,49 @@ public static org.hl7.fhir.r4b.model.VisionPrescription.VisionPrescriptionLensSp } static public org.hl7.fhir.r5.model.Enumeration convertVisionEyes(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.VisionPrescription.VisionEyesEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case RIGHT: - tgt.setValue(org.hl7.fhir.r5.model.VisionPrescription.VisionEyes.RIGHT); - break; - case LEFT: - tgt.setValue(org.hl7.fhir.r5.model.VisionPrescription.VisionEyes.LEFT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.VisionPrescription.VisionEyes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new VisionPrescription.VisionEyesEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case RIGHT: + tgt.setValue(VisionPrescription.VisionEyes.RIGHT); + break; + case LEFT: + tgt.setValue(VisionPrescription.VisionEyes.LEFT); + break; + default: + tgt.setValue(VisionPrescription.VisionEyes.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertVisionEyes(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.VisionPrescription.VisionEyesEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case RIGHT: - tgt.setValue(org.hl7.fhir.r4b.model.VisionPrescription.VisionEyes.RIGHT); - break; - case LEFT: - tgt.setValue(org.hl7.fhir.r4b.model.VisionPrescription.VisionEyes.LEFT); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.VisionPrescription.VisionEyes.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.VisionPrescription.VisionEyesEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case RIGHT: + tgt.setValue(org.hl7.fhir.r4b.model.VisionPrescription.VisionEyes.RIGHT); + break; + case LEFT: + tgt.setValue(org.hl7.fhir.r4b.model.VisionPrescription.VisionEyes.LEFT); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.VisionPrescription.VisionEyes.NULL); + break; + } + } + return tgt; } public static org.hl7.fhir.r5.model.VisionPrescription.PrismComponent convertPrismComponent(org.hl7.fhir.r4b.model.VisionPrescription.PrismComponent src) throws FHIRException { @@ -274,52 +293,60 @@ public static org.hl7.fhir.r4b.model.VisionPrescription.PrismComponent convertPr } static public org.hl7.fhir.r5.model.Enumeration convertVisionBase(org.hl7.fhir.r4b.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r5.model.Enumeration tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.VisionPrescription.VisionBaseEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case UP: - tgt.setValue(org.hl7.fhir.r5.model.VisionPrescription.VisionBase.UP); - break; - case DOWN: - tgt.setValue(org.hl7.fhir.r5.model.VisionPrescription.VisionBase.DOWN); - break; - case IN: - tgt.setValue(org.hl7.fhir.r5.model.VisionPrescription.VisionBase.IN); - break; - case OUT: - tgt.setValue(org.hl7.fhir.r5.model.VisionPrescription.VisionBase.OUT); - break; - default: - tgt.setValue(org.hl7.fhir.r5.model.VisionPrescription.VisionBase.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + Enumeration tgt = new Enumeration<>(new VisionPrescription.VisionBaseEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case UP: + tgt.setValue(VisionPrescription.VisionBase.UP); + break; + case DOWN: + tgt.setValue(VisionPrescription.VisionBase.DOWN); + break; + case IN: + tgt.setValue(VisionPrescription.VisionBase.IN); + break; + case OUT: + tgt.setValue(VisionPrescription.VisionBase.OUT); + break; + default: + tgt.setValue(VisionPrescription.VisionBase.NULL); + break; + } + } + return tgt; } static public org.hl7.fhir.r4b.model.Enumeration convertVisionBase(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { - if (src == null || src.isEmpty()) - return null; - org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.VisionPrescription.VisionBaseEnumFactory()); - ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); - switch (src.getValue()) { - case UP: - tgt.setValue(org.hl7.fhir.r4b.model.VisionPrescription.VisionBase.UP); - break; - case DOWN: - tgt.setValue(org.hl7.fhir.r4b.model.VisionPrescription.VisionBase.DOWN); - break; - case IN: - tgt.setValue(org.hl7.fhir.r4b.model.VisionPrescription.VisionBase.IN); - break; - case OUT: - tgt.setValue(org.hl7.fhir.r4b.model.VisionPrescription.VisionBase.OUT); - break; - default: - tgt.setValue(org.hl7.fhir.r4b.model.VisionPrescription.VisionBase.NULL); - break; - } - return tgt; + if (src == null || src.isEmpty()) + return null; + org.hl7.fhir.r4b.model.Enumeration tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.VisionPrescription.VisionBaseEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue() == null) { + tgt.setValue(null); + } else { + switch (src.getValue()) { + case UP: + tgt.setValue(org.hl7.fhir.r4b.model.VisionPrescription.VisionBase.UP); + break; + case DOWN: + tgt.setValue(org.hl7.fhir.r4b.model.VisionPrescription.VisionBase.DOWN); + break; + case IN: + tgt.setValue(org.hl7.fhir.r4b.model.VisionPrescription.VisionBase.IN); + break; + case OUT: + tgt.setValue(org.hl7.fhir.r4b.model.VisionPrescription.VisionBase.OUT); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.VisionPrescription.VisionBase.NULL); + break; + } + } + return tgt; } } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/conv30_40/DocumentReference30_40Test.java b/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/conv30_40/DocumentReference30_40Test.java new file mode 100644 index 0000000000..e8ddf43aee --- /dev/null +++ b/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/conv30_40/DocumentReference30_40Test.java @@ -0,0 +1,20 @@ +package org.hl7.fhir.convertors.conv30_40; + +import org.hl7.fhir.convertors.factory.VersionConvertorFactory_30_40; + + +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.AssertionsForClassTypes.assertThat; + +public class DocumentReference30_40Test { + @Test + void nullDocStatusTest() { + org.hl7.fhir.r4.model.DocumentReference src = new org.hl7.fhir.r4.model.DocumentReference(); + src.setDocStatus(null); + src.getDocStatusElement().addExtension("http://example.org/dummy-extension", new org.hl7.fhir.r4.model.BooleanType(true)); + org.hl7.fhir.dstu3.model.DocumentReference tgt = (org.hl7.fhir.dstu3.model.DocumentReference) VersionConvertorFactory_30_40.convertResource(src); + assertThat(tgt.getDocStatus()).isNull(); + assertThat(tgt.getDocStatusElement().getExtensionString("http://example.org/dummy-extension")).isEqualTo("true"); + } +} diff --git a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/model/DocumentReference.java b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/model/DocumentReference.java index a204a8c77f..ede701dadc 100644 --- a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/model/DocumentReference.java +++ b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/model/DocumentReference.java @@ -174,7 +174,6 @@ public String getDisplay() { public static class ReferredDocumentStatusEnumFactory implements EnumFactory { public ReferredDocumentStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) return null; if ("preliminary".equals(codeString)) return ReferredDocumentStatus.PRELIMINARY;