From bf07cecfab674eabb5dfb28a89dba50ea2e16603 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Sun, 15 Sep 2019 09:58:43 +1000 Subject: [PATCH] improve handling of extensions on coded values in version conversions --- .../convertors/VersionConvertor_10_30.java | 16 ++-- .../convertors/VersionConvertor_10_40.java | 10 +-- .../convertors/VersionConvertor_10_50.java | 10 +-- .../convertors/VersionConvertor_14_30.java | 8 +- .../convertors/VersionConvertor_14_40.java | 10 +-- .../convertors/VersionConvertor_14_50.java | 10 +-- .../convertors/VersionConvertor_30_40.java | 46 +++++----- .../convertors/VersionConvertor_30_50.java | 46 +++++----- .../convertors/VersionConvertor_40_50.java | 16 ++-- .../conv40_50/AllergyIntolerance.java | 4 +- .../conv40_50/CapabilityStatement.java | 4 +- .../fhir/convertors/conv40_50/CodeSystem.java | 4 +- .../conv40_50/CoverageEligibilityRequest.java | 4 +- .../CoverageEligibilityResponse.java | 4 +- .../conv40_50/HealthcareService.java | 4 +- .../conv40_50/ImplementationGuide.java | 8 +- .../fhir/convertors/conv40_50/Location.java | 4 +- .../conv40_50/ObservationDefinition.java | 4 +- .../conv40_50/PractitionerRole.java | 4 +- .../convertors/conv40_50/SearchParameter.java | 88 ++++++++----------- .../convertors/conv40_50/StructureMap.java | 4 +- 21 files changed, 149 insertions(+), 159 deletions(-) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_10_30.java index afc2c03cc..e6cbc82f0 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_10_30.java @@ -937,7 +937,7 @@ public class VersionConvertor_10_30 { copyElement(src, tgt); tgt.setPath(src.getPath()); for (org.hl7.fhir.dstu2.model.Enumeration t : src.getRepresentation()) - tgt.addRepresentation(convertPropertyRepresentation(t.getValue())); + copyElement(t, tgt.addRepresentationElement().setValue(convertPropertyRepresentation(t.getValue()))); if (src.hasName()) { if (slicePaths.contains(src.getPath())) tgt.setSliceName(src.getName()); @@ -1009,7 +1009,7 @@ public class VersionConvertor_10_30 { copyElement(src, tgt); tgt.setPath(src.getPath()); for (org.hl7.fhir.dstu3.model.Enumeration t : src.getRepresentation()) - tgt.addRepresentation(convertPropertyRepresentation(t.getValue())); + copyElement(t, tgt.addRepresentationElement().setValue(convertPropertyRepresentation(t.getValue()))); if (src.hasSliceName()) tgt.setName(src.getSliceName()); else @@ -1156,7 +1156,7 @@ public class VersionConvertor_10_30 { else tgt.setProfile(t.getValue()); for (org.hl7.fhir.dstu2.model.Enumeration t : src.getAggregation()) - tgt.addAggregation(convertAggregationMode(t.getValue())); + copyElement(t, tgt.addAggregationElement().setValue(convertAggregationMode(t.getValue()))); return tgt; } @@ -1172,7 +1172,7 @@ public class VersionConvertor_10_30 { } else if (src.hasProfile()) tgt.addProfile(src.getProfile()); for (org.hl7.fhir.dstu3.model.Enumeration t : src.getAggregation()) - tgt.addAggregation(convertAggregationMode(t.getValue())); + copyElement(t, tgt.addAggregationElement().setValue(convertAggregationMode(t.getValue()))); return tgt; } @@ -3574,7 +3574,7 @@ public class VersionConvertor_10_30 { org.hl7.fhir.dstu3.model.Composition.CompositionAttesterComponent tgt = new org.hl7.fhir.dstu3.model.Composition.CompositionAttesterComponent(); copyElement(src, tgt); for (org.hl7.fhir.dstu2.model.Enumeration t : src.getMode()) - tgt.addMode(convertCompositionAttestationMode(t.getValue())); + copyElement(t, tgt.addModeElement().setValue(convertCompositionAttestationMode(t.getValue()))); tgt.setTime(src.getTime()); tgt.setParty(convertReference(src.getParty())); return tgt; @@ -3586,7 +3586,7 @@ public class VersionConvertor_10_30 { org.hl7.fhir.dstu2.model.Composition.CompositionAttesterComponent tgt = new org.hl7.fhir.dstu2.model.Composition.CompositionAttesterComponent(); copyElement(src, tgt); for (org.hl7.fhir.dstu3.model.Enumeration t : src.getMode()) - tgt.addMode(convertCompositionAttestationMode(t.getValue())); + copyElement(t, tgt.addModeElement().setValue(convertCompositionAttestationMode(t.getValue()))); tgt.setTime(src.getTime()); tgt.setParty(convertReference(src.getParty())); return tgt; @@ -6973,7 +6973,7 @@ public class VersionConvertor_10_30 { org.hl7.fhir.dstu3.model.HealthcareService.HealthcareServiceAvailableTimeComponent tgt = new org.hl7.fhir.dstu3.model.HealthcareService.HealthcareServiceAvailableTimeComponent(); copyElement(src, tgt); for (org.hl7.fhir.dstu2.model.Enumeration t : src.getDaysOfWeek()) - tgt.addDaysOfWeek(convertDaysOfWeek(t.getValue())); + copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); tgt.setAllDay(src.getAllDay()); tgt.setAvailableStartTime(src.getAvailableStartTime()); tgt.setAvailableEndTime(src.getAvailableEndTime()); @@ -6986,7 +6986,7 @@ public class VersionConvertor_10_30 { org.hl7.fhir.dstu2.model.HealthcareService.HealthcareServiceAvailableTimeComponent tgt = new org.hl7.fhir.dstu2.model.HealthcareService.HealthcareServiceAvailableTimeComponent(); copyElement(src, tgt); for (org.hl7.fhir.dstu3.model.Enumeration t : src.getDaysOfWeek()) - tgt.addDaysOfWeek(convertDaysOfWeek(t.getValue())); + copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); tgt.setAllDay(src.getAllDay()); tgt.setAvailableStartTime(src.getAvailableStartTime()); tgt.setAvailableEndTime(src.getAvailableEndTime()); diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_10_40.java index 3386934dd..1f2e88d2d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_10_40.java @@ -1005,7 +1005,7 @@ public class VersionConvertor_10_40 { copyElement(src, tgt); tgt.setPath(src.getPath()); for (org.hl7.fhir.dstu2.model.Enumeration t : src.getRepresentation()) - tgt.addRepresentation(convertPropertyRepresentation(t.getValue())); + copyElement(t, tgt.addRepresentationElement().setValue(convertPropertyRepresentation(t.getValue()))); if (src.hasName()) { if (slicePaths.contains(src.getPath())) tgt.setSliceName(src.getName()); @@ -1085,7 +1085,7 @@ public class VersionConvertor_10_40 { copyElement(src, tgt); tgt.setPath(src.getPath()); for (org.hl7.fhir.r4.model.Enumeration t : src.getRepresentation()) - tgt.addRepresentation(convertPropertyRepresentation(t.getValue())); + copyElement(t, tgt.addRepresentationElement().setValue(convertPropertyRepresentation(t.getValue()))); if (src.hasSliceName()) tgt.setName(src.getSliceName()); else @@ -1268,7 +1268,7 @@ public class VersionConvertor_10_40 { for (org.hl7.fhir.dstu2.model.Enumeration t : src.getAggregation()) { org.hl7.fhir.r4.model.ElementDefinition.AggregationMode a = convertAggregationMode(t.getValue()); if (!tgt.hasAggregation(a)) - tgt.addAggregation(a); + copyElement(t, tgt.addAggregationElement().setValue(a)); } } @@ -6996,7 +6996,7 @@ public class VersionConvertor_10_40 { org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceAvailableTimeComponent tgt = new org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceAvailableTimeComponent(); copyElement(src, tgt); for (org.hl7.fhir.dstu2.model.Enumeration t : src.getDaysOfWeek()) - tgt.addDaysOfWeek(convertDaysOfWeek(t.getValue())); + copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); tgt.setAllDay(src.getAllDay()); tgt.setAvailableStartTime(src.getAvailableStartTime()); tgt.setAvailableEndTime(src.getAvailableEndTime()); @@ -7009,7 +7009,7 @@ public class VersionConvertor_10_40 { org.hl7.fhir.dstu2.model.HealthcareService.HealthcareServiceAvailableTimeComponent tgt = new org.hl7.fhir.dstu2.model.HealthcareService.HealthcareServiceAvailableTimeComponent(); copyElement(src, tgt); for (org.hl7.fhir.r4.model.Enumeration t : src.getDaysOfWeek()) - tgt.addDaysOfWeek(convertDaysOfWeek(t.getValue())); + copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); tgt.setAllDay(src.getAllDay()); tgt.setAvailableStartTime(src.getAvailableStartTime()); tgt.setAvailableEndTime(src.getAvailableEndTime()); diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_10_50.java index 034fe1867..561c23a50 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_10_50.java @@ -1005,7 +1005,7 @@ public class VersionConvertor_10_50 { copyElement(src, tgt); tgt.setPath(src.getPath()); for (org.hl7.fhir.dstu2.model.Enumeration t : src.getRepresentation()) - tgt.addRepresentation(convertPropertyRepresentation(t.getValue())); + copyElement(t, tgt.addRepresentationElement().setValue(convertPropertyRepresentation(t.getValue()))); if (src.hasName()) { if (slicePaths.contains(src.getPath())) tgt.setSliceName(src.getName()); @@ -1085,7 +1085,7 @@ public class VersionConvertor_10_50 { copyElement(src, tgt); tgt.setPath(src.getPath()); for (org.hl7.fhir.r5.model.Enumeration t : src.getRepresentation()) - tgt.addRepresentation(convertPropertyRepresentation(t.getValue())); + copyElement(t, tgt.addRepresentationElement().setValue(convertPropertyRepresentation(t.getValue()))); if (src.hasSliceName()) tgt.setName(src.getSliceName()); else @@ -1268,7 +1268,7 @@ public class VersionConvertor_10_50 { for (org.hl7.fhir.dstu2.model.Enumeration t : src.getAggregation()) { org.hl7.fhir.r5.model.ElementDefinition.AggregationMode a = convertAggregationMode(t.getValue()); if (!tgt.hasAggregation(a)) - tgt.addAggregation(a); + copyElement(t, tgt.addAggregation(a)); } } @@ -6996,7 +6996,7 @@ public class VersionConvertor_10_50 { org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceAvailableTimeComponent tgt = new org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceAvailableTimeComponent(); copyElement(src, tgt); for (org.hl7.fhir.dstu2.model.Enumeration t : src.getDaysOfWeek()) - tgt.addDaysOfWeek(convertDaysOfWeek(t.getValue())); + copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); tgt.setAllDay(src.getAllDay()); tgt.setAvailableStartTime(src.getAvailableStartTime()); tgt.setAvailableEndTime(src.getAvailableEndTime()); @@ -7009,7 +7009,7 @@ public class VersionConvertor_10_50 { org.hl7.fhir.dstu2.model.HealthcareService.HealthcareServiceAvailableTimeComponent tgt = new org.hl7.fhir.dstu2.model.HealthcareService.HealthcareServiceAvailableTimeComponent(); copyElement(src, tgt); for (org.hl7.fhir.r5.model.Enumeration t : src.getDaysOfWeek()) - tgt.addDaysOfWeek(convertDaysOfWeek(t.getValue())); + copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); tgt.setAllDay(src.getAllDay()); tgt.setAvailableStartTime(src.getAvailableStartTime()); tgt.setAvailableEndTime(src.getAvailableEndTime()); diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_14_30.java index 0ea22b29d..dcdcf4933 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_14_30.java @@ -1199,7 +1199,7 @@ public class VersionConvertor_14_30 { copyElement(src, tgt); tgt.setPath(src.getPath()); for (org.hl7.fhir.dstu2016may.model.Enumeration t : src.getRepresentation()) - tgt.addRepresentation(convertPropertyRepresentation(t.getValue())); + copyElement(t, tgt.addRepresentationElement().setValue(convertPropertyRepresentation(t.getValue()))); if (src.hasName()) tgt.setSliceName(src.getName()); if (src.hasLabel()) @@ -1260,7 +1260,7 @@ public class VersionConvertor_14_30 { copyElement(src, tgt); tgt.setPath(src.getPath()); for (org.hl7.fhir.dstu3.model.Enumeration t : src.getRepresentation()) - tgt.addRepresentation(convertPropertyRepresentation(t.getValue())); + copyElement(t, tgt.addRepresentationElement().setValue(convertPropertyRepresentation(t.getValue()))); if (src.hasSliceName()) tgt.setName(src.getSliceName()); if (src.hasLabel()) @@ -1432,7 +1432,7 @@ public class VersionConvertor_14_30 { tgt.setProfile(t.getValue().toString()); } for (org.hl7.fhir.dstu2016may.model.Enumeration t : src.getAggregation()) - tgt.addAggregation(convertAggregationMode(t.getValue())); + copyElement(t, tgt.addAggregationElement().setValue(convertAggregationMode(t.getValue()))); tgt.setVersioning(convertReferenceVersionRules(src.getVersioning())); return tgt; } @@ -1460,7 +1460,7 @@ public class VersionConvertor_14_30 { } else tgt.addProfile(src.getProfile()); for (org.hl7.fhir.dstu3.model.Enumeration t : src.getAggregation()) - tgt.addAggregation(convertAggregationMode(t.getValue())); + copyElement(t, tgt.addAggregationElement().setValue(convertAggregationMode(t.getValue()))); tgt.setVersioning(convertReferenceVersionRules(src.getVersioning())); return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_14_40.java index 4621e3b01..809480331 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_14_40.java @@ -1244,7 +1244,7 @@ public class VersionConvertor_14_40 { copyElement(src, tgt); tgt.setPath(src.getPath()); for (org.hl7.fhir.dstu2016may.model.Enumeration t : src.getRepresentation()) - tgt.addRepresentation(convertPropertyRepresentation(t.getValue())); + copyElement(t, tgt.addRepresentationElement().setValue(convertPropertyRepresentation(t.getValue()))); if (src.hasName()) tgt.setSliceName(src.getName()); if (src.hasLabel()) @@ -1311,7 +1311,7 @@ public class VersionConvertor_14_40 { copyElement(src, tgt); tgt.setPath(src.getPath()); for (org.hl7.fhir.r4.model.Enumeration t : src.getRepresentation()) - tgt.addRepresentation(convertPropertyRepresentation(t.getValue())); + copyElement(t, tgt.addRepresentationElement().setValue(convertPropertyRepresentation(t.getValue()))); if (src.hasSliceName()) tgt.setName(src.getSliceName()); if (src.hasLabel()) @@ -1522,7 +1522,7 @@ public class VersionConvertor_14_40 { for (org.hl7.fhir.dstu2016may.model.Enumeration t : src.getAggregation()) { org.hl7.fhir.r4.model.ElementDefinition.AggregationMode a = convertAggregationMode(t.getValue()); if (!tgt.hasAggregation(a)) - tgt.addAggregation(a); + copyElement(t, tgt.addAggregation(a)); } if (src.hasVersioning()) tgt.setVersioning(convertReferenceVersionRules(src.getVersioning())); @@ -1560,7 +1560,7 @@ public class VersionConvertor_14_40 { for (org.hl7.fhir.r4.model.Enumeration t : src.getAggregation()) { org.hl7.fhir.dstu2016may.model.ElementDefinition.AggregationMode a = convertAggregationMode(t.getValue()); if (!tgt.hasAggregation(a)) - tgt.addAggregation(a); + copyElement(t, tgt.addAggregation(a)); } if (src.hasVersioning()) tgt.setVersioning(convertReferenceVersionRules(src.getVersioning())); @@ -6212,7 +6212,7 @@ public class VersionConvertor_14_40 { if (src.hasVariable()) tgt.setVariable(src.getVariable()); for (org.hl7.fhir.dstu2016may.model.Enumeration t : src.getListMode()) - tgt.addListMode(convertStructureMapTargetListMode(t.getValue())); + copyElement(t, tgt.addListModeElement().setValue(convertStructureMapTargetListMode(t.getValue()))); if (src.hasListRuleId()) tgt.setListRuleId(src.getListRuleId()); if (src.hasTransform()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_14_50.java index 50052c221..c006e94ba 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_14_50.java @@ -1244,7 +1244,7 @@ public class VersionConvertor_14_50 { copyElement(src, tgt); tgt.setPath(src.getPath()); for (org.hl7.fhir.dstu2016may.model.Enumeration t : src.getRepresentation()) - tgt.addRepresentation(convertPropertyRepresentation(t.getValue())); + copyElement(t, tgt.addRepresentationElement().setValue(convertPropertyRepresentation(t.getValue()))); if (src.hasName()) tgt.setSliceName(src.getName()); if (src.hasLabel()) @@ -1311,7 +1311,7 @@ public class VersionConvertor_14_50 { copyElement(src, tgt); tgt.setPath(src.getPath()); for (org.hl7.fhir.r5.model.Enumeration t : src.getRepresentation()) - tgt.addRepresentation(convertPropertyRepresentation(t.getValue())); + copyElement(t, tgt.addRepresentationElement().setValue(convertPropertyRepresentation(t.getValue()))); if (src.hasSliceName()) tgt.setName(src.getSliceName()); if (src.hasLabel()) @@ -1523,7 +1523,7 @@ public class VersionConvertor_14_50 { for (org.hl7.fhir.dstu2016may.model.Enumeration t : src.getAggregation()) { org.hl7.fhir.r5.model.ElementDefinition.AggregationMode a = convertAggregationMode(t.getValue()); if (!tgt.hasAggregation(a)) - tgt.addAggregation(a); + copyElement(t, tgt.addAggregation(a)); } if (src.hasVersioning()) tgt.setVersioning(convertReferenceVersionRules(src.getVersioning())); @@ -1558,7 +1558,7 @@ public class VersionConvertor_14_50 { for (org.hl7.fhir.r5.model.Enumeration t : src.getAggregation()) { org.hl7.fhir.dstu2016may.model.ElementDefinition.AggregationMode a = convertAggregationMode(t.getValue()); if (!tgt.hasAggregation(a)) - tgt.addAggregation(a); + copyElement(t, tgt.addAggregationElement().setValue(a)); } if (src.hasVersioning()) tgt.setVersioning(convertReferenceVersionRules(src.getVersioning())); @@ -6210,7 +6210,7 @@ public class VersionConvertor_14_50 { if (src.hasVariable()) tgt.setVariable(src.getVariable()); for (org.hl7.fhir.dstu2016may.model.Enumeration t : src.getListMode()) - tgt.addListMode(convertStructureMapTargetListMode(t.getValue())); + copyElement(t, tgt.addListModeElement().setValue(convertStructureMapTargetListMode(t.getValue()))); if (src.hasListRuleId()) tgt.setListRuleId(src.getListRuleId()); if (src.hasTransform()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_30_40.java index 26d024d34..b2a22eae4 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_30_40.java @@ -1455,7 +1455,7 @@ public class VersionConvertor_30_40 { if (src.hasPath()) tgt.setPath(src.getPath()); for (org.hl7.fhir.dstu3.model.Enumeration t : src.getRepresentation()) - tgt.addRepresentation(convertPropertyRepresentation(t.getValue())); + copyElement(t, tgt.addRepresentationElement().setValue(convertPropertyRepresentation(t.getValue()))); if (src.hasSliceName()) tgt.setSliceName(src.getSliceName()); if (src.hasLabel()) @@ -1533,7 +1533,7 @@ public class VersionConvertor_30_40 { if (src.hasPath()) tgt.setPath(src.getPath()); for (org.hl7.fhir.r4.model.Enumeration t : src.getRepresentation()) - tgt.addRepresentation(convertPropertyRepresentation(t.getValue())); + copyElement(t, tgt.addRepresentationElement().setValue(convertPropertyRepresentation(t.getValue()))); if (src.hasSliceName()) tgt.setSliceName(src.getSliceName()); if (src.hasLabel()) @@ -1777,7 +1777,7 @@ public class VersionConvertor_30_40 { for (org.hl7.fhir.dstu3.model.Enumeration t : src.getAggregation()) { org.hl7.fhir.r4.model.ElementDefinition.AggregationMode a = convertAggregationMode(t.getValue()); if (!tgt.hasAggregation(a)) - tgt.addAggregation(a); + copyElement(t, tgt.addAggregation(a)); } if (src.hasVersioning()) tgt.setVersioning(convertReferenceVersionRules(src.getVersioning())); @@ -2347,11 +2347,11 @@ public class VersionConvertor_30_40 { if (src.hasPeriodUnit()) tgt.setPeriodUnit(convertUnitsOfTime(src.getPeriodUnit())); for (org.hl7.fhir.dstu3.model.Enumeration t : src.getDayOfWeek()) - tgt.addDayOfWeek(convertDayOfWeek(t.getValue())); + copyElement(t, tgt.addDayOfWeekElement().setValue(convertDayOfWeek(t.getValue()))); for (org.hl7.fhir.dstu3.model.TimeType t : src.getTimeOfDay()) tgt.addTimeOfDay(t.getValue()); for (org.hl7.fhir.dstu3.model.Enumeration t : src.getWhen()) - tgt.addWhen(convertEventTiming(t.getValue())); + copyElement(t, tgt.addWhenElement().setValue(convertEventTiming(t.getValue()))); if (src.hasOffset()) tgt.setOffset(src.getOffset()); return tgt; @@ -2385,11 +2385,11 @@ public class VersionConvertor_30_40 { if (src.hasPeriodUnit()) tgt.setPeriodUnit(convertUnitsOfTime(src.getPeriodUnit())); for (org.hl7.fhir.r4.model.Enumeration t : src.getDayOfWeek()) - tgt.addDayOfWeek(convertDayOfWeek(t.getValue())); + copyElement(t, tgt.addDayOfWeekElement().setValue(convertDayOfWeek(t.getValue()))); for (org.hl7.fhir.r4.model.TimeType t : src.getTimeOfDay()) tgt.addTimeOfDay(t.getValue()); for (org.hl7.fhir.r4.model.Enumeration t : src.getWhen()) - tgt.addWhen(convertEventTiming(t.getValue())); + copyElement(t, tgt.addWhenElement().setValue(convertEventTiming(t.getValue()))); if (src.hasOffset()) tgt.setOffset(src.getOffset()); return tgt; @@ -3394,7 +3394,7 @@ public class VersionConvertor_30_40 { if (src.hasType()) tgt.setType(convertAllergyIntoleranceType(src.getType())); for (org.hl7.fhir.dstu3.model.Enumeration t : src.getCategory()) - tgt.addCategory(convertAllergyIntoleranceCategory(t.getValue())); + copyElement(t, tgt.addCategoryElement().setValue(convertAllergyIntoleranceCategory(t.getValue()))); if (src.hasCriticality()) tgt.setCriticality(convertAllergyIntoleranceCriticality(src.getCriticality())); if (src.hasCode()) @@ -3432,7 +3432,7 @@ public class VersionConvertor_30_40 { if (src.hasType()) tgt.setType(convertAllergyIntoleranceType(src.getType())); for (org.hl7.fhir.r4.model.Enumeration t : src.getCategory()) - tgt.addCategory(convertAllergyIntoleranceCategory(t.getValue())); + copyElement(t, tgt.addCategoryElement().setValue(convertAllergyIntoleranceCategory(t.getValue()))); if (src.hasCriticality()) tgt.setCriticality(convertAllergyIntoleranceCriticality(src.getCriticality())); if (src.hasCode()) @@ -4986,7 +4986,7 @@ public class VersionConvertor_30_40 { if (src.hasConditionalDelete()) tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete())); for (org.hl7.fhir.dstu3.model.Enumeration t : src.getReferencePolicy()) - tgt.addReferencePolicy(convertReferenceHandlingPolicy(t.getValue())); + copyElement(t, tgt.addReferencePolicyElement().setValue(convertReferenceHandlingPolicy(t.getValue()))); for (org.hl7.fhir.dstu3.model.StringType t : src.getSearchInclude()) tgt.addSearchInclude(t.getValue()); for (org.hl7.fhir.dstu3.model.StringType t : src.getSearchRevInclude()) @@ -5036,7 +5036,7 @@ public class VersionConvertor_30_40 { if (src.hasConditionalDelete()) tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete())); for (org.hl7.fhir.r4.model.Enumeration t : src.getReferencePolicy()) - tgt.addReferencePolicy(convertReferenceHandlingPolicy(t.getValue())); + copyElement(t, tgt.addReferencePolicyElement().setValue(convertReferenceHandlingPolicy(t.getValue()))); for (org.hl7.fhir.r4.model.StringType t : src.getSearchInclude()) tgt.addSearchInclude(t.getValue()); for (org.hl7.fhir.r4.model.StringType t : src.getSearchRevInclude()) @@ -7050,7 +7050,7 @@ public class VersionConvertor_30_40 { if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.dstu3.model.Enumeration t : src.getOperator()) - tgt.addOperator(convertFilterOperator(t.getValue())); + copyElement(t, tgt.addOperatorElement().setValue(convertFilterOperator(t.getValue()))); if (src.hasValue()) tgt.setValue(src.getValue()); return tgt; @@ -7066,7 +7066,7 @@ public class VersionConvertor_30_40 { if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.r4.model.Enumeration t : src.getOperator()) - tgt.addOperator(convertFilterOperator(t.getValue())); + copyElement(t, tgt.addOperatorElement().setValue(convertFilterOperator(t.getValue()))); if (src.hasValue()) tgt.setValue(src.getValue()); return tgt; @@ -12338,7 +12338,7 @@ public class VersionConvertor_30_40 { org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceAvailableTimeComponent tgt = new org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceAvailableTimeComponent(); copyElement(src, tgt); for (org.hl7.fhir.dstu3.model.Enumeration t : src.getDaysOfWeek()) - tgt.addDaysOfWeek(convertDaysOfWeek(t.getValue())); + copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); if (src.hasAllDay()) tgt.setAllDay(src.getAllDay()); if (src.hasAvailableStartTime()) @@ -12354,7 +12354,7 @@ public class VersionConvertor_30_40 { org.hl7.fhir.dstu3.model.HealthcareService.HealthcareServiceAvailableTimeComponent tgt = new org.hl7.fhir.dstu3.model.HealthcareService.HealthcareServiceAvailableTimeComponent(); copyElement(src, tgt); for (org.hl7.fhir.r4.model.Enumeration t : src.getDaysOfWeek()) - tgt.addDaysOfWeek(convertDaysOfWeek(t.getValue())); + copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); if (src.hasAllDay()) tgt.setAllDay(src.getAllDay()); if (src.hasAvailableStartTime()) @@ -16661,7 +16661,7 @@ public class VersionConvertor_30_40 { org.hl7.fhir.r4.model.PractitionerRole.PractitionerRoleAvailableTimeComponent tgt = new org.hl7.fhir.r4.model.PractitionerRole.PractitionerRoleAvailableTimeComponent(); copyElement(src, tgt); for (org.hl7.fhir.dstu3.model.Enumeration t : src.getDaysOfWeek()) - tgt.addDaysOfWeek(convertDaysOfWeek(t.getValue())); + copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); if (src.hasAllDay()) tgt.setAllDay(src.getAllDay()); if (src.hasAvailableStartTime()) @@ -16677,7 +16677,7 @@ public class VersionConvertor_30_40 { org.hl7.fhir.dstu3.model.PractitionerRole.PractitionerRoleAvailableTimeComponent tgt = new org.hl7.fhir.dstu3.model.PractitionerRole.PractitionerRoleAvailableTimeComponent(); copyElement(src, tgt); for (org.hl7.fhir.r4.model.Enumeration t : src.getDaysOfWeek()) - tgt.addDaysOfWeek(convertDaysOfWeek(t.getValue())); + copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); if (src.hasAllDay()) tgt.setAllDay(src.getAllDay()); if (src.hasAvailableStartTime()) @@ -18276,9 +18276,9 @@ public class VersionConvertor_30_40 { for (org.hl7.fhir.dstu3.model.CodeType t : src.getTarget()) tgt.addTarget(t.getValue()); for (org.hl7.fhir.dstu3.model.Enumeration t : src.getComparator()) - tgt.addComparator(convertSearchComparator(t.getValue())); + copyElement(t, tgt.addComparatorElement().setValue(convertSearchComparator(t.getValue()))); for (org.hl7.fhir.dstu3.model.Enumeration t : src.getModifier()) - tgt.addModifier(convertSearchModifierCode(t.getValue())); + copyElement(t, tgt.addModifierElement().setValue(convertSearchModifierCode(t.getValue()))); for (org.hl7.fhir.dstu3.model.StringType t : src.getChain()) tgt.addChain(t.getValue()); for (org.hl7.fhir.dstu3.model.SearchParameter.SearchParameterComponentComponent t : src.getComponent()) @@ -18332,9 +18332,9 @@ public class VersionConvertor_30_40 { for (org.hl7.fhir.r4.model.CodeType t : src.getTarget()) tgt.addTarget(t.getValue()); for (org.hl7.fhir.r4.model.Enumeration t : src.getComparator()) - tgt.addComparator(convertSearchComparator(t.getValue())); + copyElement(t, tgt.addComparatorElement().setValue(convertSearchComparator(t.getValue()))); for (org.hl7.fhir.r4.model.Enumeration t : src.getModifier()) - tgt.addModifier(convertSearchModifierCode(t.getValue())); + copyElement(t, tgt.addModifierElement().setValue(convertSearchModifierCode(t.getValue()))); for (org.hl7.fhir.r4.model.StringType t : src.getChain()) tgt.addChain(t.getValue()); for (org.hl7.fhir.r4.model.SearchParameter.SearchParameterComponentComponent t : src.getComponent()) @@ -19760,7 +19760,7 @@ public class VersionConvertor_30_40 { if (src.hasVariable()) tgt.setVariable(src.getVariable()); for (org.hl7.fhir.dstu3.model.Enumeration t : src.getListMode()) - tgt.addListMode(convertStructureMapTargetListMode(t.getValue())); + copyElement(t, tgt.addListModeElement().setValue(convertStructureMapTargetListMode(t.getValue()))); if (src.hasListRuleId()) tgt.setListRuleId(src.getListRuleId()); if (src.hasTransform()) @@ -19784,7 +19784,7 @@ public class VersionConvertor_30_40 { if (src.hasVariable()) tgt.setVariable(src.getVariable()); for (org.hl7.fhir.r4.model.Enumeration t : src.getListMode()) - tgt.addListMode(convertStructureMapTargetListMode(t.getValue())); + copyElement(t, tgt.addListModeElement().setValue(convertStructureMapTargetListMode(t.getValue()))); if (src.hasListRuleId()) tgt.setListRuleId(src.getListRuleId()); if (src.hasTransform()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_30_50.java index 175d2303a..f48a5cfd7 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_30_50.java @@ -1424,7 +1424,7 @@ public class VersionConvertor_30_50 { if (src.hasPath()) tgt.setPath(src.getPath()); for (org.hl7.fhir.dstu3.model.Enumeration t : src.getRepresentation()) - tgt.addRepresentation(convertPropertyRepresentation(t.getValue())); + copyElement(t, tgt.addRepresentationElement().setValue(convertPropertyRepresentation(t.getValue()))); if (src.hasSliceName()) tgt.setSliceName(src.getSliceName()); if (src.hasLabel()) @@ -1502,7 +1502,7 @@ public class VersionConvertor_30_50 { if (src.hasPath()) tgt.setPath(src.getPath()); for (org.hl7.fhir.r5.model.Enumeration t : src.getRepresentation()) - tgt.addRepresentation(convertPropertyRepresentation(t.getValue())); + copyElement(t, tgt.addRepresentationElement().setValue(convertPropertyRepresentation(t.getValue()))); if (src.hasSliceName()) tgt.setSliceName(src.getSliceName()); if (src.hasLabel()) @@ -1753,7 +1753,7 @@ public class VersionConvertor_30_50 { for (org.hl7.fhir.dstu3.model.Enumeration t : src.getAggregation()) { org.hl7.fhir.r5.model.ElementDefinition.AggregationMode a = convertAggregationMode(t.getValue()); if (!tgt.hasAggregation(a)) - tgt.addAggregation(a); + copyElement(t, tgt.addAggregation(a)); } if (src.hasVersioning()) tgt.setVersioning(convertReferenceVersionRules(src.getVersioning())); @@ -2323,11 +2323,11 @@ public class VersionConvertor_30_50 { if (src.hasPeriodUnit()) tgt.setPeriodUnit(convertUnitsOfTime(src.getPeriodUnit())); for (org.hl7.fhir.dstu3.model.Enumeration t : src.getDayOfWeek()) - tgt.addDayOfWeek(convertDayOfWeek(t.getValue())); + copyElement(t, tgt.addDayOfWeekElement().setValue(convertDayOfWeek(t.getValue()))); for (org.hl7.fhir.dstu3.model.TimeType t : src.getTimeOfDay()) tgt.addTimeOfDay(t.getValue()); for (org.hl7.fhir.dstu3.model.Enumeration t : src.getWhen()) - tgt.addWhen(convertEventTiming(t.getValue())); + copyElement(t, tgt.addWhenElement().setValue(convertEventTiming(t.getValue()))); if (src.hasOffset()) tgt.setOffset(src.getOffset()); return tgt; @@ -2361,11 +2361,11 @@ public class VersionConvertor_30_50 { if (src.hasPeriodUnit()) tgt.setPeriodUnit(convertUnitsOfTime(src.getPeriodUnit())); for (org.hl7.fhir.r5.model.Enumeration t : src.getDayOfWeek()) - tgt.addDayOfWeek(convertDayOfWeek(t.getValue())); + copyElement(t, tgt.addDayOfWeekElement().setValue(convertDayOfWeek(t.getValue()))); for (org.hl7.fhir.r5.model.TimeType t : src.getTimeOfDay()) tgt.addTimeOfDay(t.getValue()); for (org.hl7.fhir.r5.model.Enumeration t : src.getWhen()) - tgt.addWhen(convertEventTiming(t.getValue())); + copyElement(t, tgt.addWhenElement().setValue(convertEventTiming(t.getValue()))); if (src.hasOffset()) tgt.setOffset(src.getOffset()); return tgt; @@ -3394,7 +3394,7 @@ public class VersionConvertor_30_50 { if (src.hasType()) tgt.setType(convertAllergyIntoleranceType(src.getType())); for (org.hl7.fhir.dstu3.model.Enumeration t : src.getCategory()) - tgt.addCategory(convertAllergyIntoleranceCategory(t.getValue())); + copyElement(t, tgt.addCategoryElement().setValue(convertAllergyIntoleranceCategory(t.getValue()))); if (src.hasCriticality()) tgt.setCriticality(convertAllergyIntoleranceCriticality(src.getCriticality())); if (src.hasCode()) @@ -3432,7 +3432,7 @@ public class VersionConvertor_30_50 { if (src.hasType()) tgt.setType(convertAllergyIntoleranceType(src.getType())); for (org.hl7.fhir.r5.model.Enumeration t : src.getCategory()) - tgt.addCategory(convertAllergyIntoleranceCategory(t.getValue())); + copyElement(t, tgt.addCategoryElement().setValue(convertAllergyIntoleranceCategory(t.getValue()))); if (src.hasCriticality()) tgt.setCriticality(convertAllergyIntoleranceCriticality(src.getCriticality())); if (src.hasCode()) @@ -4986,7 +4986,7 @@ public class VersionConvertor_30_50 { if (src.hasConditionalDelete()) tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete())); for (org.hl7.fhir.dstu3.model.Enumeration t : src.getReferencePolicy()) - tgt.addReferencePolicy(convertReferenceHandlingPolicy(t.getValue())); + copyElement(t, tgt.addReferencePolicyElement().setValue(convertReferenceHandlingPolicy(t.getValue()))); for (org.hl7.fhir.dstu3.model.StringType t : src.getSearchInclude()) tgt.addSearchInclude(t.getValue()); for (org.hl7.fhir.dstu3.model.StringType t : src.getSearchRevInclude()) @@ -5036,7 +5036,7 @@ public class VersionConvertor_30_50 { if (src.hasConditionalDelete()) tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete())); for (org.hl7.fhir.r5.model.Enumeration t : src.getReferencePolicy()) - tgt.addReferencePolicy(convertReferenceHandlingPolicy(t.getValue())); + copyElement(t, tgt.addReferencePolicyElement().setValue(convertReferenceHandlingPolicy(t.getValue()))); for (org.hl7.fhir.r5.model.StringType t : src.getSearchInclude()) tgt.addSearchInclude(t.getValue()); for (org.hl7.fhir.r5.model.StringType t : src.getSearchRevInclude()) @@ -7050,7 +7050,7 @@ public class VersionConvertor_30_50 { if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.dstu3.model.Enumeration t : src.getOperator()) - tgt.addOperator(convertFilterOperator(t.getValue())); + copyElement(t, tgt.addOperatorElement().setValue(convertFilterOperator(t.getValue()))); if (src.hasValue()) tgt.setValue(src.getValue()); return tgt; @@ -7066,7 +7066,7 @@ public class VersionConvertor_30_50 { if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (org.hl7.fhir.r5.model.Enumeration t : src.getOperator()) - tgt.addOperator(convertFilterOperator(t.getValue())); + copyElement(t, tgt.addOperatorElement().setValue(convertFilterOperator(t.getValue()))); if (src.hasValue()) tgt.setValue(src.getValue()); return tgt; @@ -12279,7 +12279,7 @@ public class VersionConvertor_30_50 { org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceAvailableTimeComponent tgt = new org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceAvailableTimeComponent(); copyElement(src, tgt); for (org.hl7.fhir.dstu3.model.Enumeration t : src.getDaysOfWeek()) - tgt.addDaysOfWeek(convertDaysOfWeek(t.getValue())); + copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); if (src.hasAllDay()) tgt.setAllDay(src.getAllDay()); if (src.hasAvailableStartTime()) @@ -12295,7 +12295,7 @@ public class VersionConvertor_30_50 { org.hl7.fhir.dstu3.model.HealthcareService.HealthcareServiceAvailableTimeComponent tgt = new org.hl7.fhir.dstu3.model.HealthcareService.HealthcareServiceAvailableTimeComponent(); copyElement(src, tgt); for (org.hl7.fhir.r5.model.Enumeration t : src.getDaysOfWeek()) - tgt.addDaysOfWeek(convertDaysOfWeek(t.getValue())); + copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); if (src.hasAllDay()) tgt.setAllDay(src.getAllDay()); if (src.hasAvailableStartTime()) @@ -16602,7 +16602,7 @@ public class VersionConvertor_30_50 { org.hl7.fhir.r5.model.PractitionerRole.PractitionerRoleAvailableTimeComponent tgt = new org.hl7.fhir.r5.model.PractitionerRole.PractitionerRoleAvailableTimeComponent(); copyElement(src, tgt); for (org.hl7.fhir.dstu3.model.Enumeration t : src.getDaysOfWeek()) - tgt.addDaysOfWeek(convertDaysOfWeek(t.getValue())); + copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); if (src.hasAllDay()) tgt.setAllDay(src.getAllDay()); if (src.hasAvailableStartTime()) @@ -16618,7 +16618,7 @@ public class VersionConvertor_30_50 { org.hl7.fhir.dstu3.model.PractitionerRole.PractitionerRoleAvailableTimeComponent tgt = new org.hl7.fhir.dstu3.model.PractitionerRole.PractitionerRoleAvailableTimeComponent(); copyElement(src, tgt); for (org.hl7.fhir.r5.model.Enumeration t : src.getDaysOfWeek()) - tgt.addDaysOfWeek(convertDaysOfWeek(t.getValue())); + copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); if (src.hasAllDay()) tgt.setAllDay(src.getAllDay()); if (src.hasAvailableStartTime()) @@ -17614,9 +17614,9 @@ public class VersionConvertor_30_50 { for (org.hl7.fhir.dstu3.model.CodeType t : src.getTarget()) tgt.addTarget(t.getValue()); for (org.hl7.fhir.dstu3.model.Enumeration t : src.getComparator()) - tgt.addComparator(convertSearchComparator(t.getValue())); + copyElement(t, tgt.addComparatorElement().setValue(convertSearchComparator(t.getValue()))); for (org.hl7.fhir.dstu3.model.Enumeration t : src.getModifier()) - tgt.addModifier(convertSearchModifierCode(t.getValue())); + copyElement(t, tgt.addModifierElement().setValue(convertSearchModifierCode(t.getValue()))); for (org.hl7.fhir.dstu3.model.StringType t : src.getChain()) tgt.addChain(t.getValue()); for (org.hl7.fhir.dstu3.model.SearchParameter.SearchParameterComponentComponent t : src.getComponent()) @@ -17670,9 +17670,9 @@ public class VersionConvertor_30_50 { for (org.hl7.fhir.r5.model.CodeType t : src.getTarget()) tgt.addTarget(t.getValue()); for (org.hl7.fhir.r5.model.Enumeration t : src.getComparator()) - tgt.addComparator(convertSearchComparator(t.getValue())); + copyElement(t, tgt.addComparatorElement().setValue(convertSearchComparator(t.getValue()))); for (org.hl7.fhir.r5.model.Enumeration t : src.getModifier()) - tgt.addModifier(convertSearchModifierCode(t.getValue())); + copyElement(t, tgt.addModifierElement().setValue(convertSearchModifierCode(t.getValue()))); for (org.hl7.fhir.r5.model.StringType t : src.getChain()) tgt.addChain(t.getValue()); for (org.hl7.fhir.r5.model.SearchParameter.SearchParameterComponentComponent t : src.getComponent()) @@ -19098,7 +19098,7 @@ public class VersionConvertor_30_50 { if (src.hasVariable()) tgt.setVariable(src.getVariable()); for (org.hl7.fhir.dstu3.model.Enumeration t : src.getListMode()) - tgt.addListMode(convertStructureMapTargetListMode(t.getValue())); + copyElement(t, tgt.addListModeElement().setValue(convertStructureMapTargetListMode(t.getValue()))); if (src.hasListRuleId()) tgt.setListRuleId(src.getListRuleId()); if (src.hasTransform()) @@ -19122,7 +19122,7 @@ public class VersionConvertor_30_50 { if (src.hasVariable()) tgt.setVariable(src.getVariable()); for (org.hl7.fhir.r5.model.Enumeration t : src.getListMode()) - tgt.addListMode(convertStructureMapTargetListMode(t.getValue())); + copyElement(t, tgt.addListModeElement().setValue(convertStructureMapTargetListMode(t.getValue()))); if (src.hasListRuleId()) tgt.setListRuleId(src.getListRuleId()); if (src.hasTransform()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_40_50.java index b4e74fb1a..31d0eaec6 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_40_50.java @@ -2106,11 +2106,11 @@ public class VersionConvertor_40_50 { if (src.hasPeriodUnit()) tgt.setPeriodUnit(convertUnitsOfTime(src.getPeriodUnit())); for (org.hl7.fhir.r4.model.Enumeration t : src.getDayOfWeek()) - tgt.addDayOfWeek(convertDayOfWeek(t.getValue())); + copyElement(t, tgt.addDayOfWeekElement().setValue(convertDayOfWeek(t.getValue()))); for (org.hl7.fhir.r4.model.TimeType t : src.getTimeOfDay()) tgt.getTimeOfDay().add(convertTime(t)); for (org.hl7.fhir.r4.model.Enumeration t : src.getWhen()) - tgt.addWhen(convertEventTiming(t.getValue())); + copyElement(t, tgt.addWhenElement().setValue(convertEventTiming(t.getValue()))); if (src.hasOffset()) tgt.setOffsetElement(convertUnsignedInt(src.getOffsetElement())); return tgt; @@ -2144,11 +2144,11 @@ public class VersionConvertor_40_50 { if (src.hasPeriodUnit()) tgt.setPeriodUnit(convertUnitsOfTime(src.getPeriodUnit())); for (org.hl7.fhir.r5.model.Enumeration t : src.getDayOfWeek()) - tgt.addDayOfWeek(convertDayOfWeek(t.getValue())); + copyElement(t, tgt.addDayOfWeekElement().setValue(convertDayOfWeek(t.getValue()))); for (org.hl7.fhir.r5.model.TimeType t : src.getTimeOfDay()) tgt.getTimeOfDay().add(convertTime(t)); for (org.hl7.fhir.r5.model.Enumeration t : src.getWhen()) - tgt.addWhen(convertEventTiming(t.getValue())); + copyElement(t, tgt.addWhenElement().setValue(convertEventTiming(t.getValue()))); if (src.hasOffset()) tgt.setOffsetElement(convertUnsignedInt(src.getOffsetElement())); return tgt; @@ -2382,7 +2382,7 @@ public class VersionConvertor_40_50 { if (src.hasPath()) tgt.setPathElement(convertString(src.getPathElement())); for (org.hl7.fhir.r4.model.Enumeration t : src.getRepresentation()) - tgt.addRepresentation(convertPropertyRepresentation(t.getValue())); + copyElement(t, tgt.addRepresentationElement().setValue(convertPropertyRepresentation(t.getValue()))); if (src.hasSliceName()) tgt.setSliceNameElement(convertString(src.getSliceNameElement())); if (src.hasSliceIsConstraining()) @@ -2458,7 +2458,7 @@ public class VersionConvertor_40_50 { if (src.hasPath()) tgt.setPathElement(convertString(src.getPathElement())); for (org.hl7.fhir.r5.model.Enumeration t : src.getRepresentation()) - tgt.addRepresentation(convertPropertyRepresentation(t.getValue())); + copyElement(t, tgt.addRepresentationElement().setValue(convertPropertyRepresentation(t.getValue()))); if (src.hasSliceName()) tgt.setSliceNameElement(convertString(src.getSliceNameElement())); if (src.hasSliceIsConstraining()) @@ -2696,7 +2696,7 @@ public class VersionConvertor_40_50 { for (org.hl7.fhir.r4.model.CanonicalType t : src.getTargetProfile()) tgt.getTargetProfile().add(convertCanonical(t)); for (org.hl7.fhir.r4.model.Enumeration t : src.getAggregation()) - tgt.addAggregation(convertAggregationMode(t.getValue())); + copyElement(t, tgt.addAggregationElement().setValue(convertAggregationMode(t.getValue()))); if (src.hasVersioning()) tgt.setVersioning(convertReferenceVersionRules(src.getVersioning())); return tgt; @@ -2714,7 +2714,7 @@ public class VersionConvertor_40_50 { for (org.hl7.fhir.r5.model.CanonicalType t : src.getTargetProfile()) tgt.getTargetProfile().add(convertCanonical(t)); for (org.hl7.fhir.r5.model.Enumeration t : src.getAggregation()) - tgt.addAggregation(convertAggregationMode(t.getValue())); + copyElement(t, tgt.addAggregationElement().setValue(convertAggregationMode(t.getValue()))); if (src.hasVersioning()) tgt.setVersioning(convertReferenceVersionRules(src.getVersioning())); return tgt; diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/AllergyIntolerance.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/AllergyIntolerance.java index 5bf441383..24642acfb 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/AllergyIntolerance.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/AllergyIntolerance.java @@ -74,7 +74,7 @@ public class AllergyIntolerance extends VersionConvertor_40_50 { if (src.hasType()) tgt.setType(convertAllergyIntoleranceType(src.getType())); for (org.hl7.fhir.r4.model.Enumeration t : src.getCategory()) - tgt.addCategory(convertAllergyIntoleranceCategory(t.getValue())); + copyElement(t, tgt.addCategoryElement().setValue(convertAllergyIntoleranceCategory(t.getValue()))); if (src.hasCriticality()) tgt.setCriticality(convertAllergyIntoleranceCriticality(src.getCriticality())); if (src.hasCode()) @@ -114,7 +114,7 @@ public class AllergyIntolerance extends VersionConvertor_40_50 { if (src.hasType()) tgt.setType(convertAllergyIntoleranceType(src.getType())); for (org.hl7.fhir.r5.model.Enumeration t : src.getCategory()) - tgt.addCategory(convertAllergyIntoleranceCategory(t.getValue())); + copyElement(t, tgt.addCategoryElement().setValue(convertAllergyIntoleranceCategory(t.getValue()))); if (src.hasCriticality()) tgt.setCriticality(convertAllergyIntoleranceCriticality(src.getCriticality())); if (src.hasCode()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CapabilityStatement.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CapabilityStatement.java index f0415dc74..43b960f6a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CapabilityStatement.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CapabilityStatement.java @@ -384,7 +384,7 @@ public class CapabilityStatement extends VersionConvertor_40_50 { if (src.hasConditionalDelete()) tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete())); for (org.hl7.fhir.r4.model.Enumeration t : src.getReferencePolicy()) - tgt.addReferencePolicy(convertReferenceHandlingPolicy(t.getValue())); + copyElement(t, tgt.addReferencePolicyElement().setValue(convertReferenceHandlingPolicy(t.getValue()))); for (org.hl7.fhir.r4.model.StringType t : src.getSearchInclude()) tgt.getSearchInclude().add(convertString(t)); for (org.hl7.fhir.r4.model.StringType t : src.getSearchRevInclude()) @@ -426,7 +426,7 @@ public class CapabilityStatement extends VersionConvertor_40_50 { if (src.hasConditionalDelete()) tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete())); for (org.hl7.fhir.r5.model.Enumeration t : src.getReferencePolicy()) - tgt.addReferencePolicy(convertReferenceHandlingPolicy(t.getValue())); + copyElement(t, tgt.addReferencePolicyElement().setValue(convertReferenceHandlingPolicy(t.getValue()))); for (org.hl7.fhir.r5.model.StringType t : src.getSearchInclude()) tgt.getSearchInclude().add(convertString(t)); for (org.hl7.fhir.r5.model.StringType t : src.getSearchRevInclude()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CodeSystem.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CodeSystem.java index 10f574c76..a8f210655 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CodeSystem.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CodeSystem.java @@ -240,7 +240,7 @@ public class CodeSystem extends VersionConvertor_40_50 { if (src.hasDescription()) tgt.setDescriptionElement(convertString(src.getDescriptionElement())); for (org.hl7.fhir.r4.model.Enumeration t : src.getOperator()) - tgt.addOperator(convertFilterOperator(t.getValue())); + copyElement(t, tgt.addOperatorElement().setValue(convertFilterOperator(t.getValue()))); if (src.hasValue()) tgt.setValueElement(convertString(src.getValueElement())); return tgt; @@ -256,7 +256,7 @@ public class CodeSystem extends VersionConvertor_40_50 { if (src.hasDescription()) tgt.setDescriptionElement(convertString(src.getDescriptionElement())); for (org.hl7.fhir.r5.model.Enumeration t : src.getOperator()) - tgt.addOperator(convertFilterOperator(t.getValue())); + copyElement(t, tgt.addOperatorElement().setValue(convertFilterOperator(t.getValue()))); if (src.hasValue()) tgt.setValueElement(convertString(src.getValueElement())); return tgt; diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CoverageEligibilityRequest.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CoverageEligibilityRequest.java index bb1ffc09e..5699a8782 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CoverageEligibilityRequest.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CoverageEligibilityRequest.java @@ -72,7 +72,7 @@ public class CoverageEligibilityRequest extends VersionConvertor_40_50 { if (src.hasPriority()) tgt.setPriority(convertCodeableConcept(src.getPriority())); for (org.hl7.fhir.r4.model.Enumeration t : src.getPurpose()) - tgt.addPurpose(convertEligibilityRequestPurpose(t.getValue())); + copyElement(t, tgt.addPurposeElement().setValue(convertEligibilityRequestPurpose(t.getValue()))); if (src.hasPatient()) tgt.setPatient(convertReference(src.getPatient())); if (src.hasServiced()) @@ -108,7 +108,7 @@ public class CoverageEligibilityRequest extends VersionConvertor_40_50 { if (src.hasPriority()) tgt.setPriority(convertCodeableConcept(src.getPriority())); for (org.hl7.fhir.r5.model.Enumeration t : src.getPurpose()) - tgt.addPurpose(convertEligibilityRequestPurpose(t.getValue())); + copyElement(t, tgt.addPurposeElement().setValue(convertEligibilityRequestPurpose(t.getValue()))); if (src.hasPatient()) tgt.setPatient(convertReference(src.getPatient())); if (src.hasServiced()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CoverageEligibilityResponse.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CoverageEligibilityResponse.java index 3374edf7a..164ce3f4c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CoverageEligibilityResponse.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/CoverageEligibilityResponse.java @@ -70,7 +70,7 @@ public class CoverageEligibilityResponse extends VersionConvertor_40_50 { if (src.hasStatus()) tgt.setStatus(convertEligibilityResponseStatus(src.getStatus())); for (org.hl7.fhir.r4.model.Enumeration t : src.getPurpose()) - tgt.addPurpose(convertEligibilityResponsePurpose(t.getValue())); + copyElement(t, tgt.addPurposeElement().setValue(convertEligibilityResponsePurpose(t.getValue()))); if (src.hasPatient()) tgt.setPatient(convertReference(src.getPatient())); if (src.hasServiced()) @@ -108,7 +108,7 @@ public class CoverageEligibilityResponse extends VersionConvertor_40_50 { if (src.hasStatus()) tgt.setStatus(convertEligibilityResponseStatus(src.getStatus())); for (org.hl7.fhir.r5.model.Enumeration t : src.getPurpose()) - tgt.addPurpose(convertEligibilityResponsePurpose(t.getValue())); + copyElement(t, tgt.addPurposeElement().setValue(convertEligibilityResponsePurpose(t.getValue()))); if (src.hasPatient()) tgt.setPatient(convertReference(src.getPatient())); if (src.hasServiced()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/HealthcareService.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/HealthcareService.java index 05b90c3f7..d9b553ea3 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/HealthcareService.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/HealthcareService.java @@ -202,7 +202,7 @@ public class HealthcareService extends VersionConvertor_40_50 { org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceAvailableTimeComponent tgt = new org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceAvailableTimeComponent(); copyElement(src, tgt); for (org.hl7.fhir.r4.model.Enumeration t : src.getDaysOfWeek()) - tgt.addDaysOfWeek(convertDaysOfWeek(t.getValue())); + copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); if (src.hasAllDay()) tgt.setAllDayElement(convertBoolean(src.getAllDayElement())); if (src.hasAvailableStartTime()) @@ -218,7 +218,7 @@ public class HealthcareService extends VersionConvertor_40_50 { org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceAvailableTimeComponent tgt = new org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceAvailableTimeComponent(); copyElement(src, tgt); for (org.hl7.fhir.r5.model.Enumeration t : src.getDaysOfWeek()) - tgt.addDaysOfWeek(convertDaysOfWeek(t.getValue())); + copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); if (src.hasAllDay()) tgt.setAllDayElement(convertBoolean(src.getAllDayElement())); if (src.hasAvailableStartTime()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ImplementationGuide.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ImplementationGuide.java index 608dc1d9f..1b913037f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ImplementationGuide.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ImplementationGuide.java @@ -96,7 +96,7 @@ public class ImplementationGuide extends VersionConvertor_40_50 { if (src.hasLicense()) tgt.setLicense(convertSPDXLicense(src.getLicense())); for (org.hl7.fhir.r4.model.Enumeration t : src.getFhirVersion()) - tgt.addFhirVersion(Enumerations.convertFHIRVersion(t.getValue())); + copyElement(t, tgt.addFhirVersionElement().setValue(Enumerations.convertFHIRVersion(t.getValue()))); for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDependsOnComponent t : src.getDependsOn()) tgt.addDependsOn(convertImplementationGuideDependsOnComponent(t)); for (org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) @@ -144,7 +144,7 @@ public class ImplementationGuide extends VersionConvertor_40_50 { if (src.hasLicense()) tgt.setLicense(convertSPDXLicense(src.getLicense())); for (org.hl7.fhir.r5.model.Enumeration t : src.getFhirVersion()) - tgt.addFhirVersion(Enumerations.convertFHIRVersion(t.getValue())); + copyElement(t, tgt.addFhirVersionElement().setValue(Enumerations.convertFHIRVersion(t.getValue()))); for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDependsOnComponent t : src.getDependsOn()) tgt.addDependsOn(convertImplementationGuideDependsOnComponent(t)); for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) @@ -984,7 +984,7 @@ public class ImplementationGuide extends VersionConvertor_40_50 { if (src.hasReference()) tgt.setReference(convertReference(src.getReference())); for (org.hl7.fhir.r4.model.Enumeration t : src.getFhirVersion()) - tgt.addFhirVersion(Enumerations.convertFHIRVersion(t.getValue())); + copyElement(t, tgt.addFhirVersionElement().setValue(Enumerations.convertFHIRVersion(t.getValue()))); if (src.hasName()) tgt.setNameElement(convertString(src.getNameElement())); if (src.hasDescription()) @@ -1004,7 +1004,7 @@ public class ImplementationGuide extends VersionConvertor_40_50 { if (src.hasReference()) tgt.setReference(convertReference(src.getReference())); for (org.hl7.fhir.r5.model.Enumeration t : src.getFhirVersion()) - tgt.addFhirVersion(Enumerations.convertFHIRVersion(t.getValue())); + copyElement(t, tgt.addFhirVersionElement().setValue(Enumerations.convertFHIRVersion(t.getValue()))); if (src.hasName()) tgt.setNameElement(convertString(src.getNameElement())); if (src.hasDescription()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Location.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Location.java index 702a36b51..91550e195 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Location.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/Location.java @@ -220,7 +220,7 @@ public class Location extends VersionConvertor_40_50 { org.hl7.fhir.r5.model.Location.LocationHoursOfOperationComponent tgt = new org.hl7.fhir.r5.model.Location.LocationHoursOfOperationComponent(); copyElement(src, tgt); for (org.hl7.fhir.r4.model.Enumeration t : src.getDaysOfWeek()) - tgt.addDaysOfWeek(convertDaysOfWeek(t.getValue())); + copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); if (src.hasAllDay()) tgt.setAllDayElement(convertBoolean(src.getAllDayElement())); if (src.hasOpeningTime()) @@ -236,7 +236,7 @@ public class Location extends VersionConvertor_40_50 { org.hl7.fhir.r4.model.Location.LocationHoursOfOperationComponent tgt = new org.hl7.fhir.r4.model.Location.LocationHoursOfOperationComponent(); copyElement(src, tgt); for (org.hl7.fhir.r5.model.Enumeration t : src.getDaysOfWeek()) - tgt.addDaysOfWeek(convertDaysOfWeek(t.getValue())); + copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); if (src.hasAllDay()) tgt.setAllDayElement(convertBoolean(src.getAllDayElement())); if (src.hasOpeningTime()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ObservationDefinition.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ObservationDefinition.java index b388b44cb..f107aee21 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ObservationDefinition.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/ObservationDefinition.java @@ -72,7 +72,7 @@ public class ObservationDefinition extends VersionConvertor_40_50 { for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); for (org.hl7.fhir.r4.model.Enumeration t : src.getPermittedDataType()) - tgt.addPermittedDataType(convertObservationDataType(t.getValue())); + copyElement(t, tgt.addPermittedDataTypeElement().setValue(convertObservationDataType(t.getValue()))); if (src.hasMultipleResultsAllowed()) tgt.setMultipleResultsAllowedElement(convertBoolean(src.getMultipleResultsAllowedElement())); if (src.hasMethod()) @@ -106,7 +106,7 @@ public class ObservationDefinition extends VersionConvertor_40_50 { for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t)); for (org.hl7.fhir.r5.model.Enumeration t : src.getPermittedDataType()) - tgt.addPermittedDataType(convertObservationDataType(t.getValue())); + copyElement(t, tgt.addPermittedDataTypeElement().setValue(convertObservationDataType(t.getValue()))); if (src.hasMultipleResultsAllowed()) tgt.setMultipleResultsAllowedElement(convertBoolean(src.getMultipleResultsAllowedElement())); if (src.hasMethod()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/PractitionerRole.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/PractitionerRole.java index 6969483c3..4f5d824d8 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/PractitionerRole.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/PractitionerRole.java @@ -138,7 +138,7 @@ public class PractitionerRole extends VersionConvertor_40_50 { org.hl7.fhir.r5.model.PractitionerRole.PractitionerRoleAvailableTimeComponent tgt = new org.hl7.fhir.r5.model.PractitionerRole.PractitionerRoleAvailableTimeComponent(); copyElement(src, tgt); for (org.hl7.fhir.r4.model.Enumeration t : src.getDaysOfWeek()) - tgt.addDaysOfWeek(convertDaysOfWeek(t.getValue())); + copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); if (src.hasAllDay()) tgt.setAllDayElement(convertBoolean(src.getAllDayElement())); if (src.hasAvailableStartTime()) @@ -154,7 +154,7 @@ public class PractitionerRole extends VersionConvertor_40_50 { org.hl7.fhir.r4.model.PractitionerRole.PractitionerRoleAvailableTimeComponent tgt = new org.hl7.fhir.r4.model.PractitionerRole.PractitionerRoleAvailableTimeComponent(); copyElement(src, tgt); for (org.hl7.fhir.r5.model.Enumeration t : src.getDaysOfWeek()) - tgt.addDaysOfWeek(convertDaysOfWeek(t.getValue())); + copyElement(t, tgt.addDaysOfWeekElement().setValue(convertDaysOfWeek(t.getValue()))); if (src.hasAllDay()) tgt.setAllDayElement(convertBoolean(src.getAllDayElement())); if (src.hasAvailableStartTime()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/SearchParameter.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/SearchParameter.java index 701e94781..a46f6f5f6 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/SearchParameter.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/SearchParameter.java @@ -110,9 +110,9 @@ public class SearchParameter extends VersionConvertor_40_50 { if (src.hasMultipleAnd()) tgt.setMultipleAndElement(convertBoolean(src.getMultipleAndElement())); for (org.hl7.fhir.r4.model.Enumeration t : src.getComparator()) - tgt.addComparator(convertSearchComparator(t.getValue())); + copyElement(t, tgt.addComparatorElement().setValue(convertSearchComparator(t.getValue()))); for (org.hl7.fhir.r4.model.Enumeration t : src.getModifier()) - tgt.getModifier().add(convertSearchModifierCode(t)); + copyElement(t, tgt.addModifierElement().setValue(convertSearchModifierCode(t.getValue()))); for (org.hl7.fhir.r4.model.StringType t : src.getChain()) tgt.getChain().add(convertString(t)); for (org.hl7.fhir.r4.model.SearchParameter.SearchParameterComponentComponent t : src.getComponent()) @@ -170,9 +170,9 @@ public class SearchParameter extends VersionConvertor_40_50 { if (src.hasMultipleAnd()) tgt.setMultipleAndElement(convertBoolean(src.getMultipleAndElement())); for (org.hl7.fhir.r5.model.Enumeration t : src.getComparator()) - tgt.addComparator(convertSearchComparator(t.getValue())); + copyElement(t, tgt.addComparatorElement().setValue(convertSearchComparator(t.getValue()))); for (org.hl7.fhir.r5.model.Enumeration t : src.getModifier()) - tgt.getModifier().add(convertSearchModifierCode(t)); + copyElement(t, tgt.addModifierElement().setValue(convertSearchModifierCode(t.getValue()))); for (org.hl7.fhir.r5.model.StringType t : src.getChain()) tgt.getChain().add(convertString(t)); for (org.hl7.fhir.r5.model.SearchParameter.SearchParameterComponentComponent t : src.getComponent()) @@ -237,57 +237,47 @@ public class SearchParameter extends VersionConvertor_40_50 { case EB: return org.hl7.fhir.r4.model.SearchParameter.SearchComparator.EB; case AP: return org.hl7.fhir.r4.model.SearchParameter.SearchComparator.AP; default: return org.hl7.fhir.r4.model.SearchParameter.SearchComparator.NULL; - } -} - - public static org.hl7.fhir.r5.model.Enumeration convertSearchModifierCode(org.hl7.fhir.r4.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.SearchParameter.SearchModifierCodeEnumFactory()); - copyEnumeration(src, tgt); - if (src.hasValue()) { - switch (src.getValue()) { - case MISSING: tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.MISSING); break; - case EXACT: tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.EXACT); break; - case CONTAINS: tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.CONTAINS); break; - case NOT: tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.NOT); break; - case TEXT: tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.TEXT); break; - case IN: tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.IN); break; - case NOTIN: tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.NOTIN); break; - case BELOW: tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.BELOW); break; - case ABOVE: tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.ABOVE); break; - case TYPE: tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.TYPE); break; - case IDENTIFIER: tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.IDENTIFIER); break; - case OFTYPE: tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.OFTYPE); break; - default: tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.NULL); break; - } } - return tgt; } - public static org.hl7.fhir.r4.model.Enumeration convertSearchModifierCode(org.hl7.fhir.r5.model.Enumeration src) throws FHIRException { + public static org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode convertSearchModifierCode(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode src) throws FHIRException { 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.SearchParameter.SearchModifierCodeEnumFactory()); - copyEnumeration(src, tgt); - if (src.hasValue()) { - 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; - } + switch (src) { + case MISSING: return org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.MISSING; + case EXACT: return org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.EXACT; + case CONTAINS: return org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.CONTAINS; + case NOT: return org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.NOT; + case TEXT: return org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.TEXT; + case IN: return org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.IN; + case NOTIN: return org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.NOTIN; + case BELOW: return org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.BELOW; + case ABOVE: return org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.ABOVE; + case TYPE: return org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.TYPE; + case IDENTIFIER: return org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.IDENTIFIER; + case OFTYPE: return org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.OFTYPE; + default: return org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.NULL; + } + } + + public static org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode convertSearchModifierCode(org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode src) throws FHIRException { + if (src == null) + return null; + switch (src) { + case MISSING: return org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.MISSING; + case EXACT: return org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.EXACT; + case CONTAINS: return org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.CONTAINS; + case NOT: return org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.NOT; + case TEXT: return org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.TEXT; + case IN: return org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.IN; + case NOTIN: return org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.NOTIN; + case BELOW: return org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.BELOW; + case ABOVE: return org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.ABOVE; + case TYPE: return org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.TYPE; + case IDENTIFIER: return org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.IDENTIFIER; + case OFTYPE: return org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.OFTYPE; + default: return org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.NULL; } - 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/StructureMap.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/StructureMap.java index d80529a78..aebbac2c9 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/StructureMap.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/StructureMap.java @@ -458,7 +458,7 @@ public class StructureMap extends VersionConvertor_40_50 { if (src.hasVariable()) tgt.setVariableElement(convertId(src.getVariableElement())); for (org.hl7.fhir.r4.model.Enumeration t : src.getListMode()) - tgt.addListMode(convertStructureMapTargetListMode(t.getValue())); + copyElement(t, tgt.addListModeElement().setValue(convertStructureMapTargetListMode(t.getValue()))); if (src.hasListRuleId()) tgt.setListRuleIdElement(convertId(src.getListRuleIdElement())); if (src.hasTransform()) @@ -482,7 +482,7 @@ public class StructureMap extends VersionConvertor_40_50 { if (src.hasVariable()) tgt.setVariableElement(convertId(src.getVariableElement())); for (org.hl7.fhir.r5.model.Enumeration t : src.getListMode()) - tgt.addListMode(convertStructureMapTargetListMode(t.getValue())); + copyElement(t, tgt.addListModeElement().setValue(convertStructureMapTargetListMode(t.getValue()))); if (src.hasListRuleId()) tgt.setListRuleIdElement(convertId(src.getListRuleIdElement())); if (src.hasTransform())